Help on EA programming

 

Hi im new to this forum, and also quite new to MQL4.

Im currently trying to modify an EA. Im attaching 4 EAs to an MT4 platform on 4 different currency pairs, and each EA trades one currency pair. However, they are opening so many simultaneous trades for the same currency pair! Can anyone tell me how to limit the maximum number of trades per currency pair?

Thanks!

 

Hello Wilson,

this can only be handled by the logic of your EA - there is no parameter to stop EAs from opening new trades.

You have to modify the logic of your program, eg. set a counter-variable which you increment with every new trade, and check the variable before opening a new trade if it has reached a limit you define by yourself - then you can not open a new trade.

Regards, Klaus

 
if you can post your code and than we can comment and help you to modif your code
Reason: