I'm creating an MT4 EA in mql4, and would like to automatically adjust the price scale (y-axis) shown, based on some indicator results.
I.e. I have (y-max, y-min) values from a pivot indicator, and would like to re-scale my chart to center on the pivot line, regardless of where the current price is. For example, in the figure shown, I'd like to see the scale between the orange and yellow lines. Perhaps adding a few pixels above and below for visibility.
Unfortunately the MT4 forums are very lacking in the info on this, and I cannot even find a starting point. Possibly related info here:
- https://docs.mql4.com/constants/chartconstants/enum_chart_property
- https://book.mql4.com/functions/charts
- https://www.mql5.com/en/forum/154523
How can I have my EA to resize/re-scale the price range for the current chart window?
(Possibly as a percentage of the total available size.)