A question for MQL experts - page 17

 

Who told you this is an error?

The screenshot clearly shows that your Expert Advisor uses the ErrorDescription function with the type string

There is no error. The new build has just added a convenient feature - now you can see which functions are used by the EA from the dll and the libraries.

 
Rita:

Both folders (Incloud and Libraries) contain stdlib sources. Just in case, I added-copied from the Incloud folder.

But the error described above is still displayed in the "dependencies" tab. Maybe somehow change the calling of these functions: Instead of:

Set the call in some other way?

Or will it be impossible to use I.Kim's functions in the latest version of mt4 now?


1) Open stdlib.mq4 file in the Libraries folder

2) compile it

3) should work without errors

 

Thank you all for your answers and recommendations. Another small question.

As I understood - the names of global variables are now highlighted in red in the code. However, in my code there are composite names, some of which coincide with the global ones. And this matching part, for some reason, is also highlighted in red!

Can it have a negative impact on the EA operation? Or there is nothing wrong with such partial highlighting?

 
Rita:

Thank you all for your answers and recommendations. Another small question.

As I understood - the names of global variables are now highlighted in red in the code. However, in my code there are composite names, some of which coincide with the global ones. And this matching part, for some reason, is also highlighted in red!

Can it have a negative impact on the EA operation? Or there is nothing wrong with such partial highlighting?


There is nothing wrong, but you should contact ServiceDesk to have it corrected.
 
I haven't heard of such a service. Please give me a link.
 
Rita:
I haven't heard of such a service. Please give me a link.

You have to register at mql5.com forum, there will be a link in your profile.
 
The Russian language is lit in red and what you have globally is lit a little differently, no problem for you ....
 

Good morning!

After updating MT4 - the indicator that was working fine before stopped drawing its line. And it was found out that somehow the code of the indicator strongly affects the work of the processor on old versions of MT4 with a forcibly updated meta-editor. But about that later.

After the update when I install the indicator on the chart the set line is drawn glitchy and wrong (based on the closing price difference of 2 specified symbols). When switching timeframe line disappears at all (empty window), and the inscription in the log appears:

and after several timeframe switches (or restarting mt4) the indicator disappears from the chart altogether:

2014.02.25 10:22:38.640 Custom indicator Spread-I-env #GCJ4,M30: removed

Please advise what could be the reason? What is this strange error:

2014.02.25 10:21:07.437Access violation read to 0x000003E5 in 'C:\Program Files\InstaTrader\MQL4\indicators\Spread-I-env- mod1.ex4'

 

Hello!

Can you please tell me how to find the background colour of the graph in the new builds?

In the old ones I found it like this:

#import "user32.dll"

int GetWindowDC(int h);

int ReleaseDC(int h, int hDC);

bool GetWindowRect(int h, int& pos[4]);

#import

#import "gdi32.dll"

int GetPixel(int hDC, int x, int y);

#import

//+------------------------------------------------------------------+

//| script program start function |

//+------------------------------------------------------------------+

void start()

{

int col = getBackgroundColor();

if (col==-1) MessageBox("No corner of the window is visible.");

else MessageBox("Background colour: " + col);

}

//+------------------------------------------------------------------+

int getBackgroundColor()

{

int h = WindowHandle(Symbol(), Period());

int hDC = GetWindowDC(h);

int col = GetPixel(hDC, 2, 2);

if(col==-1) {

// top-left corner is not visible

int rect[4];

GetWindowRect(h, rect);

int wW = rect[2] - rect[0]; // window width

int wH = rect[3] - rect[1]; // window height

col = GetPixel(hDC, wW-3, wH-3); // lower right corner

if(col==-1) col = GetPixel(hDC, 2, wH-3); // BOW

if(col==-1) col = GetPixel(hDC, wW-3, 2); // LNT

}

ReleaseDC(h, hDC);

return(col);

}

Doesn't work in new ones!

 

Thank you, that clears the question. Figured it out myself!

Color Color = ChartGetInteger( 0, CHART_COLOR_BACKGROUND, 0 );