Skills

Factor Research

Factor research framework with IC/IR analysis, quantile backtesting, and factor...

Install

npx skills add HKUDS/Vibe-Trading --skill factor-research -g -a claude-code -y
Repository
HKUDS/Vibe-Trading37.4k
Category
Writing
Updated
3d ago
License
MIT
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Factor research framework with IC/IR analysis, quantile backtesting, and factor combination. Suitable for cross-sectional factor evaluation across multiple instruments.

Factor Research Framework

Purpose

Systematically evaluates the predictive power of single or multiple factors. Uses IC/IR statistical tests and quantile backtests to determine whether a factor has stock-selection power, and to guide factor screening and combination.

Applicable scenarios:

  • Single-factor validity testing (momentum, value, quality, volatility, and more)
  • Determining weights for multi-factor combination
  • Factor decay analysis (IC changes across different holding periods)
  • Comparing factor differences across industries and markets

Workflow

  1. Calculate factor values: compute factor exposures for each instrument on the cross-section, and output a factor CSV (index=date, columns=codes)
  2. Calculate returns: compute each instrument's forward N-day return, and output a return CSV (same structure)
  3. Call the factor_analysis tool: pass in the factor CSV, return CSV, and output directory
  4. Interpret the results: judge factor validity based on IC/IR criteria and quantile backtest results
  5. Factor screening / combination: keep effective factors and combine them with equal weights or IC-based weights

Key point: the rows (dates) and columns (instrument codes) of the factor CSV and return CSV must align exactly. Returns must be forward returns after the factor-observation date (to avoid look-ahead bias).

factor_analysis Tool Parameters

ParameterTypeRequiredDefaultDescription
factor_csvstringYes-Path to the factor-value CSV
return_csvstringYes-Path to the return CSV
output_dirstringYes-Output directory for results
n_groupsintegerNo5Number of quantile groups

Output Files

FileContents
ic_series.csvDaily IC series
ic_summary.jsonIC mean, IC standard deviation, IR, proportion of IC > 0
group_equity.csvCumulative equity curves for each quantile group
Read the whole SKILL.md on GitHub

More in Writing