Hi,
I am trying to do a market on open order for IBKR and I keep on consistently running into this issue:
Brokerage Info: Order Canceled - reason:On-Open order cannot have post-only attribute..
I can't seem to find any documentation on QC or IBKR about this. I've also tried the following code, but this doesn't work either - does anyone have any recommendations?
Init:
self.default_order_properties = OrderProperties()
self.default_order_properties.post_only = False
Order:
self.market_on_open_order(self.symbol,self.quantity,order_properties=self.default_order_properties)
Mia Alissi
The error you encountered, "On-Open order cannot have a post-only attribute," stems from the misuse of the post-only attribute. In QuantConnect, the
post_only
attribute is designed specifically for Limit orders executed on certain exchanges, ensuring no part of the order takes liquidity (thus potentially rejecting any liquidity-taking portion). This attribute does not apply to Market On Open (MOO) orders.Here are the steps to resolve the issue:
Remove the post-only Setting: Since the
post_only
attribute is only meant for Limit orders and your usage involves a Market On Open order, you should remove any setting related topost_only
. Your order properties should omit any configuration forpost_only
. Here's how you can update your code:Review Your Order Requirements: Ensure that your usage of Market On Open orders adheres to both QuantConnect's and IBKR's requirements. Market On Open orders need to be submitted to participate in the official opening auction. They typically don't require any additional properties like
post_only
.Debug and Verify: If the problem persists, you should use logging or debugging tools to verify the parameters being sent with your order to ensure they are as expected.
Documentation Review: Consider reviewing IBKR's specific details on Market On Open orders to verify compliance without unnecessary attributes.
Make these adjustments, and your MOO orders should work without encountering the "post-only" attribute error.
Sources: Market On Open Orders - QuantConnect.com, Order Errors - QuantConnect.com
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!