Back

Market On Close Fill Price

Hi Guys,

 

I have a strategy that always loose money. Thats fine because in many cases only doing the inverse will make you earn money. Its like accepting the alternative hypotesis... lol.

The problem is that even changing the positions directions I still have a constant down slope in my equity curve.

So I start debuging to see what I'm doing wrong and put slippage and fee models to None to be more easy to find the error. But we still loose money. After another debug I found that the inverse orders are being executed with a huge price difference only changing the direction and this is including in the MOC orders that should be executed at the MOC official price, right?

Lets make an example:

    - 1st backtest  - Buy XLV at MOC - filled at @100.71

    - 2nd backtest - Sell XLV at MOC - filled at @100.68

There is something that I need to read about fill orders? because I cant find how market and moc orders are filled. And there some way to change ir to execute at mid bid/ask or open bar price or for moc orders at the auction close price? my orders are quite small in notional.

 

tks,

 

 

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.


Hi Felipe Palhares Hampshire ,

Right, MOC orders should be filled at the official closing price and they are being filled with the ask and bid prices.
We are aware of the issue with MOC orders introduced with new support for L1 data for Equity and will review our default fill model as soon as possible. Meanwhile, the algorithm can implement a custom fill model with the desired behavior.

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.


I have noticed the behaviour as well, it's quite confusing.. I suppose same issue apply to the opening auctions, right?

It will be great to have this fixed, because auctions are becoming quite popular in equities quant world and many people can come to wrong conclusions based on this error...

0

Issue at github for this:

https://github.com/QuantConnect/Lean/issues/4655

 

0

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