Back

Market orders

When I do backtesting using market ordering the algorithm performance is great.  When you Liquidate or SetHoldings does it buy/sell at the closing price exactly? When I deploy the algorithm live using the same strategy with marekt orders the prices vary wildly and the gains are eliminated. Is there a better strategy using market orders or using Interactive Broker's back-end algorithmss (e.g smart routing etc) In other words, I know that marekt orders can be less than optimal getting you the best price but the execute immediately which is what I need. Any suggestions are welcomed :)

Update Backtest








I am also worried about the use of Liquidate or SetHoldings in live trading. This may be a combo feature request of adding more order related options to SetHoldings + additional order types for IB. This feature needs some help from us in the community.
This need sort of reminds me of the optimize api from a similar platform which works to achieve a portfolio state vs messing with execution details in the algo. In the general case of Lean this may be more difficult to tackle. But access to some IB Algo orders might help mitigate slippage while guaranteeing portfolio state in the meantime. 

0

Currently its a direct market order. We have a new way of writing algorithms coming out tomorrow which leap frogs the optimize API ;) and lets you build execution algorithms. The Algorithm Framework we mocked up below will be live tomorrow!

https://www.quantconnect.com/forum/discussion/1816
1

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.


Oh man. I can't wait!!!

0

Any update on this?

0

It was merged Friday; we haven't' written a blog post about it yet -- will follow:

https://github.com/QuantConnect/Lean/tree/master/Algorithm.Framework
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.


Cool! Can't want for the blog post either...

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