The following script works for Subwindow=0, not for Subwindow=1 (it will return both values as 0)
Also, if the same code is put into EA, and even for Subwindow=0, it works only the first Run, but if i drag another currency to the chart, it gives also 0,0.
It this a bug?
I am trying to fit a custom made chart into a narrow subwindow...
Yes it's a bug.
The workaround is to use the OnTimer event. first enable the timer for a second in OnInit, than put your code in the timer to read priceMin and priceMax and stop the timer.
I think MT5 runs the user code before initialization of some internal chart properties which causes this problem. using a timer you can get the values after your programs first run.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
The following script works for Subwindow=0, not for Subwindow=1 (it will return both values as 0)
Also, if the same code is put into EA, and even for Subwindow=0, it works only the first Run, but if i drag another currency to the chart, it gives also 0,0.
It this a bug?
I am trying to fit a custom made chart into a narrow subwindow...