Back

Forex Order Execution Issues

Hi Everyone, 

I am seeing unexpeted behaviors in a Forex Order excecution. I am placing a Market Order and a Stop Order. For some reason they both get excecuted at the same time. 

Instead of posting the full algorithm I have created a little dummy project where I scheduled the questionable order to illustrate the behavior. The algorith does the following: Place EURUSD Long Market Order @ 5:00 (price is 1.16156) and Stop Order @ 1.16. For some reason borth orders get excecuted at the same time. I have tried to plot all price data and I am not seeing any reason for the Stop Order to be filled (no blips and only ±45 minutes later the price drops to 1.16). Same behaviour when setting the stop loss to 1.157. Only when setting it to 1.15 the Stop Order is not filled. 

Can anyone help me understand what I am doing wrong here ?

Thanks a lot ! 

Sebastian  

Update Backtest








Your stopMarketOrder does not fill immediately after you submit the order. You can check the order details with OnOrderEvent

public override void OnOrderEvent(OrderEvent orderEvent)
{
Debug(orderEvent.ToString());
}
2018-09-11 05:00:00 : Time: 9/11/2018 9:00:00 AM OrderID: 1 Symbol: EURUSD Status: Submitted
2018-09-11 05:00:00 : Time: 9/11/2018 9:00:00 AM OrderID: 1 Symbol: EURUSD Status: Filled Quantity: 13800 FillPrice: 1.16156 USD
2018-09-11 05:00:00 : Time: 9/11/2018 9:00:00 AM OrderID: 2 Symbol: EURUSD Status: Submitted
2018-09-11 05:00:00 : SpecificTime: Fired at : 9/11/2018 5:00:00 AM
2018-09-11 05:51:00 : Time: 9/11/2018 9:51:00 AM OrderID: 2 Symbol: EURUSD Status: Filled Quantity: -13800 FillPrice: 1.15956 USD

From the result above, the stop market order is filled at 9/11/2018 9:51:00 AM.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed