endless loop in Simple EA (Book)

 

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

 
And should count down only.
 
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 . . .
 
Unfortunately there are a lot of typos/errors in the book.
 

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


 
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)

Reason: