I defined an indicator using the Wizard and it produced the following code:
AddPlot(Brushes.Transparent, "TwTOP");
AddPlot(Brushes.Transparent, "TwBOT");
AddPlot(Brushes.Transparent, "TwRiskDlr");
AddPlot(new Stroke(Brushes.OrangeRed, 2), PlotStyle.Dot, "TwStopLoss");
I also defined these Series<T>
upTrend = new Series<bool>(this, MaximumBarsLookBack.Infinite);
twDlyTrendCnt = new Series<double>(this, MaximumBarsLookBack.Infinite);
twTrendBarCnt = new Series<double>(this, MaximumBarsLookBack.Infinite);
twBarColor = new Series<string>(this, MaximumBarsLookBack.Infinite);
The indicator works fine, but when I try to test for IsValidDataPoint(0) in OnBarUpdate, on both the Plots and Series<T> from within a Strategy, the statements that reference the Plots fail with exception....
IsValidDataPoint cannot be used on a series running with MaximumBarsLookBack.TwoHundredFiftySix
What I`m trying to do is.. convert a strategy from NT7 to NT8 using NT8.0.0.8 64bit.
In NT7 the code is:
if (!AuLbTradeWindow(false, false, false, false, dblDollarSL, 50).twTOP.ContainsValue(0)) { Print("twTOP has no value @Time=" + Time[0].ToString()); }
In NT8 I rewrote to be:
if (!AuLbTradeWindow(false, false, false, false, 50, DblDollarSL).TwTOP.IsValidDataPoint(0)) { Print("twTOP has no value @Time=" + Time[0].ToString()); bolError = true; }
I understood from the documentation that plots should be checked for valid values.
Should the definition of the indicator plots be defined differently to allow a strategy to check IsValidDataPoint ?
Could you please let me know what I may have done wrong here OR is this something not quite right with NT8.0.0.8 ?
Thank you
Comment