Hello Jürgen,
?
Thank you for this additional information. I have done as you suggested and changed the call for order cancellation to the following:
?
self.cancelOrder([orderId], OrderCancel)
?
Unfortunately this results in the following error, which terminates the program:
?
type object 'OrderCancel' has no attribute 'manualOrderCancelTime'
?
I have taken a look at the source code for Python for order cancellation (order_cancel.py)? and it looks like this:
?
"""
Copyright (C) 2024 Interactive Brokers LLC. All rights reserved. This code is subject to the terms
?and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable.
"""
from ibapi.const import UNSET_INTEGER
from ibapi.object_implem import Object
from ibapi.utils import intMaxString
?
class OrderCancel(Object):
? ? def __init__(self):
? ? ? ? self.manualOrderCancelTime = ""
? ? ? ? self.extOperator = ""
? ? ? ? self.externalUserId = ""
? ? ? ? self.manualOrderIndicator = UNSET_INTEGER
?
? ? def __str__(self):
? ? ? ? s = "manualOrderCancelTime: %s, extOperator: %s, externalUserId: %s, manualOrderIndicator: %s" % (
? ? ? ? ? ? self.manualOrderCancelTime,
? ? ? ? ? ? self.extOperator,
? ? ? ? ? ? self.externalUserId,
? ? ? ? ? ? intMaxString(self.manualOrderIndicator),
? ? ? ? )
?
? ? ? ? return s
?
Unfortunately I am not well versed in Python beyond the basics from what I have learned from the sample code provided in the IBKR tutorials, so I am just unsure what I am doing wrong here and why this error is occurring. It is disappointing that the API documentation has not been updated by IBKR to reflect the changes made to this function from version 10.30+ so I at a loss as to how I can move past this error.
?
I am most grateful for your assistance.
?
Regards,
Scott.
?