how to open sell if I've already open a buy in mt4

 
In my ea I set different rules to open buy and open sell. But I can never open a sell order before I close the buy order. Can anyone help me out? I will really appreciate your help. Thx.
 
kakac1:
In my ea I set different rules to open buy and open sell. But I can never open a sell order before I close the buy order. Can anyone help me out? I will really appreciate your help. Thx.

It can be you are not allowed to have open sell and buy trades same time on same Symbol by this broker.

So can you do it manually ??

 
deVries:

It can be you are not allowed to have open sell and buy trades same time on same Symbol by this broker.

So can you do it manually ??


actually I'm now testing the ea on historical data. So would it be mattered by the limitation from the broker?
 
kakac1:

actually I'm now testing the ea on historical data. So would it be mattered by the limitation from the broker?

You can perfectly test your EA on historical data. But if your EA is working in Strategy Tester and opens without giving errors,

then it still can be this EA can't open trades in current time . Read All there is about ECN

So Yes it can be mattered by the limitation from the broker.

But have you tried to manually open a sell trade on a Symbol where you have already open a buy trade ??

 
kakac1: I can never open a sell order before I close the buy order.
You can NOT hedge in the US.
 
deVries:

You can perfectly test your EA on historical data. But if your EA is working in Strategy Tester and opens without giving errors,

then it still can be this EA can't open trades in current time . Read All there is about ECN

So Yes it can be mattered by the limitation from the broker.

But have you tried to manually open a sell trade on a Symbol where you have already open a buy trade ??


ok thank you so much. I haven't try to open it manually. I will go and have a try. It's really kind of you.
 
WHRoeder:
You can NOT hedge in the US.

But I can simultaneously open a buy and a sell under the same rule. It's really weird.
 
kakac1: But I can simultaneously open a buy and a sell under the same rule. It's really weird.
Not in the US you can't, the second one will fail with ERR_TRADE_HEDGE_PROHIBITED. You can create pending orders.