3 expert advisors on the same platform

 

Is it possible to have 3 ea on the same platform (mt4)?

I use 3 ea for my trading, one for each graph, but when one ea open a position, the second upon conditions do not open the position, until the first ea have closed its position.

The magicnumbers are different.

Why?

Thanks for the replies

 

Yes, possible.

If magic numbers are different so - may be - those EAs are programmed to have 1 trade per chart, or per symbol?

Check this thread:

https://www.mql5.com/en/forum/173026

and for other possible decision - this thread:

https://www.mql5.com/en/forum/174329

 
newdigital:
Yes, possible.

If magic numbers are different so - may be - those EAs are programmed to have 1 trade per chart, or per symbol?

Check this thread:

https://www.mql5.com/en/forum/173026

and for other possible decision - this thread:

https://www.mql5.com/en/forum/174329

My 3 expert advisors are programmed to have one trade per symbol, and this is good, but can i add a function to have also 1 trade per chart?

This because all 3 ea trade with EURUSD.

Thank you.

 

If you used OrdersTotal( ) function to count the opened trades per EA per, don't forget to use Magic Number.

i.e, when counting the open trades per EA, you need to put in consideration to count those having the same Symbol name and Magic number. If the count is zero, the EA can open a new trade, else, can't.

Or, if you want to use it in the logical way, like what I did, you may use this,

bool ExistPositions() {

for(int i=0; i<OrdersTotal(); i++) {

if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {

if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) {

return(True);

}

}

}

return(false);

}

I use the above code in all of my codes years ago, it works perfect.

 
oshaban:
If you used OrdersTotal( ) function to count the opened trades per EA per, don't forget to use Magic Number.

i.e, when counting the open trades per EA, you need to put in consideration to count those having the same Symbol name and Magic number. If the count is zero, the EA can open a new trade, else, can't.

Or, if you want to use it in the logical way, like what I did, you may use this,

bool ExistPositions() {

for(int i=0; i<OrdersTotal(); i++) {

if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {

if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) {

return(True);

}

}

}

return(false);

}

I use the above code in all of my codes years ago, it works perfect.

This is one of my ea.

Where can i copy your code?

Thank you

Reason: