If an order is filled, we don't wait for other responses.
Actual Behavior
If we are trading with tick-resolution data, we might find ourselves in this case:
1 - Place Limit Order:
2023-06-23T18:45:15.2442393Z TRACE:: LiveTradingResultHandler.OrderEvent(): Time: 06/23/2023 18:45:15 OrderID: 106 EventID: 1 Symbol: TSLA Status: Submitted Quantity: -23 LimitPrice: 256.98 Message: Interactive Brokers Order Event BrokerId: 476
2 - Update Limit Order:
2023-06-23T18:45:16.0520910Z TRACE:: InteractiveBrokersBrokerage.UpdateOrder(): Symbol: TSLA Quantity: -23 Status: Submitted Id: 106
3 - Meanwhile the Limit Order was filled:
2023-06-23T18:45:16.0653963Z TRACE:: InteractiveBrokersBrokerage.HandleOrderStatusUpdates(): OrderId: 476, Status: Filled, Filled: 23, Remaining: 0, AverageFillPrice: 256.98, PermId: 1803924168, ParentId: 0, LastFillPrice: 256.98, ClientId: 0, WhyHeld: ,MktCapPrice: 0
4 - So the Update was rejected:
2023-06-23T18:45:16.1461694Z TRACE:: InteractiveBrokersBrokerage.HandleError(): RequestId: 476 ErrorCode: 104 - Cannot modify a filled order.. Origin: [Id=476] IBPlaceOrder: TSLA (STK TSLA USD Smart NASDAQ 0 )
It led to a NoBrokerageResponse2023-06-23T18:50:16.1445549Z ERROR:: Brokerage.OnMessage(): Error - Code: NoBrokerageResponse - Timeout waiting for brokerage response for brokerage order id 476 lean id 106
Probably from the Update.
Potential Solution
If an order is filled, stop waiting on other responses.
Reproducing the Problem
N/A
Checklist
[x] I have completely filled out this template
[x] I have confirmed that this issue exists on the current master branch
[x] I have confirmed that this is not a duplicate issue by searching issues
[x] I have provided detailed steps to reproduce the issue
Expected Behavior
If an order is filled, we don't wait for other responses.
Actual Behavior
If we are trading with tick-resolution data, we might find ourselves in this case: 1 - Place Limit Order: 2023-06-23T18:45:15.2442393Z TRACE:: LiveTradingResultHandler.OrderEvent(): Time: 06/23/2023 18:45:15 OrderID: 106 EventID: 1 Symbol: TSLA Status: Submitted Quantity: -23 LimitPrice: 256.98 Message: Interactive Brokers Order Event BrokerId: 476 2 - Update Limit Order: 2023-06-23T18:45:16.0520910Z TRACE:: InteractiveBrokersBrokerage.UpdateOrder(): Symbol: TSLA Quantity: -23 Status: Submitted Id: 106 3 - Meanwhile the Limit Order was filled: 2023-06-23T18:45:16.0653963Z TRACE:: InteractiveBrokersBrokerage.HandleOrderStatusUpdates(): OrderId: 476, Status: Filled, Filled: 23, Remaining: 0, AverageFillPrice: 256.98, PermId: 1803924168, ParentId: 0, LastFillPrice: 256.98, ClientId: 0, WhyHeld: ,MktCapPrice: 0 4 - So the Update was rejected: 2023-06-23T18:45:16.1461694Z TRACE:: InteractiveBrokersBrokerage.HandleError(): RequestId: 476 ErrorCode: 104 - Cannot modify a filled order.. Origin: [Id=476] IBPlaceOrder: TSLA (STK TSLA USD Smart NASDAQ 0 )
It led to a
NoBrokerageResponse
2023-06-23T18:50:16.1445549Z ERROR:: Brokerage.OnMessage(): Error - Code: NoBrokerageResponse - Timeout waiting for brokerage response for brokerage order id 476 lean id 106Probably from the Update.
Potential Solution
If an order is filled, stop waiting on other responses.
Reproducing the Problem
N/A
Checklist
master
branch