Specifically SampleEveryNBarTest contains this code:
protected override void OnBarUpdate()
{
/* Checks to see if the current bar has a valid indicator plot value set on indicator plot: Value. It is important to check this to know if the values you are
using are relevant or not. Using irrelevant values for your script logic can cause inaccurate calculations and trade signals. */
if(!SampleEveryNBar(N).Value.IsValidDataPoint(0))
{
// SampleEveryNBar does not have a valid indicator plot value. Set hosting indicator's plot to zero and paint the bar red.
BarBrushes[0] = Brushes.Red;
PlotBrushes[0][0] = Brushes.Red;
Value[0]= 0;
}
else
{
// SampleEveryNBar does have a valid indicator plot value. Set hosting indicator's plot to this value and paint the bar blue.
BarBrushes[0] = Brushes.Blue;
PlotBrushes[0][0] = Brushes.Blue;
double val = SampleEveryNBar(N).Value[0];
Value[0] = val;
}
}
Can you help clarify whether the documentation is wrong or misleading on this? Or specifically under what circumstances the maximum lookback becomes a problem?
Thanks,
Steve

Comment