longbridge-factor-research

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

longbridge-factor-research

longbridge-factor-research

A systematic framework for testing whether a quantitative factor adds predictive value for future returns — covering IC analysis, information ratio, decile portfolio construction, and factor decay.
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
一个用于检验量化因子是否具备未来收益预测价值的系统性框架——涵盖IC分析、信息比率、十分位组合构建以及因子衰减分析。
响应语言:匹配用户输入语言——简体中文 / 繁体中文 / 英文。

When to use

使用场景

  • "帮我分析 PE 因子的 IC", "test IC for the PE factor on A-shares"
  • "动量因子有效吗", "is momentum factor effective on HK stocks"
  • "做个分层回测", "run a decile portfolio backtest"
  • "这个因子多少期后失效", "how many periods until this factor decays"
  • "IC 序列自相关怎么算", "calculate IC serial autocorrelation"
For multi-factor screening (not research), use
longbridge-factor-screen
. For ML-based strategies, use
longbridge-ml-strategy
.
  • "帮我分析 PE 因子的 IC", "test IC for the PE factor on A-shares"
  • "动量因子有效吗", "is momentum factor effective on HK stocks"
  • "做个分层回测", "run a decile portfolio backtest"
  • "这个因子多少期后失效", "how many periods until this factor decays"
  • "IC 序列自相关怎么算", "calculate IC serial autocorrelation"
若需多因子筛选(而非研究),请使用
longbridge-factor-screen
;若基于机器学习策略研究,请使用
longbridge-ml-strategy

Workflow

工作流程

Step 1 — Define the factor

步骤1 — 定义因子

Clarify with the user:
  • Factor name and calculation (e.g. trailing-12M PE, 1M price momentum, ROE YoY change).
  • Universe: index constituent (e.g. CSI 300, HSI, S&P 500) or custom list.
  • Test period (e.g. 2020-01-01 to 2024-12-31).
  • Holding period (e.g. monthly rebalance).
与用户确认以下信息:
  • 因子名称及计算方式(如过去12个月PE、1个月价格动量、ROE同比变化)。
  • 选股范围:指数成分股(如沪深300、恒生指数、标普500)或自定义列表。
  • 测试周期(如2020-01-01至2024-12-31)。
  • 持有周期(如月度调仓)。

Step 2 — Fetch universe constituents

步骤2 — 获取选股范围成分股

bash
longbridge constituent --help
longbridge constituent <INDEX> --format json
Extract the
stocks
array. Common indices:
000300.SH
(CSI 300),
HSI.HK
,
SPX.US
.
bash
longbridge constituent --help
longbridge constituent <INDEX> --format json
提取
stocks
数组。常用指数代码:
000300.SH
(沪深300)、
HSI.HK
(恒生指数)、
SPX.US
(标普500)。

Step 3 — Fetch factor values and returns

步骤3 — 获取因子值与收益数据

For each symbol in the universe:
bash
longbridge calc-index <SYMBOL> --format json   # valuation, growth metrics
longbridge kline <SYMBOL> --period day --count 252 --format json   # price history for returns
Run
--help
on each command to verify available fields before parsing.
针对选股范围内的每只标的:
bash
longbridge calc-index <SYMBOL> --format json   # 估值、成长指标
longbridge kline <SYMBOL> --period day --count 252 --format json   # 用于计算收益的价格历史数据
在解析前,可对每个命令添加
--help
参数查看可用字段。

Step 4 — Compute IC at each rebalance date

步骤4 — 计算每个调仓日的IC值

IC_t = rank_correlation(factor_value_t, forward_return_t+h)
Where
h
= holding period. Use Spearman rank correlation (robust to outliers). Winsorize factor values at 1%/99% before ranking.
IC_t = rank_correlation(factor_value_t, forward_return_t+h)
其中
h
为持有周期。采用Spearman秩相关系数(对异常值鲁棒)。在排序前需对因子值进行1%/99%分位的缩尾处理。

Step 5 — Summary statistics

步骤5 — 汇总统计指标

MetricFormulaGood signal threshold
Mean ICAverage of IC time series> 0.03 (positive)
IC Std DevStandard deviation of ICLower is better
IR (Information Ratio)Mean IC / Std Dev IC> 0.5 is promising
IC > 0 hit rate% of periods IC > 0> 55%
ICIR (annualised)IR × √(periods per year)> 1.0 strong
指标计算公式良好信号阈值
平均ICIC时间序列的平均值> 0.03(正向)
IC标准差IC的标准差越小越好
IR(信息比率)平均IC / IC标准差> 0.05具备潜力
IC>0命中率IC>0的周期占比> 55%
年化ICIRIR × √(每年周期数)> 1.0表现强劲

Step 6 — Decile portfolio backtest

步骤6 — 十分位组合回测

  1. At each rebalance date, sort universe into 10 deciles by factor value.
  2. Track equal-weighted returns for each decile over the holding period.
  3. Key output: decile 1 vs decile 10 spread (long-short portfolio return).
  4. Compute cumulative return, Sharpe ratio, and max drawdown for the long-short portfolio.
  1. 在每个调仓日,按因子值将选股范围分为10个十分位组。
  2. 跟踪每个十分位组在持有周期内的等权重收益。
  3. 核心输出:第1组与第10组的收益差(多空组合收益)。
  4. 计算多空组合的累计收益、夏普比率及最大回撤。

Step 7 — IC decay analysis

步骤7 — IC衰减分析

Compute IC for multiple forward horizons (1M, 2M, 3M, 6M, 12M). Plot IC vs horizon. Fast decay = short-term factor; slow decay = longer-term signal.
Serial autocorrelation of IC series:
autocorr(IC, lag=1)
. High autocorrelation → smoother signal, lower trading cost.
计算多个远期期限(1个月、2个月、3个月、6个月、12个月)的IC值,绘制IC与期限的关系图。衰减快代表短期因子;衰减慢代表长期信号。
IC序列的自相关:
autocorr(IC, lag=1)
。高自相关性意味着信号更平滑,交易成本更低。

CLI

命令行工具(CLI)

bash
longbridge constituent --help
longbridge calc-index --help
longbridge kline --help

longbridge constituent <INDEX> --format json
longbridge calc-index <SYMBOL> --format json
longbridge kline <SYMBOL> --period day --count 252 --format json
bash
longbridge constituent --help
longbridge calc-index --help
longbridge kline --help

longbridge constituent <INDEX> --format json
longbridge calc-index <SYMBOL> --format json
longbridge kline <SYMBOL> --period day --count 252 --format json

Output

输出内容

Present:
  1. Factor definition and universe summary.
  2. IC time series chart (describe in text if no chart tool).
  3. Summary statistics table (Mean IC, IC Std Dev, IR, hit rate).
  4. Decile return bar chart description (decile 1 to 10 cumulative return).
  5. IC decay table across horizons.
  6. Interpretation: is the factor effective? Recommended holding period?
需呈现:
  1. 因子定义及选股范围汇总。
  2. IC时间序列图表(若无绘图工具则用文字描述)。
  3. 汇总统计表格(平均IC、IC标准差、IR、命中率)。
  4. 十分位收益柱状图描述(第1至10组累计收益)。
  5. 不同期限下的IC衰减表格。
  6. 解读:因子是否有效?推荐持有周期?

Error handling

错误处理

Situation简体回复繁體回覆English reply
command not found: longbridge
请安装 longbridge-terminal 或检查 MCP 配置。請安裝 longbridge-terminal 或檢查 MCP 配置。Install longbridge-terminal or check MCP config.
stderr:
not logged in
请运行
longbridge auth login
請執行
longbridge auth login
Run
longbridge auth login
.
Index not found请检查指数代码格式,如 000300.SH / HSI.HK / SPX.US。請確認指數代碼,如 000300.SH / HSI.HK / SPX.US。Check index ticker format, e.g. 000300.SH / HSI.HK / SPX.US.
Insufficient history该标的历史数据不足以进行回测,请缩短测试期或更换标的。歷史數據不足,請縮短測試期或更換標的。Insufficient price history; shorten the test period or change the symbol.
场景简体回复繁體回覆English reply
command not found: longbridge
请安装 longbridge-terminal 或检查 MCP 配置。請安裝 longbridge-terminal 或檢查 MCP 配置。Install longbridge-terminal or check MCP config.
stderr:
not logged in
请运行
longbridge auth login
請執行
longbridge auth login
Run
longbridge auth login
.
Index not found请检查指数代码格式,如 000300.SH / HSI.HK / SPX.US。請確認指數代碼,如 000300.SH / HSI.HK / SPX.US。Check index ticker format, e.g. 000300.SH / HSI.HK / SPX.US.
Insufficient history该标的历史数据不足以进行回测,请缩短测试期或更换标的。歷史數據不足,請縮短測試期或更換標的。Insufficient price history; shorten the test period or change the symbol.

Related skills

相关技能

  • longbridge-factor-screen
    — screen stocks by factor values today
  • longbridge-multifactor
    — combine multiple factors into a composite score
  • longbridge-quant-stats
    — statistical tests (IC significance, t-test)
  • longbridge-ml-strategy
    — machine-learning based strategy research
  • longbridge-factor-screen
    — 按当前因子值筛选股票
  • longbridge-multifactor
    — 将多个因子组合成综合评分
  • longbridge-quant-stats
    — 统计检验(IC显著性、t检验)
  • longbridge-ml-strategy
    — 基于机器学习的策略研究

File layout

文件结构

skills/longbridge-factor-research/
└── SKILL.md
skills/longbridge-factor-research/
└── SKILL.md