Is there any way to get the barnumbers that are visible on the screen? I want to place some infomation in bubbles on the left edge of the screen regardless of the zoom level. Seems to do that I need to know the visible barnumbers, not those of the complete timesettup.
Add this code to a lower Study on you chart that incorporates a ZeroLine in it .
Change the existing ZeroLine code to:
plot ZeroLine = BarNumber() / 10000000;
ZeroLine.SetDefaultColor(color.LIME);
As you move your cursor across the chart the bar number will change on the information bar at the top of the lower chart. Whichever bar you stop at ,the corresponding bar number will appear. You can change the color to your personal preference. Hope this helps.