When using this approach I get Lines that are closer or further away from price, as the Y scale Changes, or when the indicator is applied to a chart with a different TickSize.
I could make things more consistent if I could place Lines by a Pixel Offset, say 6 pixels, from a price value. So if on a given chart, 1 Tick (TickSize) is equivalent to 12 pixels then to draw 6 pixels off Price I could use "6/12*TickSize" as the offset . Then, later on that chart, as price action changes a single Tick might be 30 pixels. Then in placing Lines I would use "6/30*TickSize" as the Offset in both cases placing lines at 6 pixels from price.
ChartControl.Height will give # of pixels for the Entire Chart window. If I could get the # of pixels in just the pricePanel, and the Max&Min Prices displayed there then I could calculate the "pixels/Tick".
Question:
Can I do this?
Is there another (better) way.
Comment