EA Works on live & demo markets but not Tester

 
The EA works on the live & demo markets but when testing it works on some markets but not other, what might be the issue?
 
The code.
 
Carl Schreiber #:
The code.

Attached the MT4 Code below, thanks in advanced

Files:
SZD_EA.mq4  167 kb
 

You can't expect us to go through 3500 lines of code.

What about contacting the author or going through it with the debugger. SELL is called 18 times...

 
Derrick Mutange: The EA works on the live & demo markets but when testing it works on some markets but not other, what might be the issue? Attached the MT4 Code SZD EA.mq4

It does not work in the tester or optimiser because your EA depends on graphical objects for its decision logic.

The Strategy Tester does not support the use of Graphical Objects, except in the visual testing mode but only partially.

EDIT: For an EA to work properly in the Strategy Tester and optimisations, it must not depend on graphical objects in any way for its decision logic.

Operation of Programs in the Strategy Tester - MQL4 programs - MQL4 Reference

Graphical Objects in Testing

During visualization, the Expert Advisor interacts with a real chart. In case there is no visualization, the Expert Advisor works with a "virtual" chart that is not displayed. The former case has some peculiarities. During optimization, working with graphical objects is not supported.