Experts: GlobalVariable - page 2

 
Karputov Vladimir:

In OnDeinit() write your condition - whether or not you need to overwrite your global variables.

In general, I ask again: "What is the algorithm of action?". At the moment it's a heap-mala. Understand that unless you understand what you need, you will not be able to implement it. Draw a flowchart - it will help.

I understand what you need, I wrote above - to save values of variables in case of connection failure or server restart, etc. in case there are open orders. It's just that I'm not a professional programmer, maybe that's why it's hard to understand me... I managed to take data from OnInit() through the cycle of orders availability. I think everything works now: in OnTick() I memorise, and when loading from OnInit(), if there are open positions, the variables are assigned glob.perm values. even in OnDeinit() I did not have to write anything.