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([symbol],[quantity],order_properties=self.default_order_properties)
Thanks
Mia Alissi
To fix the issues with undefined variables in the provided code snippet, ensure that
symbol
andquantity
are properly defined before using them in themarket_on_open_order
call. Here is an updated version:Make sure to replace the example values of
self.symbol
andself.quantity
with your actual trading symbol and desired quantity.Sources: Market On Open Orders - QuantConnect.com, Order Errors - QuantConnect.com, Order Ticket Demo 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.
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!