Programatically adjust Y scale on chart

 
Is it possible in code to adjust the vertical scale on a chart? To be sure, what I mean is, hold the mouse button on the scale and move the mouse forward or backwards. Thanks and good luck all.
 

I don't really understand your problem. You can place your mouse on the scale of the prices, press the left mouse button and move your mouse up and down - is it this?

And here are all the function to manipulate the chart: https://www.mql5.com/en/docs/chart_operations

Documentation on MQL5: Chart Operations
Documentation on MQL5: Chart Operations
  • www.mql5.com
Chart Operations - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
  1. Add Scale Fix: how do i delete an erroneus bar - MQL5 programming forum (2020)

    Turn off autoscaling and drag the vertical scale or the chart. (Remember to turn is back on before minimizing the chart on MT4, or you will have to use F8; don't know about MT5.)

  2. Turn off auto-scaling: uncheck Chart Right-click → Properties (F8) → Common → Scale Fix and you can drag the price scale to show less.
              how do i delete an erroneus bar - MQL5 programming forum (2020)

 
Carl Schreiber #:

I don't really understand your problem. You can place your mouse on the scale of the prices, press the left mouse button and move your mouse up and down - is it this?

And here are all the function to manipulate the chart: https://www.mql5.com/en/docs/chart_operations

The goal is to write a script that configures my trading screen. I've got most of this working, but because of my layout has only a few bars visible I have to adjust the Y axis to make some other chart objects visible (MAs, envelopes and the likes).

I found a reply on SO which I think could work for me https://stackoverflow.com/a/59291759
How can I automatically rescale the price range shown on the current chart? (MT4 EA)
How can I automatically rescale the price range shown on the current chart? (MT4 EA)
  • 2019.12.11
  • not2qubit not2qubit 12.2k 7 7 gold badges 85 85 silver badges 115 115 bronze badges
  • stackoverflow.com
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...
Reason: