The chart panels have the ability to auto-scale the y-axis (price).
When this happens the item(s)(variable’s) highest high and or lowest low are used to set the approximate visible y-scale range for the panel.
Only certain drawing items invoke the auto y-scale, such as DRAWCANDLE(,,,), there maybe others but, I don’t think that DRAWARROWUP is one of them.
As an example, the candles high’s and low’s are plotted, and the highest high and lowest low of all the visible candles displayed in the chart frame, sets the range .
This is why a new candle that create a new visible higher high and/or lower low, adjust the y-scale range.
This also can happen when the left most candle falls off screen and its was the visible highest high or lowest low.
The reason for mentioning DRAWCANDLE is that the candles drawn in the PRICE panel appear to work the same way.
Adding you code indicator to the price panel, would probably display the arrows, if nothing else wrong, since the arrows y position would be close to the low value of the candle.
Unless, it just happens to be at the extreme of visible range.
If creating a new panel, the scale range doesn’t have the price candles to set the range, which defaults around zero.
Variables displayed, using the RETURN line of an INDICATOR, also invoke the auto y-scale.
In your code example, you use RETURN, making it INDICATOR code, also no variables are on the RETURN line to invoke the y-scale.
If I’m right, DRAWARROWUP also does not invoke the auto y-scale, and if your creating a new panel, then I would expect a panel to be set around zero.
You can drag the charts y scale to expose the value where the arrows should be, but the lack of auto scale can reset it back to zero.
A simple test would be to add LOW, HIGH to the return line, this would invoke the auto scale around the HIGHER high and lower low and hopefully display the arrow, if in the visible scope of the chart.
Saying ‘ I just get a blank chart’ I assume your creating a new chart panel.
2 users thanked author for this post.