How to open a buy order with 15 different pairs at the same time?

 

How to open a buy order with 15 different pairs at the same time

AUD/USD AUD/CHF AUD/JPY
NZD/USD NZD/CHF NZD/JPY
USD/CAD CAD/CHF CAD/JPY
EUR/USD EUR/CHF EUR/JPY

GBP/USD GBP/CHF GBP/JPY

 

You use OrderSend() and populate the symbol value with the pair name rather than using Symbol(). Do this for each of your pairs . . .

https://docs.mql4.com/trading/OrderSend

OrderSend("AUDUSD", OP_BUY, TradeSize, Ask, 0, 0, 0, "AUDUSD", 123456, 0, CLR_NONE );

OrderSend("AUDCHF", OP_BUY, TradeSize, Ask, 0, 0, 0, "AUDCHF", 123456, 0, CLR_NONE );

OrderSend("AUDJPY", OP_BUY, TradeSize, Ask, 0, 0, 0, "AUDJPY", 123456, 0, CLR_NONE );

.

.

.
 

Wrong. Ask is the price to open the CURRENT (chart) symbol. You must change Bid/Ask, High[], Low[], etc. to the ihigh, iLow equivalents.

Then you can not use the tester.

Don't do it. Code the EA to trade the current pair only. Then you put it on all the pairs.

 
WHRoeder:

Wrong. Ask is the price to open the CURRENT (chart) symbol. You must change Bid/Ask, High[], Low[], etc. to the ihigh, iLow equivalents.

Of course . . . stupid mistake. Could use MarketInfo( symbol,MODE_ASK) instead . . . but as you said it won't work in the Strategy tester.