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
{{ message }}
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
These fills are communicated as "executions" by IB through the execDetails callback.
However IB API's documentation indicates that an execution's ExecId field might indicate in some cases that it is not a new execution but a correction to a previous execution (https://interactivebrokers.github.io/tws-api/classIBApi_1_1Execution.html):
"
string ExecId
The execution's identifier. Each partial fill has a separate ExecId. A correction is indicated by an ExecId which differs from a previous ExecId in only the digits after the final period, e.g. an ExecId ending in ".02" would be a correction of a previous execution with an ExecId ending in ".01".
"
The documentation does not indicate if the correction is a replacement (ie it cancels and replaces the previous execution) or a delta (ie its quantities shall be added to the previous execution's quantities to correct them). ib_insync's code seems to assume the later. Is it a deliberate choice based on observing these cases, or is it a potential bug? I have not observed this case directly in my new logs (my old logs are not usable for such purpose) so maybe this potential bug is pedantic.
The text was updated successfully, but these errors were encountered:
A correction to a fill is not handled properly right now: It is treated as an extra fill without discarding the erroneous older fill. This should be fixed.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
ib_insync's filled quantity algorithm performs a sum of the quantity of all the trade's fills:
ib_insync/ib_insync/wrapper.py
Line 436 in 2018081
These fills are communicated as "executions" by IB through the execDetails callback.
However IB API's documentation indicates that an execution's ExecId field might indicate in some cases that it is not a new execution but a correction to a previous execution (https://interactivebrokers.github.io/tws-api/classIBApi_1_1Execution.html):
"
string ExecId
The execution's identifier. Each partial fill has a separate ExecId. A correction is indicated by an ExecId which differs from a previous ExecId in only the digits after the final period, e.g. an ExecId ending in ".02" would be a correction of a previous execution with an ExecId ending in ".01".
"
The documentation does not indicate if the correction is a replacement (ie it cancels and replaces the previous execution) or a delta (ie its quantities shall be added to the previous execution's quantities to correct them). ib_insync's code seems to assume the later. Is it a deliberate choice based on observing these cases, or is it a potential bug? I have not observed this case directly in my new logs (my old logs are not usable for such purpose) so maybe this potential bug is pedantic.
The text was updated successfully, but these errors were encountered: