erdewit / ib_insync

Python sync/async framework for Interactive Brokers API
BSD 2-Clause "Simplified" License
2.8k stars 743 forks source link

Multiple issues with version 0.9.83 #586

Closed this-user closed 1 year ago

this-user commented 1 year ago

I am experiencing a number of issues after upgrading to the latest release. This starts right after connecting if orders are present:

Error handling fields: <cut for privacy>
Traceback (most recent call last):
  File "<home>/.local/lib/python3.11/site-packages/ib_insync/decoder.py", line 198, in interpret
    handler(fields)
  File "<home>/.local/lib/python3.11/site-packages/ib_insync/decoder.py", line 1151, in completedOrder
    numLegs = int(fields.pop(0))
              ^^^^^^^^^^^^^^^^^^

These are just regular LMT orders for stocks, nothing special.

When attempting to submit any orders, I always seem to receive the following error:

Error 321, reqId 9: Error validating request.-'bS' : cause - VOL order requires non-negative floating point value for volatility.  Do not set it for other order types.
Canceled order: <BASIC LMT DAY ORDER>

These are not VOL orders, but regular LMT orders for a US stock with a limit price and a 'DAY' TTL, nothing fancy.

This is happening inside a Jupyter NB. It does not happen with 0.9.82 or 0.9.81. I have also checked Python versions, and it happens with 3.10 as well as 3.11. TWS is version is 10.22.1 (May 1, 2023 4:14:22 PM).

EDIT: The culprit seems to be this commit 96a5b7f8e835659b17265e92b66885be5358bc67. If I revert that manually, the issues disappear.

jlixfeld commented 1 year ago

It's been said that 10.22/latest is pretty buggy. Try stable.

itay1542 commented 1 year ago

I am experiencing this too

erdewit commented 1 year ago

EDIT: The culprit seems to be this commit https://github.com/erdewit/ib_insync/commit/96a5b7f8e835659b17265e92b66885be5358bc67. If I revert that manually, the issues disappear.

I nearly missed this very important edit. Thank you for bisecting the issue, the offending commit has been reverted in v0.9.85.

itay1542 commented 1 year ago

I think the VOL error is unrelated to the version. I experience it even after downgrading to v0.9.82