My ea doesnt backtest and demo trade

 

Please I want people using this forum to help me correct error that could not make this attached ea backtest or demo trade. There was no error during compilation yet doest work. Please help

Files:
eauking.mqh  16 kb
 
270783:

Please I want people using this forum to help me correct error that could not make this attached ea backtest or demo trade. There was no error during compilation yet doest work. Please help

Your EA had an endless loop in the very first "for loop" that counts your open trades. You had "i>=OrdersTotal()" instead of "i<=Orderstotal()".

 
252525 wrote >>

Your EA had an endless loop in the very first "for loop" that counts your open trades. You had "i>=OrdersTotal()" instead of "i<=Orderstotal()".


Thanks very much i have corrected it. But after correction, it places order and modify it just once and after it stopped working. The code is attached again for another correction

Files:
eaeking.mqh  16 kb
 
270783:


Thanks very much i have corrected it. But after correction, it places order and modify it just once and after it stopped working. The code is attached again for another correction

Your Trailing stop calculations are all assed-backwards ;)

You need this condition for the buy trades " if(NormalizeDouble(SL,Digits)<NormalizeDouble(Ask-TS*Point,Digits)". Use the opposite for sell trades. I modified it and then the EA worked correctly :)

Reason: