I have secondary series of 5 second & 1, 2, 3, and 5 minute
In my example below I am on the 1 min chart.
For Rendering purposes, I'm trying to match stuff I render on the screen with my right margin. I don't want stuff "pre-rendering" before I see the bar when scrolling through a chart.
Seems like a pretty simple concept if I know the index of the last bar rendered on the chart, ChartBars.ToIndex, and the index for various things I render, Time[0].
I know I can get in trouble with the difference between the index that starts on the right side at bar 0, aka Time[0], and the index that starts with the first bar in the series on the left side. But I don't think that is my problem... yet
When I put this in my indicator
Print(ChartBars.ToIndex + " " + Count + " " + CurrentBar);
Sees like the last visible bar on my chart is 2545 when there are only 510 bars on my chart.
When I scroll to the beginning of my chart I get this. The 105 is correct in this case. That is the index of the last bar on the right side of the chart.
I just want to check and if an object doesn't have a "start index" to the left of ChartBars.ToIndex I won't render it. it will keep me from cheating

what am I missing?

Comment