¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

The 'All or None' order attribute may not be specified for this order.


 

I am setting up Buy Order. For now, i would prefer not to deal with partially filled orders as it creates many issues. I considered cancelling partially filled order in OrderStatus, but it seems as clumsy solution, which can result in situations where next fill happens sooner than OrderStatus gets executed and cancels the order and thus it would break anyway.

I was looking for an order setting, which would either automaticly cancel the order after partial fill or allow only for filling the whole order. I found order setting allOrNone

This is code i am using for buy order

? ? buy_order = Order()
? ? buy_order.orderId = nextOrderId
? ? buy_order.action = "BUY"
? ? buy_order.orderType = buy_type
? ? buy_order.lmtPrice = buy_price
? ? buy_order.totalQuantity = units
? ? buy_order.tif = "GTD"
? ? buy_order.goodTillDate = wait_date
? ? buy_order.eTradeOnly = False
? ? buy_order.firmQuoteOnly = False
? ? buy_order.allOrNone = True


I am getting this error message:?
The 'All or None' order attribute may not be specified for this order.
?
In the TWS docs, it says that i can be applied to all order types
?

Join [email protected] to automatically receive all group messages.