說明文件
如何安裝、操作及理解 Canary,並連接你自己的 Interactive Brokers 帳戶。初次接觸 Canary 請由頂部開始;後面的章節逐步貼近程式碼。尚未翻譯的頁面以英文顯示,並標示 EN。
開始使用
安裝 Canary,連接閘道與 MCP 主機,並確認交易台已上線。
- 安裝與首次運行先決條件、各種安裝方式,以及證明閘道可達的第一批指令。
- Set up broker reportingENCreate the shared IBKR Activity Flex Query, store its token safely, and prove statement-backed features are current.
- Connect an MCP hostENWiring Claude Desktop, Claude Code, Cursor, and Zed to the local server, and checking the connection.
- 接入你慣用的 AI把盈透證券帳戶接入 Claude、Cursor 或其他 MCP 主機,在對話中直接查詢持倉和風險。
- AI 代理交易AI 代理在盈透證券帳戶上可以做甚麼、不可以做甚麼,以及一張訂單要過哪些關才會發出。
- 首次使用有指引的半小時:讀取帳戶、執行簡報、查看規則手冊,並解讀回傳的內容。
- 香港及新加坡帳戶相同的閘道步驟、以港元、新加坡元或日圓計的基礎貨幣、亞洲交易所日曆,以及何時執行簡報。
- UpdatingENUpdate the binary, the Desktop extension, S&P 500 membership, calendars, and local process state.
- 故障排除閘道無法連接、報價過時、守護程序無法啟動,以及解答每個問題的日誌。
日常操作
每日流程:簡報、代理工作階段、配對應用程式、訂單預覽、保護與對帳。
- The daily deskENA working routine from the morning brief through discipline and protection to the after-close read.
- Working with agentsENWorkflows, limits, and worked examples for driving Canary from an MCP host.
- The paired appENRunning canary app, pairing a phone, the event stream, and opt-in push notifications.
- Alerts and notificationsENWhat raises an alert, where it is delivered, how delivery is proven, and how to tune the noise down.
- Constrained orders and the trading buildENThe read-only default, the constrained order lifecycle that remains, and the separate opt-in trading build.
- Protection and risk reductionENTrailing-stop and risk-reduction proposals, per-row blockers, and how a proposal becomes an order.
- Cash managementENThe cash sweep and currency leveling: their own policy section, their own authority, and how each order is bounded.
- ReconciliationENMatching broker statement flows against the declared capital ledger, and handling the lines that will not match.
理解數據
各項數字量度甚麼、何時可信,以及由誰設定衡量所用的上限。
- ConceptsENCalendars, regime, stress, market events, protective stops, gamma, and breadth in one mental model.
- Canary EdgeENBroker-truth account P/L, fixed-horizon decision price impact, option actuals, and the coverage that bounds every result.
- SensorsENHow each measurement establishes authority and freshness, and how a gap fails closed instead of guessing.
- Trading policyENWho decides the risk boundaries, what the daemon evaluates, and what never becomes submit authority.
- The rulebookENThe advisory rules, what each one is protecting against, and how a breach is reported.
- Writing a risk policyENTurning a personal risk mandate into the policy file: limits, drawdown ladder, overrides, and review.
- Market data and entitlementsENWhich subscriptions produce real-time data, what delayed and frozen mean, and how freshness is reported.
- GlossaryENOne place for the terms the other pages assume: NLV, R-multiple, zero gamma, last-good, fingerprint.
參考資料
指令、工具與設定的查閱資料,大部分由所記錄的程式碼產生。
- CLIENEvery Canary subcommand with its flags and usage, generated from the command registry in the binary.
- MCP toolsENEvery tool exposed by canary mcp, with parameters and invocation guidance. Generated from the registry.
- ConfigurationENTOML configuration, policy files, runtime platform settings, and environment variables.
- Reporting Flex queryENThe exact shared Flex sections and fields Canary validates, generated from the parser manifest.
- Releases and supportENVersion scheme, what a release contains, how signatures are verified, and which versions are supported.
內部設計
給想了解設計的讀者:程序、型別化契約、儲存、線路協定與打包。
- ArchitectureENRuntime processes, typed contracts, external data flows, state ownership, and deployment boundaries.
- StorageENWhy the daemon uses SQLite, how the data model follows from its job, and how state survives a restart.
- TWS wire protocolENCoverage and semantic fingerprints for the clean-room Go implementation of the TWS protocol.
- Regime dashboard contractENSource quality, cluster logic, lifecycle decisions, and the evidence required before policy changes ship.
- Gamma cache persistenceENDesign and invalidation semantics for the daemon's persistent dealer zero-gamma cache.
- Packaging and distributionENWhat each published artifact contains, how it is signed, and the boundary every channel ships with.