← ClaudeAtlas

lib-ib-asynclisted

The maintained Interactive Brokers Python client - successor to the archived ib_insync - where one digit of the port number is all that separates paper from live. TRIGGER - import ib_async, from ib_async import IB, pip install ib_async, ib.connect, clientId, ports 7496 7497 4001 4002, TWS, IB Gateway, reqHistoricalData, reqMktData, reqTickersAsync, placeOrder, managedAccounts, reqPositions, reqOpenOrders, reqExecutions, Master Client ID, Read-Only API, orderRef, ibflex, ibapi, ib_insync; "Enable ActiveX and Socket Clients", pacing violations, error 1102, a DU or U account prefix. Memory is stale here: ib_insync was archived 2024-03-14 after its author died, ib_async 2.1.0 (2025-12-08) is the successor and does not wrap ibapi, its main branch has been static about nine months, and ib_fut does not exist. SKIP for non-IB brokers and for the general order-safety patterns (broker-execution-apis). SKIP for choosing between libraries, or when no library is named - the domain skill's job.
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# ib_async The one broker whose **default is safe** — and the one where a single character switches paper for live. | | | |---|---| | pip / import | `pip install ib_async` · `import ib_async` | | Version | **2.1.0 (2025-12-08)** · `requires_python >=3.10` | | Licence | **BSD-2** | | Status | ✅ The successor. 1,730★ `ib-api-reloaded/ib_async`. ⚠️ `main` static since 2025-12-06 | ## The trap that costs you money 🚨 **Connecting to 7496 (TWS live) or 4001 (Gateway live) instead of 7497 / 4002 sends real orders. One character, and there is no other confirmation.** The other four ways to send a live order by accident: - Unchecking Read-Only API and forgetting to re-check it. - Reusing a `clientId` that has resting orders from another process. - `ib.placeOrder()` with `orderType='MKT'` outside RTH on an illiquid contract. - TWS "Precautionary Settings" normally raise a popup or return an API error on size/price violations — **but a headless Gateway has nobody to click the popup**, so orders either sit blocked or, with relaxed presets, go through unchecked. **Assert on the account ID, not the port.** IB paper accounts are prefixed `DU` (or `DF`); live accounts start with `U`. The account ID is a **server-returned fact**; the port is a local config value you can typo. ## 🥇 Read-Only API is on by default Verbatim from IB's docs: **"Read-Only API" is enabled by DEFAULT in TWS "as an additional precautionary measure". When active, API orders are prevented** (and order info