Why "0" instead of OrderTicket() ? - page 2

 
Alberto Tortella: If I turn the platform off during the weekend I will loose the value of my variables. I seem the only way to solve this is to use the GV.

That is "a quickie persistent storage," (alternative would be files.) But you aren't also using flush, so any crash means your GV isn't saved to disk.

EAs must be coded to recover. If the power fails, OS crashes, terminal or chart is accidentally closed, on the next tick, any static/global ticket variables will have been lost. You will have an open order but don't know it, so the EA will never try to close it, trail SL, etc. How are you going to recover? Use a OrderSelect loop to recover, or persistent storage (GV+flush or files) of ticket numbers required.
The question is why a GV instead of just moving the TP of the order (persistent on the broker's server?)