The bar that generates tomorrow's signals.
Rename
Following the PlaceTrade statement, the if (Bar == Bars.Count-1) below makes this test and then acts accordingly.
CODE:sharpeRatioVal is a custom class that computes the Sharpe Ratio for the final bar. The code above attaches that Sharpe Ratio to the final Position on the Chart so it shows up in the Strategy Monitor Weight column for buys.
else if (mfoConsecUp[bar] > 2.0 && decorDirection[bar] > 1.0 && vossPredictorVelocity[bar] > vossPredictVelThres[bar]) { Transaction t = PlaceTrade(bars, TransactionType.Buy, OrderType.Stop, bars.Close[bar]+atr22[bar]*0.14, "Voss Money Flow buy"); t.SetPositionMetric("merit rank", dxSmoothedThres.MeritRank(bar)); if (bar == bars.Count-1) //Is this the last bar on the Chart? { t.SetPositionMetric("sharpe ratio", sharpeRatioVal.LastBar(true)); t.Weight = sharpeRatioVal.LastBar(); t.SignalName = sharpeRatioVal.ConsecWins("0 ") + t.SignalName; //WriteToDebugLog(sharpeRatioVal.LastBar()); } }
Right on the money, Superticker!
Thanks @superticker
Your Response
Post
Edit Post
Login is required