Download MetaTrader 5
To add comments, please log in or register
Read the Forum and improve your rating!
raven.chrono
324
raven.chrono 2014.06.30 08:05 

Hi.

I would like to ask if you know how to get the width and height of a char window because i want to create EA objects that programmatically adjust to the windows height and width...


Thanks...

qjol
3243
qjol 2014.06.30 08:16  
whroeder1
13593
whroeder1 2014.06.30 10:49  
void     GetChartLimits(int&iLeft, int&iRight, double&top, double&bot,int iW=0){
   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
Ian Venner
2583
Ian Venner 2014.07.01 14:43  
long height = ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS,0);
long width = ChartGetInteger(0,CHART_WIDTH_IN_PIXELS,0);
/
To add comments, please log in or register