Open icocoding opened 2 months ago
``I have also received this error on IB Gateway 10.19.
EDIT: It has started happening since the 29/10/2024 and hasn't stopped.
In my case what appears to be happening is an extra field has been added to the message received by the COMPLETED_ORDER API. My orders usually have combo legs on the contract so this extra field pushes everything up:
;;;731155060|1,732397574|-1,732829836|-1,734264089|1;4;731155060
https://github.com/stoqey/ib/blob/d521e2a448e98f45666e9c3dccf5eb6dcac705fe/src/core/io/decoder.ts#L3081
This causes the comboLegsDescription
to be blank and the next field comboLegsCount
to be the description.
https://github.com/stoqey/ib/blob/d521e2a448e98f45666e9c3dccf5eb6dcac705fe/src/core/io/decoder.ts#L3085
It decodes it as 731155060 and therefore expects to find 731155060 comboLegs. This causes the appearance of an UnderrunError
.
To get everything working again I updated line 3081:
this.contract.comboLegsDescription = this.decoder.readStr() || this.decoder.readStr();
which fixed the comboLegsDescription
and got things running again.
I would love to work out why this has started happening and what could possibly have caused it. Is there a way to check if there have been updates on IB's side?
https://github.com/stoqey/ib/blob/d521e2a448e98f45666e9c3dccf5eb6dcac705fe/src/core/io/decoder.ts#L451 In IB Gateway 10.19, an error occurred in
orderDecoder.readShareholder()
because the string has ended.In the
Decoder.readStr()
method, if the string is no longer available, it should not throw an exception; instead, it should return null or an empty string. Additionally, in theDecoder.readBool()
method, it should return a default value if the boolean is not available.