Getting the chart width

Moderator: admin

Getting the chart width

Postby philbl » Fri Jun 24, 2016 6:40 am

Hello
I've written my first mql4 code & have it working almost as I want. I have found and cant find a way around it, is that getting the chart width is different when starting MT4, to when MT4 is already running and the compile button is pressed. I'm using this code
Code: Select all
int chartwidth = ChartGetInteger(Symbol(),CHART_WIDTH_IN_PIXELS,0);

to get the width & it works. Open MT4 and the chart width is 1564, compile the code with the same chart active and the width is 1854. This is making the text display in the wrong place when MT4 starts.
Any idea why this happens?

Thanks
philbl
 
Posts: 12
Joined: Thu Oct 18, 2012 10:34 pm

Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 15 guests