open two or more position in one currency

 

This can not be a problem but I have not found a solution .

 for example EA open buy position with this code : cTrade.PositionOpen(symbol,OP_BUY,Lots,LastTick.ask,LastTick.ask-(StopLoss*Pip),LastTick.ask+(TakeProfit*Pip),order_comment_1);

next EA open sell position with this code :  cTrade.PositionOpen(symbol,OP_SELL,Lots,LastTick.bid,LastTick.bid+(StopLoss*Pip),LastTick.bid-(TakeProfit*Pip),order_comment_2);

my problem is sell code open sell position but it is too close signal for last opened buy position and close buy position too.

I want open two or more position on one currency without effect on together .I use different comment for buy and sell but not worked.

what open positions method I use to solve this problem?

 
xp70:

This can not be a problem but I have not found a solution .

 for example EA open buy position with this code : cTrade.PositionOpen(symbol,OP_BUY,Lots,LastTick.ask,LastTick.ask-(StopLoss*Pip),LastTick.ask+(TakeProfit*Pip),order_comment_1);

next EA open sell position with this code :  cTrade.PositionOpen(symbol,OP_SELL,Lots,LastTick.bid,LastTick.bid+(StopLoss*Pip),LastTick.bid-(TakeProfit*Pip),order_comment_2);

my problem is sell code open sell position but it is too close signal for last opened buy position and close buy position too.

I want open two or more position on one currency without effect on together .I use different comment for buy and sell but not worked.

what open positions method I use to solve this problem?

You can't have both a buy and a sell position open on the same currency in MT5. It uses FIFO rules (first in first out)
 
Filter:
You can't open a buy and a sell at the same time in MT5

what ???

thanks I spend one day for this problem :(

 
xp70:

what ???

thanks I spend one day for this problem :(

Yup, it's a "feature" of MT5 which makes it compliant with NFA regulations.

MT4 has no such limitation so if you want to open simultaneous buy and sell, that should be your terminal of choice :)
Reason: