longbridge-kline

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

longbridge-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
longbridge-derivatives
(derivatives) or
longbridge-quote
(indices).
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
通过长桥证券支持的证券(港股/美股/A股/新加坡股)获取历史K线数据及当日分时走势。不支持期权、权证或指数相关数据——如需查询衍生品数据请使用
longbridge-derivatives
,查询指数数据请使用
longbridge-quote
响应语言:匹配用户输入语言——简体中文/繁体中文/英文。

Subcommands

子命令

Run
longbridge kline --help
to confirm current period values, defaults, and aliases.
CLI commandUse when
longbridge kline <SYMBOL> --period <P> --count <N> --format json
Latest N candles. Periods:
1m / 5m / 15m / 30m / 1h / day / week / month / year
.
longbridge kline history <SYMBOL> --start YYYY-MM-DD --end YYYY-MM-DD --period <P> --format json
OHLCV across an explicit date range (sub-subcommand).
longbridge intraday <SYMBOL> --format json
Today's per-minute curve (price + volume + avg_price).
Period aliases:
minute=1m
,
hour=1h
,
d/1d=day
,
w=week
,
m/1mo=month
,
y=year
.
--adjust none
(default) or
--adjust forward
for 前复权 / 前復權.
运行
longbridge kline --help
可确认当前支持的周期值、默认设置及别名。
CLI命令使用场景
longbridge kline <SYMBOL> --period <P> --count <N> --format json
获取最近N根K线。支持周期:
1m / 5m / 15m / 30m / 1h / day / week / month / year
longbridge kline history <SYMBOL> --start YYYY-MM-DD --end YYYY-MM-DD --period <P> --format json
查询指定日期范围内的OHLCV数据(子子命令)。
longbridge intraday <SYMBOL> --format json
获取当日分钟级走势数据(价格+成交量+平均价格)。
周期别名:
minute=1m
hour=1h
d/1d=day
w=week
m/1mo=month
y=year
。默认使用
--adjust none
(不复权),添加
--adjust forward
可启用前复权/前復權。

When 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

工作流程

  1. Resolve the symbol to
    <CODE>.<MARKET>
    (see
    longbridge-quote
    for the rules).
  2. Pick the form:
    • Explicit start/end dates →
      kline history
      .
    • "Today" / "intraday" →
      intraday
      .
    • Otherwise →
      kline
      with sensible defaults (
      --period day --count 100
      ).
  3. Map natural-language windows to (
    period
    ,
    count
    ). Examples: "最近一周" →
    day,7
    , "最近一年" →
    day,252
    , "月 K" →
    month,100
    .
  4. Call the Longbridge CLI directly (preferred) or fall back to MCP.
  5. Translate datasets into prose (range high / low, net move, volume note); use ▲ / ▼ for direction. Cite Longbridge Securities / 数据来源:长桥证券 / 數據來源:長橋證券.
  1. 将证券代码解析为
    <CODE>.<MARKET>
    格式(解析规则可参考
    longbridge-quote
    )。
  2. 选择合适的命令形式:
    • 指定起始/结束日期 → 使用
      kline history
    • 查询"今日"/"日内"数据 → 使用
      intraday
    • 其他场景 → 使用
      kline
      并采用合理默认值(
      --period day --count 100
      )。
  3. 将自然语言描述的时间范围映射为(
    period
    ,
    count
    )参数。例如:"最近一周"→
    day,7
    ,"最近一年"→
    day,252
    ,"月K"→
    month,100
  4. 直接调用Longbridge CLI(优先方式),或 fallback 至MCP。
  5. 将数据集转换为可读性文本(包括区间最高价/最低价、涨跌幅度、成交量说明);使用▲/▼标识涨跌方向。需标注数据来源: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 json
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 json

Output

输出格式

longbridge kline ... --format json
returns a list of OHLCV rows:
json
[
  {"time": "...", "open": "...", "high": "...", "low": "...", "close": "...", "volume": "...", "turnover": "..."}
]
intraday
rows are
{time, price, volume, turnover, avg_price}
.
longbridge kline ... --format json
返回OHLCV数据行列表:
json
[
  {"time": "...", "open": "...", "high": "...", "low": "...", "close": "...", "volume": "...", "turnover": "..."}
]
intraday
命令返回的数据行格式为
{time, price, volume, turnover, avg_price}

Error handling

错误处理

If
longbridge
is not installed, the shell returns a
command not found
error → fall back to MCP (see below) or tell the user to install longbridge-terminal. If
longbridge
prints
Error: ...
to stderr, surface the message to the user — common causes:
  • Error: not logged in
    /
    unauthorized
    → user runs
    longbridge auth login
    .
  • Error: invalid symbol
    /
    param_error
    → re-check the
    <CODE>.<MARKET>
    format.
若未安装
longbridge
,终端会返回
command not found
错误 → 可fallback至MCP(见下文),或提示用户安装longbridge-terminal。若
longbridge
向stderr输出
Error: ...
,需将错误信息展示给用户——常见错误原因:
  • Error: not logged in
    /
    unauthorized
    → 提示用户执行
    longbridge auth login
    登录。
  • Error: invalid symbol
    /
    param_error
    → 重新检查
    <CODE>.<MARKET>
    格式是否正确。

MCP fallback

MCP fallback方案

CLI subcommandMCP tool
kline
mcp__longbridge__candlesticks
kline history
mcp__longbridge__history_candlesticks_by_offset
or
mcp__longbridge__history_candlesticks_by_date
intraday
mcp__longbridge__intraday
CLI子命令MCP工具
kline
mcp__longbridge__candlesticks
kline history
mcp__longbridge__history_candlesticks_by_offset
mcp__longbridge__history_candlesticks_by_date
intraday
mcp__longbridge__intraday

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/目录