Maximum trade triggers of an EA

 

Hi,

I attached an EA on 20 different pairs 1 Hour charts, the EA suppose to trigger trades on ALL pairs simultaneously that met the criteria.

But I noticed there were instances where 15 pairs met the criteria but only 3 pairs triggered the trades, another instance where 12 pairs met the criteria, only 2 pairs triggered the trades.

Is there any limitations on trade triggers by an EA ?

Appreciate anyone could shed some light or share your experience please.

TIA.

 
Check your return codes and find out why. What are Function return values ? How do I use them ? - MQL4 forum
 

You can check your error messages. In MetaTrader 4 there is a function IsTradeContextBusy() that the EA should use before going to place a new trade. I guess that so many trades can't be placed at the same time, I'm not 100% sure but I think that MetaTrader 4 is working synchronously with all trading operations. I never tested that, but you can check what will happen if you use 2 instances of the same EA in the same symbol. I think the first one will succeed, and the second one will reutrn error message.

 

Thanks for your reply WHRoeder, JDeel.

The EA is working fine, code wise. I'm wondering is there any MQL4 internal program code restrict that ? If someone's EA managed to open simultaneous multiple trades from different pairs accordingly, then, at least I know it is not the MQL4 code restriction.

Reason: