From 15de4840ed22a036f96f2dbf9897b1ba490a39f6 Mon Sep 17 00:00:00 2001 From: Agustin Alexander Date: Mon, 8 Jul 2024 10:27:53 -0300 Subject: [PATCH 01/12] Added issuerCountryCode --- ibflex/Types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ibflex/Types.py b/ibflex/Types.py index a5e0a57..4066b7b 100644 --- a/ibflex/Types.py +++ b/ibflex/Types.py @@ -1031,6 +1031,7 @@ class Trade(FlexElement): conid: Optional[str] = None cusip: Optional[str] = None isin: Optional[str] = None + issuerCountryCode: Optional[str] = None listingExchange: Optional[str] = None multiplier: Optional[decimal.Decimal] = None strike: Optional[decimal.Decimal] = None From fb32fc570b135e2bd1bacd894a7e732d39737c73 Mon Sep 17 00:00:00 2001 From: Agustin Alexander Date: Mon, 8 Jul 2024 11:14:03 -0300 Subject: [PATCH 02/12] Update Types.py --- ibflex/Types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ibflex/Types.py b/ibflex/Types.py index 4066b7b..a5ae6c9 100644 --- a/ibflex/Types.py +++ b/ibflex/Types.py @@ -1031,6 +1031,7 @@ class Trade(FlexElement): conid: Optional[str] = None cusip: Optional[str] = None isin: Optional[str] = None + rtn: Optional[str] = None issuerCountryCode: Optional[str] = None listingExchange: Optional[str] = None multiplier: Optional[decimal.Decimal] = None From 6ea12dff19ef5a647bfb5fbacb5236dc1e954136 Mon Sep 17 00:00:00 2001 From: Christophe Trefois Date: Mon, 8 Jul 2024 17:52:08 +0200 Subject: [PATCH 03/12] Update Types.py --- ibflex/Types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ibflex/Types.py b/ibflex/Types.py index a5ae6c9..816a02b 100644 --- a/ibflex/Types.py +++ b/ibflex/Types.py @@ -1032,6 +1032,7 @@ class Trade(FlexElement): cusip: Optional[str] = None isin: Optional[str] = None rtn: Optional[str] = None + initialInvestment: Optiona[str] = None issuerCountryCode: Optional[str] = None listingExchange: Optional[str] = None multiplier: Optional[decimal.Decimal] = None From ab734b35a019e3f333e6e23e0d2656d1b51b8ebc Mon Sep 17 00:00:00 2001 From: Christophe Trefois Date: Mon, 8 Jul 2024 17:53:15 +0200 Subject: [PATCH 04/12] Update Types.py --- ibflex/Types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibflex/Types.py b/ibflex/Types.py index 816a02b..ebbb782 100644 --- a/ibflex/Types.py +++ b/ibflex/Types.py @@ -1032,7 +1032,7 @@ class Trade(FlexElement): cusip: Optional[str] = None isin: Optional[str] = None rtn: Optional[str] = None - initialInvestment: Optiona[str] = None + initialInvestment: Optional[str] = None issuerCountryCode: Optional[str] = None listingExchange: Optional[str] = None multiplier: Optional[decimal.Decimal] = None From 09b0f2b1c0a91717b9d495762c3fdc770f04cd4e Mon Sep 17 00:00:00 2001 From: Christophe Trefois Date: Mon, 8 Jul 2024 18:00:54 +0200 Subject: [PATCH 05/12] Update enums.py --- ibflex/enums.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ibflex/enums.py b/ibflex/enums.py index 93a357c..e5d287c 100644 --- a/ibflex/enums.py +++ b/ibflex/enums.py @@ -51,6 +51,7 @@ class Code(str, enum.Enum): """ ASSIGNMENT = "A" AUTOEXERCISE = "AEx" # Automatic exercise for dividend-related recommendation + AUTOFX = "AFx" # FX Auto Conversion ADJUSTMENT = "Adj" # Adjustment ALLOCATION = "Al" # Allocation AWAY = "Aw" # Away Trade From 5c57f8583c6c1df83a2f7c90f1886211325f1b02 Mon Sep 17 00:00:00 2001 From: Christophe Trefois Date: Mon, 8 Jul 2024 18:02:13 +0200 Subject: [PATCH 06/12] Update Types.py --- ibflex/Types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ibflex/Types.py b/ibflex/Types.py index ebbb782..c671288 100644 --- a/ibflex/Types.py +++ b/ibflex/Types.py @@ -2199,6 +2199,7 @@ class CashTransaction(FlexElement): fineness: Optional[decimal.Decimal] = None weight: Optional[str] = None figi: Optional[str] = None + issuerCountryCode: Optional[str] = None @dataclass(frozen=True) From 0482e972d533afbec69b708efa154acb83dc51ac Mon Sep 17 00:00:00 2001 From: Christophe Trefois Date: Mon, 8 Jul 2024 18:05:41 +0200 Subject: [PATCH 07/12] Update Types.py --- ibflex/Types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibflex/Types.py b/ibflex/Types.py index c671288..bf80186 100644 --- a/ibflex/Types.py +++ b/ibflex/Types.py @@ -2200,7 +2200,7 @@ class CashTransaction(FlexElement): weight: Optional[str] = None figi: Optional[str] = None issuerCountryCode: Optional[str] = None - + availableForTradingDate: Optional[datetime.date] = None @dataclass(frozen=True) class DebitCardActivity(FlexElement): From 70e2cd1edc88574594c2446b2570fb109c99df94 Mon Sep 17 00:00:00 2001 From: Agustin Alexander Date: Mon, 2 Sep 2024 17:06:20 -0300 Subject: [PATCH 08/12] Update enums.py --- ibflex/enums.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibflex/enums.py b/ibflex/enums.py index 1f4569d..d5a4f3a 100644 --- a/ibflex/enums.py +++ b/ibflex/enums.py @@ -52,7 +52,7 @@ class Code(str, enum.Enum): """ ASSIGNMENT = "A" AUTOEXERCISE = "AEx" # Automatic exercise for dividend-related recommendation - AUTOFX = "AFx" # FX Auto Conversion + AUTOFX = "AFx" # AutoFX conversion resulting from trading ADJUSTMENT = "Adj" # Adjustment ALLOCATION = "Al" # Allocation AWAY = "Aw" # Away Trade From b0abc1c89c93282430160ae78624ad8fb6f87f0e Mon Sep 17 00:00:00 2001 From: Agustin Alexander Date: Mon, 2 Sep 2024 17:10:08 -0300 Subject: [PATCH 09/12] Update Types.py --- ibflex/Types.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/ibflex/Types.py b/ibflex/Types.py index b4940e5..fc3d5ab 100644 --- a/ibflex/Types.py +++ b/ibflex/Types.py @@ -1037,9 +1037,6 @@ class Trade(FlexElement): conid: Optional[str] = None cusip: Optional[str] = None isin: Optional[str] = None - rtn: Optional[str] = None - initialInvestment: Optional[str] = None - issuerCountryCode: Optional[str] = None listingExchange: Optional[str] = None multiplier: Optional[decimal.Decimal] = None strike: Optional[decimal.Decimal] = None From 543c37396fa691e0956ec5b289adb90fa11de960 Mon Sep 17 00:00:00 2001 From: Agustin Alexander Date: Tue, 1 Apr 2025 22:21:14 -0300 Subject: [PATCH 10/12] Update Types.py --- ibflex/Types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ibflex/Types.py b/ibflex/Types.py index 5201f00..6ab7555 100644 --- a/ibflex/Types.py +++ b/ibflex/Types.py @@ -2316,8 +2316,8 @@ class CashTransaction(FlexElement): weight: Optional[str] = None figi: Optional[str] = None issuerCountryCode: Optional[str] = None - availableForTradingDate: Optional[datetime.date] = None - exDate: Optional[datetime.date] = None + availableForTradingDate: Optional[datetime.datetime] = None + exDate: Optional[datetime.datetime] = None @dataclass(frozen=True) class DebitCardActivity(FlexElement): From 0bda0ea05c6d9f659a3b8b58f0378a9c5051322b Mon Sep 17 00:00:00 2001 From: Kai Chen Date: Sun, 13 Apr 2025 16:57:36 +0800 Subject: [PATCH 11/12] fix: add otherIncomePaxos to CashReportCurrency attrs --- ibflex/Types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ibflex/Types.py b/ibflex/Types.py index 6ab7555..648598f 100644 --- a/ibflex/Types.py +++ b/ibflex/Types.py @@ -833,6 +833,7 @@ class CashReportCurrency(FlexElement): slbNetSettledCashSec: Optional[decimal.Decimal] = None slbNetSettledCashCom: Optional[decimal.Decimal] = None slbNetSettledCashPaxos: Optional[decimal.Decimal] = None + otherIncomePaxos: Optional[decimal.Decimal] = None @dataclass(frozen=True) From 8721a142c4831a751746568a34a818612342ba3f Mon Sep 17 00:00:00 2001 From: Kai Chen Date: Sun, 13 Apr 2025 17:18:41 +0800 Subject: [PATCH 12/12] fix: ibkr dns resolve --- ibflex/client.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ibflex/client.py b/ibflex/client.py index f203e8b..b7c9fb4 100755 --- a/ibflex/client.py +++ b/ibflex/client.py @@ -19,9 +19,9 @@ ############################################################################### # SERVICE LOCATIONS ############################################################################### -FLEX_URL = 'https://gdcdyn.interactivebrokers.com/Universal/servlet/' -REQUEST_URL = FLEX_URL + 'FlexStatementService.SendRequest' -STMT_URL = FLEX_URL + 'FlexStatementService.GetStatement' +FLEX_URL = 'https://ndcdyn.interactivebrokers.com/AccountManagement/FlexWebService/' +REQUEST_URL = FLEX_URL + 'SendRequest' +STMT_URL = FLEX_URL + 'GetStatement' ############################################################################### @@ -136,8 +136,6 @@ def request_statement( """First part of the 2-step download process. """ url = url or REQUEST_URL - ### AKE FIX - url = 'https://ndcdyn.interactivebrokers.com/portal.flexweb/api/v1/flexQuery' response = submit_request(url, token, query=query_id) stmt_access = parse_stmt_response(response) if isinstance(stmt_access, StatementError):