- ago
The bar that generates tomorrow's signals.
0
985
Solved
3 Replies

Reply

Bookmark

Jump to End
- ago
#1
Following the PlaceTrade statement, the if (Bar == Bars.Count-1) below makes this test and then acts accordingly.

CODE:
   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());       }    }
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.
2
Best Answer
- ago
#2
Right on the money, Superticker!
1
- ago
#3
Thanks @superticker
1

Reply

Bookmark

Jump to Top