Always try to stay away from working with variables (temporary memory). EAs are made to open/modify/close trades and orders, and those trades and orders exist in the database of MetaTrader on the PC and on the server with all their values - SL, TP, OpenPrice, ClosePrice and so on... It's better to work only with those values and stay away from temporary local values that would be deleted forever in case of EA restart.
https://fxdreema.com/shared/0pWUbSRCc
http://i.prntscr.com/ab6314dd92954d688e ... 7e9303.png


