As object the function "Closed P/L in pips" is not working properly when I export the EA for MT5 .
The program should open a short order if the previous order was long and loser.
As you can see from pictures it is working in strategyquant but is not working in MT5.
Attached the necessary files.