Download MetaTrader 5

Multi Pair Buy/Sell order?

To add comments, please log in or register
Sherif Hasan
7426
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.

Syed Naufal Gaddafi
1469
Syed Naufal Gaddafi  
Assign pairs to variable then open trades for each variable. Something like that.
whroeder1
17097
whroeder1  
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.
Sherif Hasan
7426
Sherif Hasan  
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.
Mehmet Bastem
689
Mehmet Bastem  
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);
rudiran
53
rudiran  
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
whroeder1
17097
whroeder1  
Icham Aidibe
10815
Icham Aidibe  
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.

To add comments, please log in or register