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