Hi,?
Hoping someone might know what's going on here. I have placed a bracket order for a short entry, long exit.? The entry order id is 100540, exit order id is 100541.? There is an error 2161 ("in accordance with our regulatory obligations... we will initally cap.... etc.") that applies to the ENTRY order, but when the error order comes back through eWrapper it is associated with the EXIT (child) order id, as per log below.??
22:12:40:694041 - ORDER 100540 openOrder callback - orderRef=43_590_ENTRY permId=1296100860 order.orderId=100540orderState: Status=PreSubmitted completedStatus= completedTime= warningText=
22:12:40:787567 - ORDER 100540 ERROR - Error 399: Order Message: SELL 778 FFIE NASDAQ.NMS Warning: your order will not be placed at the exchange until 2023-02-06 09:30:00 US/Eastern
22:12:42:820001 - ORDER 100541 ERROR - Error 2161: SELL 778 FFIE NASDAQ.NMS @ 1.01 In accordance with our regulatory obligations as a broker, we will initially cap (or limit) the price of your Limit Order to 1.30 or a more aggressive price still within your specified limit price. If your order is not immediately executable, our systems may, depending on market conditions, cap your order to a limit price that is no more than the allowed amount away from the reference price at that time. If this happens, you will not receive a fill. This is a control designed to ensure that we comply with our regulatory obligations to avoid submitting disruptive orders to the marketplace. Please note that in some circumstances this may result in you receiving a less favorable fill or not receiving a fill. In the future, please submit your order using a limit price that is closer to the current market price or submit an algorithmic Market Order (IBALGO). If you would like to cancel your order, please use cancel order action.
22:12:42:923888 - ORDER 100541 openOrder callback - orderRef=43_590_TRADE_EXPIRY permId=1296100861 order.orderId=100541orderState: Status=PreSubmitted completedStatus= completedTime= warningText=
You can see that the 2161 error is reported with orderid 100541, but it is related to the "SELL 778 FFIE" order (which is the entry order 100540).? ?There is a separate error (399) related to the entry order which is correctly related to the entry order id 100540.
Does anyone have any ideas what's going on here?
For reference here is my log code:
def error(self, reqId, errorCode, errorString):
if reqId >= 100000:
# Order error
self.logger.log(f'ORDER {reqId} ERROR - Error {errorCode}: {errorString}')