I'm just started to run my algorithm on live, using paper IBKR account. In the algorithm I'm using MarketOnOpenOrder - because I'm making trading decisions once a day after market hours and when I decide to buy or sell stocks - I want to do that on the next trading day (on open). However, I see that all of my orders fail with the same error: “Invalid 201 - Order rejected - reason:Exchange is closed”.
According to documentation, IBKR does support MOO orders, so I not understand the reason for the error.
P.S. Of cause, I could theoretically implement this logic on my own (e.g. to subscribe to event and to send order during market hours) - but I don't want to. I really prefer to broker to deal with this, especially if it supports this functionality.
Any ideas?
Mia Alissi
It seems you are facing issues with Market On Open (MOO) orders when using Interactive Brokers (IBKR) in your live trading setup. Let's address potential causes and solutions:
Order Timing: Ensure your MOO orders are submitted at least two minutes before the market opens. Orders placed too close to the market open may not be included in the opening auction.
Market Hours: Verify that you are submitting orders during valid trading hours. Check if there are any holidays or early market closings.
Time Zone Alignment: Make sure your algorithm's time zone settings align with the exchange's time zone to prevent misalignment in trading hours.
IBKR Specifics: Although IBKR supports MOO orders, sometimes there are specific configurations or restrictions. It's important to verify if there are additional IBKR-specific requirements or restrictions related to these orders.
Brokerage Model: Ensure that your algorithm is not using a brokerage model that does not support MOO orders (e.g., Tradier).
Implement detailed logging in your algorithm to track when the orders are placed and any error messages returned. This could provide additional insights into why the orders are rejected.
If these steps don't resolve the issue, reaching out to QuantConnect support for additional assistance might help, as sometimes there might be platform-specific nuances affecting your algorithms.
Sources: Market On Open Orders - QuantConnect.com, Brokerages - QuantConnect.com, Market On Close Orders - QuantConnect.com, Market On Close Order Buffer Regression Algorithm, Market On Open On Close Algorithm
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.
Evgeni Aizikovich
Hi Mia,
Your response “Verify that you are submitting orders during valid trading hours.”
Of cause I NOT submitting during valid trading hours. That's the whole point of MOO orders - right? To submit them OUT of valid trading hours - so they fill be filled on market open. Or I misunderstand the concept?
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!