longbridge-kline
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineselongbridge-kline
longbridge-kline
Historical candlesticks and today's intraday curve for Longbridge-supported securities (HK / US / A-share / Singapore). Does not support options, warrants, or indices — defer to (derivatives) or (indices).
longbridge-derivativeslongbridge-quoteResponse language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
通过长桥证券支持的证券(港股/美股/A股/新加坡股)获取历史K线数据及当日分时走势。不支持期权、权证或指数相关数据——如需查询衍生品数据请使用,查询指数数据请使用。
longbridge-derivativeslongbridge-quote响应语言:匹配用户输入语言——简体中文/繁体中文/英文。
Subcommands
子命令
Runto confirm current period values, defaults, and aliases.longbridge kline --help
| CLI command | Use when |
|---|---|
| Latest N candles. Periods: |
| OHLCV across an explicit date range (sub-subcommand). |
| Today's per-minute curve (price + volume + avg_price). |
Period aliases: , , , , , . (default) or for 前复权 / 前復權.
minute=1mhour=1hd/1d=dayw=weekm/1mo=monthy=year--adjust none--adjust forward运行可确认当前支持的周期值、默认设置及别名。longbridge kline --help
| CLI命令 | 使用场景 |
|---|---|
| 获取最近N根K线。支持周期: |
| 查询指定日期范围内的OHLCV数据(子子命令)。 |
| 获取当日分钟级走势数据(价格+成交量+平均价格)。 |
周期别名:、、、、、。默认使用(不复权),添加可启用前复权/前復權。
minute=1mhour=1hd/1d=dayw=weekm/1mo=monthy=year--adjust none--adjust forwardWhen to use
使用场景示例
- "NVDA 最近一周走势", "近一年走勢", "AAPL 1-month chart" →
kline --period day - "TSLA 5 分钟 K", "近 100 根 5 分钟" →
kline --period 5m --count 100 - "今天 700.HK 分时图", "AAPL today's intraday" →
intraday - "AAPL 2024 年 1-12 月日 K" (explicit dates) →
kline history --start --end - "前复权日 K" → add
--adjust forward
- "NVDA 最近一周走势"、"近一年走勢"、"AAPL 1-month chart" → 使用
kline --period day - "TSLA 5 分钟 K"、"近 100 根 5 分钟" → 使用
kline --period 5m --count 100 - "今天 700.HK 分时图"、"AAPL today's intraday" → 使用
intraday - "AAPL 2024 年 1-12 月日 K"(指定日期范围)→ 使用
kline history --start --end - "前复权日 K" → 添加参数
--adjust forward
Workflow
工作流程
- Resolve the symbol to (see
<CODE>.<MARKET>for the rules).longbridge-quote - Pick the form:
- Explicit start/end dates → .
kline history - "Today" / "intraday" → .
intraday - Otherwise → with sensible defaults (
kline).--period day --count 100
- Explicit start/end dates →
- Map natural-language windows to (,
period). Examples: "最近一周" →count, "最近一年" →day,7, "月 K" →day,252.month,100 - Call the Longbridge CLI directly (preferred) or fall back to MCP.
- Translate datasets into prose (range high / low, net move, volume note); use ▲ / ▼ for direction. Cite Longbridge Securities / 数据来源:长桥证券 / 數據來源:長橋證券.
- 将证券代码解析为格式(解析规则可参考
<CODE>.<MARKET>)。longbridge-quote - 选择合适的命令形式:
- 指定起始/结束日期 → 使用。
kline history - 查询"今日"/"日内"数据 → 使用。
intraday - 其他场景 → 使用并采用合理默认值(
kline)。--period day --count 100
- 指定起始/结束日期 → 使用
- 将自然语言描述的时间范围映射为(,
period)参数。例如:"最近一周"→count,"最近一年"→day,7,"月K"→day,252。month,100 - 直接调用Longbridge CLI(优先方式),或 fallback 至MCP。
- 将数据集转换为可读性文本(包括区间最高价/最低价、涨跌幅度、成交量说明);使用▲/▼标识涨跌方向。需标注数据来源:Longbridge Securities / 数据来源:长桥证券 / 數據來源:長橋證券。
CLI
CLI示例
bash
longbridge kline NVDA.US --period day --count 100 --format json
longbridge kline 700.HK --period 5m --count 100 --adjust forward --format json
longbridge kline history NVDA.US --start 2025-01-01 --end 2025-12-31 --format json
longbridge intraday 700.HK --format jsonbash
longbridge kline NVDA.US --period day --count 100 --format json
longbridge kline 700.HK --period 5m --count 100 --adjust forward --format json
longbridge kline history NVDA.US --start 2025-01-01 --end 2025-12-31 --format json
longbridge intraday 700.HK --format jsonOutput
输出格式
longbridge kline ... --format jsonjson
[
{"time": "...", "open": "...", "high": "...", "low": "...", "close": "...", "volume": "...", "turnover": "..."}
]intraday{time, price, volume, turnover, avg_price}longbridge kline ... --format jsonjson
[
{"time": "...", "open": "...", "high": "...", "low": "...", "close": "...", "volume": "...", "turnover": "..."}
]intraday{time, price, volume, turnover, avg_price}Error handling
错误处理
If is not installed, the shell returns a error → fall back to MCP (see below) or tell the user to install longbridge-terminal. If prints to stderr, surface the message to the user — common causes:
longbridgecommand not foundlongbridgeError: ...- /
Error: not logged in→ user runsunauthorized.longbridge auth login - /
Error: invalid symbol→ re-check theparam_errorformat.<CODE>.<MARKET>
若未安装,终端会返回错误 → 可fallback至MCP(见下文),或提示用户安装longbridge-terminal。若向stderr输出,需将错误信息展示给用户——常见错误原因:
longbridgecommand not foundlongbridgeError: ...- /
Error: not logged in→ 提示用户执行unauthorized登录。longbridge auth login - /
Error: invalid symbol→ 重新检查param_error格式是否正确。<CODE>.<MARKET>
MCP fallback
MCP fallback方案
| CLI subcommand | MCP tool |
|---|---|
| |
| |
| |
| CLI子命令 | MCP工具 |
|---|---|
| |
| |
| |
Related skills
相关技能
- Quote / static / valuation indices →
longbridge-quote - Orderbook / brokers / ticks →
longbridge-depth - Capital flow →
longbridge-capital-flow
- 行情/静态/估值指数数据 →
longbridge-quote - 订单簿/经纪商/逐笔数据 →
longbridge-depth - 资金流向数据 →
longbridge-capital-flow
File layout
文件结构
longbridge-kline/
└── SKILL.md # prompt-only, no scripts/longbridge-kline/
└── SKILL.md # 仅包含提示词,无scripts/目录