longbridge-quant

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

longbridge-quant

longbridge-quant

Server-side quantitative indicator runner: execute Pine Script v6 syntax subset on historical K-line data via Longbridge Securities servers.
⚠️ Beta feature:
longbridge quant run
may return
internal server error
if the feature is not yet enabled for your account. Contact Longbridge support to enable quantitative script access if needed.
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
服务端量化指标运行器:通过Longbridge Securities服务器在历史K线数据上执行Pine Script v6语法子集。
⚠️ Beta功能:如果你的账户尚未启用该功能,
longbridge quant run
可能会返回
internal server error
。如有需要,请联系Longbridge支持团队开启量化脚本访问权限。
响应语言:与用户输入语言匹配——简体中文/繁体中文/英文。

When to use

使用场景

  • "帮我算 TSLA 的 MACD", "計算 RSI(14)", "run MACD on NVDA"
    longbridge quant run
    with a built-in
    ta.*
    function
  • "用 Pine Script 算布林带", "自定义指标脚本", "custom Pine Script indicator" → pass a script string or pipe a
    .pine
    file
  • "我想看近一年 EMA20", "EMA 20 for the past year" → set
    --start
    /
    --end
    accordingly
For raw OHLCV data without indicator logic, defer to
longbridge-kline
. For visual chart output, defer to
longbridge-kline
.
  • "帮我算 TSLA 的 MACD", "計算 RSI(14)", "run MACD on NVDA" → 使用内置
    ta.*
    函数调用
    longbridge quant run
  • "用 Pine Script 算布林带", "自定义指标脚本", "custom Pine Script indicator" → 传入脚本字符串或管道传输
    .pine
    文件
  • "我想看近一年 EMA20", "EMA 20 for the past year" → 相应设置
    --start
    /
    --end
    参数
如果需要不带指标逻辑的原始OHLCV数据,请使用
longbridge-kline
。如果需要可视化图表输出,也请使用
longbridge-kline

Workflow

工作流程

  1. Identify the symbol, date range, and indicator expression from the prompt.
  2. Run
    longbridge quant run --help
    to check supported functions and flags before constructing the call.
  3. Build the
    --script
    string using Pine Script v6
    ta.*
    built-ins (e.g.
    ta.macd
    ,
    ta.rsi
    ,
    ta.ema
    ,
    ta.bb
    ).
  4. For multi-indicator requests, wrap them in a list:
    "[ta.macd(...), ta.rsi(...)]"
    .
  5. Return JSON output; summarise the last N rows in a date-sorted table.
  1. 从提示中识别标的代码、日期范围和指标表达式。
  2. 在构建调用前,运行
    longbridge quant run --help
    查看支持的函数和参数。
  3. 使用Pine Script v6的
    ta.*
    内置函数(如
    ta.macd
    ,
    ta.rsi
    ,
    ta.ema
    ,
    ta.bb
    )构建
    --script
    字符串。
  4. 对于多指标请求,将其包裹在列表中:
    "[ta.macd(...), ta.rsi(...)]"
  5. 返回JSON格式输出;将最后N行结果整理为按日期排序的表格进行汇总。

CLI

CLI

Run
longbridge quant run --help
before constructing calls — it is the canonical source for supported functions, operators, and flags.
bash
undefined
在构建调用前,请先运行
longbridge quant run --help
——它是查看支持的函数、运算符和参数的权威来源。
bash
undefined

Inspect supported functions and flags first

先查看支持的函数和参数

longbridge quant run --help
longbridge quant run --help

Single built-in indicator — 20-day EMA

单个内置指标 —— 20日 EMA

longbridge quant run AAPL.US --start 2025-01-01 --end 2025-12-31
--script "ta.ema(close, 20)" --format json
longbridge quant run AAPL.US --start 2025-01-01 --end 2025-12-31
--script "ta.ema(close, 20)" --format json

RSI(14) for a date range

某一日期范围的 RSI(14)

longbridge quant run TSLA.US --start 2026-01-01 --end 2026-04-30
--script "ta.rsi(close, 14)" --format json
longbridge quant run TSLA.US --start 2026-01-01 --end 2026-04-30
--script "ta.rsi(close, 14)" --format json

Multi-indicator: MACD + RSI combined

多指标组合:MACD + RSI

longbridge quant run NVDA.US --start 2025-01-01 --end 2026-01-01
--script "[ta.macd(close,12,26,9), ta.rsi(close,14)]" --format json
longbridge quant run NVDA.US --start 2025-01-01 --end 2026-01-01
--script "[ta.macd(close,12,26,9), ta.rsi(close,14)]" --format json

Bollinger Bands

布林带

longbridge quant run 700.HK --start 2025-06-01 --end 2025-12-31
--script "ta.bb(close, 20, 2)" --format json
longbridge quant run 700.HK --start 2025-06-01 --end 2025-12-31
--script "ta.bb(close, 20, 2)" --format json

Pipe a custom Pine Script file

管道传输自定义 Pine Script 文件

cat myindicator.pine | longbridge quant run AAPL.US
--start 2025-01-01 --end 2025-12-31 --format json

**Note**: `longbridge quant run` uses a Pine Script v6 syntax subset. Not all Pine Script v6 functions are available — check `--help` for the full supported function and operator list.
cat myindicator.pine | longbridge quant run AAPL.US
--start 2025-01-01 --end 2025-12-31 --format json

**注意**:`longbridge quant run`使用Pine Script v6语法子集。并非所有Pine Script v6函数都可用——请运行`--help`查看完整的支持函数和运算符列表。

Output

输出结果

Present results as a date-sorted table with indicator columns. Example layout:
DateEMA(20)RSI(14)
2025-12-31248.3261.4
2025-12-30247.8959.8
  • Always show the date range queried and the symbol.
  • For multi-output indicators (e.g. MACD returns MACD line / signal / histogram), show all components as separate columns.
  • Cite Longbridge Securities as the data source.
将结果展示为按日期排序的表格,包含指标列。示例布局:
日期EMA(20)RSI(14)
2025-12-31248.3261.4
2025-12-30247.8959.8
  • 始终显示查询的日期范围和标的代码。
  • 对于多输出指标(如MACD返回MACD线/信号线/柱状图),将所有组件显示为单独列。
  • 注明Longbridge Securities作为数据来源。

Error handling

错误处理

Situation简体回复 / 繁体回复 / English reply
command not found: longbridge
请安装 longbridge-terminal / 請安裝 longbridge-terminal / Install longbridge-terminal first; fall back to MCP if configured.
unsupported function
/
parse error
指定函数不在支持列表,请运行
--help
查看可用函数 / 指定函數不在支援清單,請執行
--help
查看可用函數 / Function not supported — run
longbridge quant run --help
for the full list.
not logged in
/
unauthorized
运行
longbridge auth login
/ 執行
longbridge auth login
/ Run
longbridge auth login
.
Empty result指定日期范围内无数据 / 指定日期範圍內無數據 / No data for the requested date range.
Other stderrSurface verbatim — never silently retry.
场景简体回复 / 繁体回复 / English reply
command not found: longbridge
请安装 longbridge-terminal / 請安裝 longbridge-terminal / Install longbridge-terminal first; fall back to MCP if configured.
unsupported function
/
parse error
指定函数不在支持列表,请运行
--help
查看可用函数 / 指定函數不在支援清單,請執行
--help
查看可用函數 / Function not supported — run
longbridge quant run --help
for the full list.
not logged in
/
unauthorized
运行
longbridge auth login
/ 執行
longbridge auth login
/ Run
longbridge auth login
.
空结果指定日期范围内无数据 / 指定日期範圍內無數據 / No data for the requested date range.
其他标准错误输出直接显示原始内容——切勿静默重试。

MCP fallback

MCP fallback

When the CLI binary is missing, fall back via the equivalent MCP tool:
CLIMCP tool
longbridge quant run ...
mcp__longbridge__quant_run
If the tool name does not resolve, ask the user to install the CLI.
当CLI二进制文件缺失时,通过等效的MCP工具进行回退:
CLIMCP工具
longbridge quant run ...
mcp__longbridge__quant_run
如果工具名称无法解析,请要求用户安装CLI。

Related skills

相关技能

SkillWhy
longbridge-kline
Raw OHLCV candlestick data without indicator computation.
longbridge-anomaly
Pre-computed unusual price/volume alerts on the server.
longbridge-capital-flow
Intraday money-flow signals complementing technical indicators.
技能说明
longbridge-kline
不带指标计算的原始OHLCV蜡烛图数据。
longbridge-anomaly
服务器端预计算的异常价格/成交量警报。
longbridge-capital-flow
补充技术指标的日内资金流信号。

File layout

文件结构

longbridge-quant/
└── SKILL.md          # prompt-only, no scripts/
longbridge-quant/
└── SKILL.md          # 仅提示文件,无scripts/目录