Multi Pair Buy/Sell order?

 

Hi,

Is this possible to open multi orders for different pairs using single EA?

eg:

I would like to sell all USD pairs so when EA runs it must open Sell/SellStop/SellLimit USDJPY,USDCHF,USDCAD,etc...

if possible please give me suggetions to start coding myself?

I never coded for multi pair orders in single EA!

Please support me.

 
Assign pairs to variable then open trades for each variable. Something like that.
 
sheriffonline: Is this possible to open multi orders for different pairs using single EA?
Yes but don't do it. You can't use any predefined variables and you have to check for ticks on the other chart. Can't assume pair(Time[0]) == chart(Time[0]) etc.
It's not necessary. Code it to trade the current part and put it on other charts. Done.
 
WHRoeder:
sheriffonline: Is this possible to open multi orders for different pairs using single EA?
Yes but don't do it. You can't use any predefined variables and you have to check for ticks on the other chart. Can't assume pair(Time[0]) == chart(Time[0]) etc.
It's not necessary. Code it to trade the current part and put it on other charts. Done.

Yes. understood. Thanks.
 
sheriffonline:

Hi,

Is this possible to open multi orders for different pairs using single EA?

eg:

I would like to sell all USD pairs so when EA runs it must open Sell/SellStop/SellLimit USDJPY,USDCHF,USDCAD,etc...

if possible please give me suggetions to start coding myself?

I never coded for multi pair orders in single EA!

Please support me.

example:

 

OrderSend("USDJPY",OP_SELL,Lot,MarketInfo("USDJPY",MODE_BID),3,0,0,"SELL ORDER",0,0,CLR_NONE);
OrderSend("USDCHF",OP_SELL,Lot,MarketInfo("USDCHF",MODE_BID),3,0,0,"SELL ORDER",0,0,CLR_NONE);
 
how can I select the last open Order price OP_BUY or OP_sell from all the orders like pendingsorders there also placed are waiting  on the trade of metatrder 4 thanks
the last price from the open order that was open and run
 
Sherif Hasan:

Hi,

Is this possible to open multi orders for different pairs using single EA?

eg:

I would like to sell all USD pairs so when EA runs it must open Sell/SellStop/SellLimit USDJPY,USDCHF,USDCAD,etc...

if possible please give me suggetions to start coding myself?

I never coded for multi pair orders in single EA!

Please support me.

Something like ... that ? 

for (int i=0;i<SymbolTotals();i++) { if (StringFind(SymbolName(i,false),"USD",0)>-1) { printf("*** pairs with usd"); } }

It browses the whole marketwatch looking for pairname in which 'USD' is found. 

It's then possible to use variants and place orders. If you do so, give worry to the price/point per symbol computed, plus it won't work on MT4's tester.

Reason: