Question about partially close order - page 2

 

I’ve read the documentation about global terminal variable. So in summary, GV will rest in memory and GTV is rest in client terminal and it will stay for 4 weeks and then deleted and it can be shared to all mql4 program. But there’s something that I don’t understand about GTV:

1. on GlobalVariableFlush() function it is stated that will save all GTV into a disk, I assume we get another data file for that GTV, is that correct?

2. What is terminal restart? Is it something we do or the broker decided to restart their server?

2. Lastly, when William Roeder said we need something persistant in case of terminal restart, it can saves us because the GTV is saved into a file and the data will not remove until 4 weeks. Can’t global scope variable do that too? I mean if the terminal restarted then the Ea would restart too right?

sorry too much ask about this, because I never experience terminal restart before. And thanks in advance for helping me out this far.

 
Luandre Ezra:

I’ve read the documentation about global terminal variable. So in summary, GV will rest in memory and GTV is rest in client terminal and it will stay for 4 weeks and then deleted and it can be shared to all mql4 program. But there’s something that I don’t understand about GTV:

1. on GlobalVariableFlush() function it is stated that will save all GTV into a disk, I assume we get another data file for that GTV, is that correct?

2. What is terminal restart? Is it something we do or the broker decided to restart their server?

2. Lastly, when William Roeder said we need something persistant in case of terminal restart, it can saves us because the GTV is saved into a file and the data will not remove until 4 weeks. Can’t global scope variable do that too? I mean if the terminal restarted then the Ea would restart too right?

sorry too much ask about this, because I never experience terminal restart before. And thanks in advance for helping me out this far.

1. GTV are already stored on file! There is no other file! The flush just makes sure that whatever changes in the cached memory for the GTV is flushed to disk.

2. "terminal restart", is when you close MetaTrader and execute it again, either manually, or automatically when there are updates, on when the task crashes, etc. It has nothing to do with broker!

3. No, global scope variables are only in memory for as long as the EA/Indicator/Script is active and disappears an soon as EA/Indicator/Script stops or ends.

Reason: