EXTERN VARIABLE under MT4 - NEED HELP

 

Many times I lose connection with my broker. I dont know when extern variables are loaded into PC MEMORY.

What are differences between EXTERN VARIABLE and VARIABLE initalized under init() function ?

I would like to know when the SETTINGs of EXTERN VARIABLEs are SETS and RESETS ?

When I restart the platform the SETTINGS of extern variables will be RESETS, but I dont know if after the lost connection with broker and reconnection the SETTINGS of extern variables will also be RESET.


Need help

 

I think I know where you are getting at.

Let me guess that you want to keep track of your trading states and thus record them to extern variables.

Good luck; I found it too difficult.

Recording states and then restoring your states are not effective in my view.

Why? Because the time gap between recorded and restoration can varied and you may have lost lots of money...

That is why I prefer semi-auto trading; I believe constant human intervention is required and a must to make sure nothing goes wrong like time gaps....

Imagine wanting to close all postions but no, only partial positions are closed. You lost connections and are stuck with open positions in the negatives....

Without that human element, you can lose alot of $$$$$$$$$$$$$.

Please take note that a human can always call the broker to fix problems when lost connection, server down, electricity down, etc.... (EA can't do that.)

 

ENV VARIABLES are global variables that are stored in a file...

EXTERN CONFIGURABLE VARIABLES are variables that can be changed dynamically by user using EA properties tab and can be load/save in configuration file.

REGULAR global variables and local variables are stored in memory; these variables are not in the EA properties configuration tab...

 

ExTERN CONFIGURABLE VARIABLES once set from EA properties tab, I believe it will stay that way until variables are change by user or by recompiling ea.

Reason: