I have written a script to display horizontal lines based on input values. I use DrawHorizontalLine for this. What I have noticed is that if one of the lines is outside the current chart area, the window is automatically scalled to display the line.
For example, I am displaying bars in the current window of $AUDUSD ranging from 1.017 to 1.028,
One of my lines is defined to be displayed at 1.0330. Now when applying the indicator the chart compresses to fit in the line at 1.0330.
I would like the line to only become visible when price reaches the area as is normal behaviour when placing a Horizontal Line on a chart. How can I achieve this in the indicator?
I have attached a chart illustrating the problem;
Thanks Thomas
Comment