You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defpush_ordererror(self, msg):
withself._lock_orders:
try:
order=self.orderbyid[msg.id]
except (KeyError, AttributeError):
return# no order or no id in errorifmsg.errorCode==202:
ifnotorder.alive():
returnorder.cancel()
elifmsg.errorCode==201: # rejectediforder.status==order.Rejected:
returnorder.reject()
else:
---->order.reject() # default for all other cases
called from ibstore.py registered error notify method:
@ibregisterdeferror(self, msg):
# 300-399 A mix of things: orders, connectivity, tickers, misc errors
... # < code removed for clarity >ifmsg.errorCodeisNone:
... # < code removed for clarity >elifmsg.errorCode<500:
# Given the myriad of errorCodes, start by assuming is an order# error and if not, the checks there will let it goifmsg.id<self.REQIDBASE:
ifself.brokerisnotNone:
---->self.broker.push_ordererror(msg)
else:
# Cancel the queue if a "data" reqId error is given: sanityq=self.qs[msg.id]
self.cancelQueue(q, True)
The order is marked rejected for every "unknown" ( to be more exact - unhandled) error/warning.
Discussion:
It seem the currently implemented behavior makes a conservative/defensive decision about marking the order as rejected when broker notifies an error which is currently unsupported. It is hard to know whether or not the unknown error code constitutes a real error or just a warning.
It is possible of cause to try to search for the 'warning' or 'error' keywords in the test message itself - but this is error prone at best.
The text was updated successfully, but these errors were encountered:
Community discussion:
https://community.backtrader.com/topic/2862/ibbroker-live-trading-idealpro-minimum-value-error-code-399-odd-lot-orders-reported-as-rejected
Unexpected behavior:
Looking at ibbroker.py:
called from ibstore.py registered error notify method:
The order is marked rejected for every "unknown" ( to be more exact - unhandled) error/warning.
Discussion:
It seem the currently implemented behavior makes a conservative/defensive decision about marking the order as rejected when broker notifies an error which is currently unsupported. It is hard to know whether or not the unknown error code constitutes a real error or just a warning.
It is possible of cause to try to search for the 'warning' or 'error' keywords in the test message itself - but this is error prone at best.
The text was updated successfully, but these errors were encountered: