How to track changes in grid height?

 
I noticed that the pips range on the right side of the chart keeps changing from time to time. Is it possible to track it somehow inside my EA code?
Also what is the reason behind it? Why does it change?
 
Mikołaj Gogola:
I noticed that the pips range on the right side of the chart keeps changing from time to time. Is it possible to track it somehow inside my EA code?
Also what is the reason behind it? Why does it change?

You can refer to https://www.mql5.com/en/forum/204408#comment_5307162

Reason being Metatrader wants to display the full price range of all bars on display... you can go to chart properties and play around with the scale settings.

Chart Price Max/Min
Chart Price Max/Min
  • 2017.06.16
  • www.mql5.com
Does anyone know how mt4 calculates CHART_PRICE_MAX and CHART_PRICE_MIN...
 
Thank you!