Hi all,I have an EA. It runs on 5 currencies (eurusd, gbpusd, usdchf, usdcad, and, audusd).When the EA has a trade or sometimes trades on a currency forexample on eurusd, it must not open trades on the other currencies.
How can I code that?Best.
Or,How can I manage total trades for above currencies. Forexample, I want to allow max. 6 trades at the same time in totally (for all currencies).
Use the same magic number for all instances of the EA and check if there is already an open trade with the magic number.
Count the number of open trades with the same magic number and don't open any more if the maximum has been reached.
However, this code for a currency. not for total currencies.
for(int i=OrdersTotal()-1; i>=0; i--)
if(selected && OrderMagicNumber()==MagicNumber) count++;
Thank you so much!