diff --git a/icli/cli.py b/icli/cli.py index 067958a..6b77686 100644 --- a/icli/cli.py +++ b/icli/cli.py @@ -50,10 +50,10 @@ locale.setlocale(locale.LC_ALL, "") -import ib_insync +import ib_async import seaborn -from ib_insync import ( +from ib_async import ( Bag, ComboLeg, Contract, @@ -2927,7 +2927,7 @@ async def prepare(self): if False: import logging - ib_insync.util.logToConsole(logging.INFO) + ib_async.util.logToConsole(logging.INFO) # Attach IB events *outside* of the reconnect loop because we don't want to # add duplicate event handlers on every reconnect! diff --git a/icli/helpers.py b/icli/helpers.py index 17cbd42..4c1b30d 100644 --- a/icli/helpers.py +++ b/icli/helpers.py @@ -7,23 +7,28 @@ import math from dataclasses import dataclass, field -import ib_insync # just for UNSET_DOUBLE +import ib_async # just for UNSET_DOUBLE import numpy as np import pandas as pd import pendulum import questionary import tradeapis.cal as tcal import tradeapis.rounder as rounder -from ib_insync import ( +from ib_async import ( Bag, Bond, CFD, + ComboLeg, + Commodity, + ContFuture, Contract, Crypto, + DeltaNeutralContract, Forex, Future, FuturesOption, Index, + MutualFund, Option, Stock, Warrant, @@ -463,7 +468,7 @@ def isset(x: float) -> bool: So we have to directly compare against another value to see if a returned float is a _set_ value or just a placeholder for the default value. le sigh.""" - return x != ib_insync.util.UNSET_DOUBLE + return x != ib_async.util.UNSET_DOUBLE @dataclass diff --git a/icli/lang.py b/icli/lang.py index f42d129..aa6038c 100644 --- a/icli/lang.py +++ b/icli/lang.py @@ -20,7 +20,7 @@ import pandas as pd -from ib_insync import Bag, Contract, Order +from ib_async import Bag, Contract, Order from loguru import logger from mutil.dispatch import DArg from mutil.frame import printFrame diff --git a/icli/orders.py b/icli/orders.py index 6e8e5f2..b3e5f6b 100644 --- a/icli/orders.py +++ b/icli/orders.py @@ -1,7 +1,7 @@ """ Common order types with reusable parameter configurations.""" from dataclasses import dataclass, field -from ib_insync import ( +from ib_async import ( Contract, Order, OrderCondition, diff --git a/pyproject.toml b/pyproject.toml index c3db306..1c79fdb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,8 @@ license = "Apache-2.0" python = ">=3.10,<3.13" # IB API wrapper with better usability than the IBKR-provided libs -ib-insync = "^0.9.66" +ib_async = ">=1.0.2" +# ib_async = { path = "../../ibkr/ib_insync", develop = true } # nice printing and data manipulation pandas = ">2.1.0"