BUT, when this method is used in an indicator on a TickReplay chart, even if there IS a null reference check, there will be null reference exceptions as the chart loads.
The error occurs when the ChartBars.ToIndex exceeds the CurrentBar. Checking to make sure that is not the case seems to eliminate the error.
Sample code attached. Run on a tick replay chart and see what happens if you disable the filter for that condition. This indicator is intended to be placed in a folder called Bands.
Comment