# Thread: Opening 2 orders at the same time

1. ## Opening 2 orders at the same time

Hi! Maybe it is a newbie question, but appreciate if you can let me know how I can let the EA to open 2 shorts positions at the same time in 2 different pairs. Ex.: EUR and GBPUSD. Thanks in advance for any help!

2. Originally Posted by szmvscla
Hi! Maybe it is a newbie question, but appreciate if you can let me know how I can let the EA to open 2 shorts positions at the same time in 2 different pairs. Ex.: EUR and GBPUSD. Thanks in advance for any help!
Try putting the EA into 2 separate charts with different magic numbers..

3. Originally Posted by andytankm
Try putting the EA into 2 separate charts with different magic numbers..
Thanks for your reply, but I want to do it only using a chart and with the same magic number because the EA will close the orders at a SL or TP equity level.

Ex.: The EA is running on EURUSD and after the trading signal became true it will open an EURUSD and a GBPUSD short positions at the same time, is it possible?

4. Originally Posted by szmvscla
Thanks for your reply, but I want to do it only using a chart and with the same magic number because the EA will close the orders at a SL or TP equity level.

Ex.: The EA is running on EURUSD and after the trading signal became true it will open an EURUSD and a GBPUSD short positions at the same time, is it possible?
Oh.. You will need someone to rewrite the EA so that it's able to do that Yes, it's possible.

5. Originally Posted by andytankm
Oh.. You will need someone to rewrite the EA so that it's able to do that Yes, it's possible.
I wrote the following code:

if(SELL)
{
if(HideSL==false&&StopLoss>0){SL=Bid+StopLoss*poin t;}else{SL=0;}
if(HideTP==false&&TakeProfit>0){TP=Bid-TakeProfit*point;}else{TP=0;}
Ticket=OrderSend(symbolEU,OP_SELL,Lots,Bid,Slippag e,SL,TP,EAName,Magic,0,Red); PlaySound("news.wav");
Ticket=OrderSend(symbolGU,OP_SELL,Lots,Bid,Slippag e,SL,TP,EAName,Magic,0,Red); PlaySound("news.wav");
}

But it is not working Funyoo, if possible, please help me, thanks in advance.

6. Originally Posted by szmvscla
I wrote the following code:

if(SELL)
{
if(HideSL==false&&StopLoss>0){SL=Bid+StopLoss*poin t;}else{SL=0;}
if(HideTP==false&&TakeProfit>0){TP=Bid-TakeProfit*point;}else{TP=0;}
Ticket=OrderSend(symbolEU,OP_SELL,Lots,Bid,Slippag e,SL,TP,EAName,Magic,0,Red); PlaySound("news.wav");
Ticket=OrderSend(symbolGU,OP_SELL,Lots,Bid,Slippag e,SL,TP,EAName,Magic,0,Red); PlaySound("news.wav");
}

But it is not working Funyoo, if possible, please help me, thanks in advance.
Hi szmvscla,

You have to define the bid and ask of the second pair :

Code:
`extern string symbol2="GBPUSD";`
Code:
```ask2=MarketInfo(symbol2,MODE_ASK);
bid2=MarketInfo(symbol2,MODE_BID);

if(SELL){
if(HideSL==false && StopLoss>0){SL=Bid+StopLoss*point;}else{SL=0;}
if(HideTP==false && TakeProfit>0){TP=Bid-TakeProfit*point;}else{TP=0;}
Ticket=OrderSend(NULL,OP_SELL,Lots,Bid,Slippage,SL,TP,EAName,Magic,0,Red); PlaySound("news.wav");

if(HideSL==false && StopLoss>0){SL=bid2+StopLoss*point;}else{SL=0;}
if(HideTP==false && TakeProfit>0){TP=bid2-TakeProfit*point;}else{TP=0;}
Ticket=OrderSend(symbol2,OP_SELL,Lots,bid2,Slippage,SL,TP,EAName,Magic,0,Red); PlaySound("news.wav");
}```

#### Tags for this Thread

eur, eurusd, gbpusd, magic, magic number, news, pairs, signal, slippage, stoploss, time, trading

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•