It just doesn't make any sense at all to use ChartBars.FromIndex or ToIndex in OnBarUpdate().
The from and to index are completely visual. It doesn't make sense to put stuff that is visual based in OnBarUpdate().
But that said, it will work in OnBarUpdate() as demonstrated in the test script I have provided you and the video.
What about that print won't work?
Does the time of the bar not match the chart for that bar number?
Are you getting an error?
Is this the only line of code in the script?
Are you certain that is the line causing the issue?
Comment