I want to run an EA on multiple Symbols simultaneously. A given Symbol will never have more than 1 EA running. The EA should act independently for each Symbol, i.e. not share state between Symbols.
For each Symbol, I need to store some state to dynamically set T/P based on some past decisions of the EA. For each Symbol, this state should not be accessible to instances of the EA running on other symbols.
I've tried global variables but these seem to be shared across all Symbols if an EA is running on multiple Symbols simultaneously. How can I store a state in a variable that is only accessible by the Symbol?
Without any code we will stay on the realm of "guessing". Terminal Global Variables work pretty well.
What do you mean by ""Global Variables"?
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to run an EA on multiple Symbols simultaneously. A given Symbol will never have more than 1 EA running. The EA should act independently for each Symbol, i.e. not share state between Symbols.
For each Symbol, I need to store some state to dynamically set T/P based on some past decisions of the EA. For each Symbol, this state should not be accessible to instances of the EA running on other symbols.
I've tried global variables but these seem to be shared across all Symbols if an EA is running on multiple Symbols simultaneously. How can I store a state in a variable that is only accessible by the Symbol?