Download MetaTrader 5

endless loop in Simple EA (Book)

To add comments, please log in or register
Are you accustomed to using the standard library? MQL5 has one!
Kai
12
Kai 2013.11.09 15:44 

Hi,

// Orders accounting
   Symb=Symbol();                               // Security name
   Total=0;                                     // Amount of orders
   for(int i=1; i>=OrdersTotal(); i++)

i>= is an endless loop. its very painfull for beginners to find this out. shoul be i<

https://book.mql4.com/samples/expert

kai

whroeder1
14470
whroeder1 2013.11.09 15:58  
And should count down only.
Simon Gniadkowski
Moderator
17998
Simon Gniadkowski 2013.11.09 16:49  
kai700:

Hi,

i>= is an endless loop. its very painfull for beginners to find this out. shoul be i<

https://book.mql4.com/samples/expert

kai

The best learned lessons are the most painful ones . . .
Alain Verleyen
Moderator
30707
Alain Verleyen 2013.11.09 18:16  
Unfortunately there are a lot of typos/errors in the book.
Alain Verleyen
Moderator
30707
Alain Verleyen 2013.11.09 18:17  

Unfortunately there are a lot of typos/errors in the book.

RaptorUK:
The best learned lessons are the most painful ones . . .

and it's probably to help people to learn


Kai
12
Kai 2013.11.30 12:23  
angevoyageur:
Unfortunately there are a lot of typos/errors in the book.

...to much typos/errors for me, found another one in function

int New_Stop(int Parametr) // Checking stop levels
{
int Min_Dist=MarketInfo(sSymbol,MODE_STOPLEVEL);// Minimal distance
if (Parametr > Min_Dist) // If less than allowed
{
Parametr=Min_Dist; // Sett allowed
Alert("Increased distance of stop level. Parametr", Parametr);
}
return(Parametr); // Returning value

}

----

should be: if (Parametr < Min_Dist)

To add comments, please log in or register