Download MetaTrader 5
To add comments, please log in or register
Learning MQL5? Start with documentation!
nicolasxu
296
nicolasxu 2015.04.08 07:36 

I open a limit sell order and limit buy order both with take profit 300 points above the one price. For example:

Order 1: limit buy at 1.08000, take profit at 1.08300, no stop loss

Order 2: limit sell at 1.08000, take profit at 1.07700, no stop loss

 

What I expect is when the price oscillating around one price point, e.g.: 1.08000, both orders will be executed with 300*2 points profit. But the actual result is both order are fulfilled and take profit not triggered.  It looks like the two orders cancelled out each other in EA test. 

The final profit is 0, and loss is also 0. What is going on? What should I expect if send the above Order 1 and Order 2 at the same time? 

Irwan Adnan
876
Irwan Adnan 2015.04.08 08:30  
nicolasxu:

I open a limit sell order and limit buy order both with take profit 300 points above the one price. For example:

Order 1: limit buy at 1.08000, take profit at 1.08300, no stop loss

Order 2: limit sell at 1.08000, take profit at 1.07700, no stop loss

 

What I expect is when the price oscillating around one price point, e.g.: 1.08000, both orders will be executed with 300*2 points profit. But the actual result is both order are fulfilled and take profit not triggered.  It looks like the two orders cancelled out each other in EA test. 

The final profit is 0, and loss is also 0. What is going on? What should I expect if send the above Order 1 and Order 2 at the same time? 

AFAIK you cant open buy limit and sell limit on same price. You can only open buy limit and sell stop or vv.
nicolasxu
296
nicolasxu 2015.04.08 08:53  
belido:
AFAIK you cant open buy limit and sell limit on same price. You can only open buy limit and sell stop or vv.

I tried on simulated account. It looks the trigger of limit price on the 2nd order will immediately cancel the previous limit order that is in the opposite direction with the same amount. 

This behavior is different from limit order for US equity trading.  

Enrico Lambino
4280
Enrico Lambino 2015.04.08 17:08  
nicolasxu:

I tried on simulated account. It looks the trigger of limit price on the 2nd order will immediately cancel the previous limit order that is in the opposite direction with the same amount. 

This behavior is different from limit order for US equity trading.  

It is possible to open both orders, but given they have the same lot size, they would just cancel each other out as soon as the second order is hit since in MT5, hedging is not allowed.
And assuming that the spread is fixed and not zero, either they execute at the same time or execute at the same price - it can never be both.

nicolasxu
296
nicolasxu 2015.04.09 09:34  
Iceron:

It is possible to open both orders, but given they have the same lot size, they would just cancel each other out as soon as the second order is hit since in MT5, hedging is not allowed.
And assuming that the spread is fixed and not zero, either they execute at the same time or execute at the same price - it can never be both.

Thanks a lot for helping me make clear of this issue!

 

- Nick 

/
To add comments, please log in or register