An order that is larger than the account's available margin triggers the following (expected) error from IB:
Error 201, reqId 61: Order rejected - reason:YOUR ORDER IS NOT ACCEPTED. IN ORDER TO OBTAIN THE DESIRED POSITION YOUR EQUITY WITH LOAN VALUE ...
This error is handled by ib_insync in the wrapper.py lines 1014-1022.
The library emits events to notify the library caller that the order status has changed:
A broker status event (line 1021)
A trade cancelled event (line 1022)
However no trade status event is emitted, causing the client, if it listens on the trade status event, to wait indefinitely.
A trade status event shall be emitted.
PS: searching through the code, other places emitting such events are correct: on line 394 a trade status event is correctly emitted. So line 1022 seems to be the only place where a trade status event is missing
ib_insync version: 0.9.59
An order that is larger than the account's available margin triggers the following (expected) error from IB: Error 201, reqId 61: Order rejected - reason:YOUR ORDER IS NOT ACCEPTED. IN ORDER TO OBTAIN THE DESIRED POSITION YOUR EQUITY WITH LOAN VALUE ...
This error is handled by ib_insync in the wrapper.py lines 1014-1022. The library emits events to notify the library caller that the order status has changed:
A trade status event shall be emitted.
PS: searching through the code, other places emitting such events are correct: on line 394 a trade status event is correctly emitted. So line 1022 seems to be the only place where a trade status event is missing