Does anyone know how mt4 calculates CHART_PRICE_MAX and CHART_PRICE_MIN ?
Pre-build 600
Post-build 600
Returns the maximal value of the vertical scale of the specified subwindow of the current chart |
||
Returns the minimal value of the vertical scale of the specified subwindow of the current chart |
Chart maximum |
||
Chart minimum |
#define WINDOW_MAIN 0 void GetChartLimits(int&iLeft, int&iRight, double&top, double&bot,int iW=0){ /* MT4 build 445: In the tester (visual mode,) on the first tick, these * routines return left=100, right=37 (depends on default bar scaling.) * This is what the chart looks like when you maximize it while it is * generating the FXT file. On ticks after that, it appears like the * left/right are correct but the hi/lo are one tick behind the displayed * chart. On the start of a new bar, the hi/lo can be off when a recent * extreme drops off but the scale hasn't resized. I tried calling * WindowRedraw() first but that did not change results. I don't know * about live charts. */ top = WindowPriceMax(iW); iLeft = WindowFirstVisibleBar(); bot = WindowPriceMin(iW); iRight = iLeft-WindowBarsPerChart(); if(top-bot < pips2dbl) top = bot+pips2dbl; // Avoid scroll bug / div0 if(iRight < 0) iRight = 0; // Chart is shifted. } // GetChartLimits //////////////////////////////////////////////////////////////////////////////// int iLeft,iRight; double top,bot; GetChartLimits(iLeft, iRight, top, bot);
whroeder1:
Pre-build 600 Post-build 600
Pre-build 600 Post-build 600
Thank you for the reply. It's easier to get the data from the tester than what I had intended to do.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register