Pine-script: Automatic zoom on y axis according to min and max levels of candlesticks

Viewed 199

Can an indicator perform an automatic zoom of the y axis by choosing y min level as the min value of the candlesticks (incl. wicks) on the chart, and similarly the y max level as the max value of the candlesticks? If so, how can this be coded used Pine Scripts?

This could be the solution written in Matlab (but I obviously need it in Pine Script):

ymin = min(close)
ymax = max(close)
plot(...)
ylim([ymin ymax])
1 Answers

Currently, this cannot be done in Pine, because there's no Pine code available that allows interaction with the chart or the axises. You can see a list of all available commands in the Pine Script language reference manual

Related