MT5: Possible to limit total (all symbols) open trades for EA when autotrading?

 

Hi! I want to limit my exposure/risk and make sure that my EA has no more than say 4 open trades at a time, i.e. across all symbols.

Is this possible, and if so, is there a way to do it using built-in settings only, or does the EA's code need to somehow govern this? I'm not sure how that would work, i.e. how an EA that is applied to one chart would know about what is going on in other charts, but perhaps that info is available to it.

Or else, would this requirement drive me into needing a "multi-symbol" EA?

Thanks so much community! Kindly. 😀

 
ddchbm:

Hi! I want to limit my exposure/risk and make sure that my EA has no more than say 4 open trades at a time, i.e. across all symbols.

Is this possible, and if so, is there a way to do it using built-in settings only, or does the EA's code need to somehow govern this? I'm not sure how that would work, i.e. how an EA that is applied to one chart would know about what is going on in other charts, but perhaps that info is available to it.

Or else, would this requirement drive me into needing a "multi-symbol" EA?

Thanks so much community! Kindly. 😀

You need to code the EA to perform the check. Basically the EA can check all the trades' magic number to identify the ones it openned
vs the ones it didn't, sum them and calculate the exposure.
 
Alexandre Borela #:
You need to code the EA to perform the check. Basically the EA can check all the trades' magic number to identify the ones it openned
vs the ones it didn't, sum them and calculate the exposure.

Ah ok thank you Alexandre! I will look into this.

I found this thread which supports your statement for reference: How to get total open positions with a magic number in mql5


MQL5 forum
MQL5 forum
  • www.mql5.com
MQL5: Forum on automated trading systems and strategy testing