I recently noticed in my backtesting MarketOnCloseOrder did not execute the order at the end of the day. I don't think it did anyting. I am using Interactive Brokers, and I'm wondering if it will execute at the end of the day in live trading. Anyone have any experience with this?
Alexandre Catarino
In the attached project, a simple algorithm sends an market on close order in the first OnData event ("Order sent at 10/07/2013 09:30:01") and it is filled when th exchange is about to get closed ("Order filled at 10/07/2013 16:00:00").
Interactive Brokers' API allows market on close orders, so it is expected that your orders will be executed at the right time.
Paul McKinney
OK, that is good to know. Should it work in Backtesting too? It didn't last week when I tried it.
Alexandre Catarino
It is working in backtesting mode.
Please verify it with the project I have attached above.
Gambulator
MarketOnCloseOrder works in second resolution but I don't think it works in daily resolution. Any workaround ?
Paul McKinney
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!