strategy optimizer not working when i use sell or buy stops

 

when i switch my ea from trading market order to using sell stops when i try to optimizer the optimizer does nothing

 
Check you EA in visual mode in the strategy tester.
 
Carl Schreiber #:
Check you EA in visual mode in the strategy tester.

on the strategy tester the buys and sell stops work but when i try to optimize using any of the strategies all optimization passes converge at zero or some other arbitrary number and then doesn't change throughout the optimization process. when i pick one of those settings the profit or losses i get from the strategy tester is totally different from the one i get with the optimizer

 
musingila #: on the strategy tester the buys and sell stops work but when i try to optimize using any of the strategies all optimization passes converge at zero or some other arbitrary number and then doesn't change throughout the optimization process. when i pick one of those settings the profit or losses i get from the strategy tester is totally different from the one i get with the optimizer

The EA code is faulty. It needs to be fixed. It is as simple as that. It has happened to me twice. Once the code was fixed, the issue was resolved.

EDIT: And no, the is no specific reason that causes it. Both times, it was a completely different reason.

EDIT2: I can however, offer this advice which might help — always initialise your global variables properly, to prevent them from having unexpected values that might carry over from previous passes.