Download MetaTrader 5

Why is ChartWidthInPixels() giving different results?

To add comments, please log in or register
Have you found an error in our products? Apply to Service Desk!
Philb1
34
Philb1 2016.07.10 02:33 

Hello

Can someone tell me why the chart width is 1628 pixels wide when MT4 is opened, and after compiling, it is 1861 pixels wide using the same code. To see it I'm using Comment(ChartWidthInPixels());


Thanks

int ChartWidthInPixels(const long chart_ID=0)// Get chart width in pixels function
  {
//--- prepare the variable to get the property value
   long result=-1;
//--- reset the error value
   ResetLastError();
//--- receive the property value
   if(!ChartGetInteger(chart_ID,CHART_WIDTH_IN_PIXELS,0,result))
     {
      //--- display the error message in Experts journal
      Print(__FUNCTION__+", Error Code = ",GetLastError());
     }
//--- return the value of the chart property
   return((int)result);
  }
To add comments, please log in or register