I'm developing a new indicator and for drawing this indicator I have to override the plot method. My indicator Has to draw a line between two bars, the beginning and the end of the zone where this indicator is calculated.
For drawing this line I have to get the coords of this two bars. For doing this I start looking all bars from ChartControl.FirstBarPainted on until I find my two bars and I calculate the offset from this first painted bar to my two bars and after that I calc the coords this way:
initial x = bounds.x + (offset to beginning bar * (ChartControl.BarWidth+ChartControl.BarSpace))
final x = bounds.x + (offset to final bar * (ChartControl.BarWidth+ChartControl.BarSpace))
Bounds is the rectangle object parameter for the plot method and I suppose firstpaintedbar is painted the most possible to the left.
The coords I have for initial x and final x are bigger than bounds.x+bounds.width. How Can I get the width a the bar (distance from beggining of bar to beginning of next bar) and the starting point where bars are plotted?
Thanks in advance
Comment