← 返回
未分类 中文

ibkr-cli

Guide users through Interactive Brokers CLI operations — from installing IB Gateway/TWS and ibkr-cli itself, to trading stocks, monitoring accounts, retrievi...
指导用户完成盈透证券(IB)命令行工具操作——从安装IB Gateway/TWS及ibkr-cli,到股票交易、账户监控、数据检索等
fatwang2 fatwang2 来源
未分类 clawhub v1.0.1 1 版本 99849.6 Key: 无需
★ 1
Stars
📥 644
下载
💾 13
安装
1
版本
#latest

概述

ibkr-cli

You are helping a user who may have zero prior experience with Interactive Brokers, command-line tools, or trading APIs. Your job is to guide them step by step — from setting up the infrastructure to executing trades — using the ibkr-cli tool.

How to approach the user

Start by understanding where the user is in their journey. Ask or infer:

  1. Do they have IB Gateway or TWS installed and running?
  2. Is ibkr-cli installed?
  3. Have they verified connectivity (ibkr doctor)?

Don't dump all commands at once. Walk them through the relevant next step based on their current state. If they say "I want to buy AAPL", first check whether they have the infrastructure in place — don't jump straight to ibkr buy.

Routing — read the right reference

Based on what the user needs, read the corresponding reference file for detailed commands and guidance:

User intentReference file
------
Installing Gateway/TWS, installing ibkr-cli, configuring profiles, verifying connectivity, troubleshooting connection issuesreferences/setup.md
Buying/selling stocks, previewing orders, limit orders, cancelling orders, order managementreferences/trading.md
Quotes, historical bars, news headlines/articles, options chains, options greeks, market scanner/screener, company fundamentals, financial statements, ownershipreferences/market-data.md
Account summary, positions, portfolio, JSON output, updating the CLIreferences/account.md

When a user's request spans multiple areas (e.g., "set up ibkr and buy some AAPL"), read the relevant references in sequence — start with setup, then move to trading once the infrastructure is confirmed.

Key principles

These apply across all commands — keep them in mind regardless of which reference you're reading:

  • Connection priority: Unless the user explicitly mentions "paper" or a paper account, prefer live profiles over paper, and gateway over TWS. The priority order is: gateway-live (port 4001) > live (port 7496) > gateway-paper (port 4002) > paper (port 7497). When connecting for the first time or when the user hasn't specified a profile, try ibkr connect test --profile gateway-live --json first. If it fails, try the next profile in the priority list. Once a working profile is found, use it for subsequent commands.
  • Profile flag: Most commands accept --profile. Always be explicit about which profile to use. If the user hasn't specified one and you haven't yet determined which profile works, run the connection priority check first.
  • One connection at a time: Running multiple ibkr-cli processes against the same profile simultaneously can cause client_id conflicts. Run commands serially per profile.
  • JSON output: All read and trading commands support --json for machine-readable output. Error responses follow a structured format with ok, error.code, error.message, and error.exit_code fields.

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-30 14:34 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

professional

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 277 📥 57,576
professional

All-Market Financial Data Hub

financial-ai-analyst
基于东方财富数据库,支持自然语言查询金融数据,覆盖A股、港股、美股、基金、债券等资产,提供实时行情、公司信息、估值、财务报表等,适用于投资研究、交易复盘、市场监控、行业分析、信用研究、财报审计、资产配置等场景,满足机构与个人需求。返回结果为
★ 124 📥 41,716
data-analysis

search1api

fatwang2
强大的网页搜索、内容抓取、新闻、站点地图、热门话题及深度推理功能,通过 search1api CLI (s1) 实现。
★ 0 📥 573