strategy optimizer not working when I use buy and sell stop orders / pending orders instead of market orders.

 
i have a strategy that can switch between using market orders and stop orders/pending order . When i switch to pending orders and try to optimize. The optimizer starts with an arbitrary balance max and never changes until all steps are completed any assistance will be highly appreciated. Can share code if you need more info
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Order Properties - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: