Agent skill

Factor Research with IC and IR

by HKUDS in HKUDS/Vibe-Trading

Evaluates factors across many instruments with IC and IR statistics and quantile backtests, then guides screening and weighting; uses the factor_analysis tool with factor and return CSVs.

MITAuto-check passedBusiness, Finance & HR

Install Factor Research with IC and IR

skills CLI
$ npx skills add HKUDS/Vibe-Trading --skill factor-research -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/Vibe-Trading factor-research --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agent/src/skills/factor-research .claude/skills/factor-research && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
factor-research
GitHub stars
35k
Token cost
~2.1k tokens
SKILL.md length
979 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Evaluates factors across many instruments with IC and IR statistics and quantile backtests, then guides screening and weighting; uses the factor_analysis tool with factor and return CSVs.

  • Works in 5 steps: Calculate factor values: compute factor… → Calculate returns: compute each… → Call the factor_analysis tool: pass in… → …
  • Testing whether a single factor such as momentum or value has stock-selection power
  • SKILL.md covers Purpose, Workflow, factor_analysis Tool Parameters and Output Files, plus 7 more sections
  • Calls pip

What it does

The workflow starts by computing factor values for each instrument and date into a factor CSV, and each instrument's forward N-day return into a return CSV with identical rows and columns. The agent then calls the factor_analysis tool with the two CSVs, an output directory and an optional number of quantile groups, which defaults to 5. Returns must be forward returns after the observation date to avoid look-ahead bias.

The tool writes an IC series, a JSON summary with IC mean, standard deviation, IR and the share of positive IC values, and cumulative equity curves per quantile group. Interpretation thresholds are given, such as an IC mean above 0.03 for basic predictive power, above 0.05 for strong power and above 0.10 as a prompt to check for look-ahead bias, and an IR above 0.5 for stable effectiveness. Effective factors are then kept and combined with equal or IC-based weights.

When your agent uses it

  • Testing whether a single factor such as momentum or value has stock-selection power
  • Choosing weights for a multi-factor combination
  • Analyzing factor decay across holding periods
  • Comparing a factor's behavior across industries or markets

Example prompts

  • “Run factor_analysis on factor.csv and returns.csv and summarize the IC and IR.”
  • “Check whether this momentum factor decays over longer holding periods.”
  • “Combine my three effective factors with IC-based weights.”
  • “My factor shows an IC mean above 0.10. What should I check?”

Requirements

  • The factor_analysis tool
  • Aligned factor and forward-return CSV files

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Calculate factor values: compute factor exposures for each instrument on the cross-section, and output a factor CSV (index=date…
  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

What it can do on your machine

Read from SKILL.md and the folder at commit 14cabaf. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Factor Research with IC and IR loads about 2.1k tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 979 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/Vibe-Trading at commit 14cabaf, republished under its MIT licence (© HKUDS). 979 words, ~2,131 tokens.

Download SKILL.mdSave it as .claude/skills/factor-research/SKILL.md (or your agent's skills folder).
name
factor-research
description
Factor research framework with IC/IR analysis, quantile backtesting, and factor combination. Suitable for cross-sectional factor evaluation across multiple instruments.
category
analysis

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

IC/IR Interpretation Standards

MetricThresholdInterpretation
IC mean> 0.03Factor has basic predictive power
IC mean> 0.05Factor has strong predictive power
IC mean> 0.10Unusually high; check for look-ahead bias
IR (IC mean / IC std)> 0.5Factor is stably effective
IR> 1.0Extremely strong, very rare
Proportion of IC > 0> 55%Factor direction is stable
Proportion of IC > 0< 50%Factor direction is unstable and unusable

Note: negative IC can also be useful (reverse factors). Judge by absolute value, and reverse the signal direction in actual use.

Quantile Backtest Interpretation

Quantile backtesting sorts instruments into N groups by factor value from low to high (default 5 groups), with equal-weight holding inside each group.

Criteria:

  • Monotonicity: the final net values from Group_1 to Group_N should show a monotonic rising (or falling) pattern. Better monotonicity means stronger factor discrimination
  • Long-short spread: the net-value difference between the highest and lowest group (long_short_spread). A larger spread means stronger selection power
  • Nonlinearity: if only the top and bottom groups differ materially while the middle groups are similar, the factor may only be effective in the tails
  • Stability: group equity curves should be smooth; sharp swings indicate an unstable factor

Warning signs:

  • No meaningful difference across group equity curves → the factor is ineffective
  • Non-monotonic pattern (such as V-shape or inverted V-shape) → the factor may have a nonlinear relationship and requires further analysis
  • One group's net value falls persistently → the factor may be usable in reverse

Factor Combination Methods

When multiple single factors pass validity tests, they should be combined into a composite factor:

Equal-Weight Combination

The simplest method: standardize each factor and sum them with equal weights. Suitable when the factor count is small and IC differences are minor.

Composite factor = Z(factor1) + Z(factor2) + ... + Z(factorN)
where Z() is cross-sectional Z-score standardization
IC-Weighted Combination

Assign weights according to historical IC mean. Factors with higher IC receive larger weights.

weight_i = |IC_mean_i| / sum(|IC_mean_j|)
Composite factor = sum(weight_i * Z(factor_i))
Orthogonalized Combination

First orthogonalize the factors with the Schmidt process to remove collinearity, then combine them with equal weights. Suitable when factors are highly correlated with one another.

1. Sort factors by IC from high to low
2. Keep the first factor unchanged
3. Regress each later factor on all previous factors and use the residual as the orthogonalized factor
4. Combine the orthogonalized factors with equal weights

Common Pitfalls

Show full SKILL.md (400 more words)Show less
Look-Ahead Bias
  • Factor values must be computed using data from day T and earlier, while returns must use data from T+1 to T+N
  • Wrong example: calculate the factor with day T closing price and correlate it with day T return → artificially inflated IC
  • Correct approach: factor value at day T, return defined as the move from the T close to the T+1 close and beyond
Skewed Factor Distributions
  • Some factors (such as market cap and turnover) have heavily right-skewed distributions
  • Computing IC directly from raw values makes the result dominated by outliers
  • Solution: apply cross-sectional rank or Z-score standardization before computing IC
Industry Neutralization
  • Factor values can be highly similar within the same industry, causing stock selection to cluster in a few sectors
  • Solution: perform Z-score standardization within each industry (industry neutralization) to remove industry effects
  • For China A-shares, Shenwan Level-1 industries can be used
Insufficient Sample Size
  • Each cross-section should contain at least 5 valid instruments to compute meaningful IC
  • Quantile backtests require at least n_groups instruments
  • When the universe is too small, IC is noisy and IR becomes unreliable
Factor Crowding
  • Classic factors (momentum, value) may see diminished excess returns after becoming widely used
  • Regularly inspect the time-series evolution of factor IC to see whether decay is occurring
  • Consider factor innovation or factor timing
Survivorship Bias
  • Backtesting only on stocks that still survive today will overestimate factor performance
  • Use full-sample data including delisted stocks

Dependencies

bash
pip install pandas numpy scipy

Calling Zoo Factors

Rather than recompute factors from raw OHLCV every research iteration, prefer reusing the 450+ pre-built alphas in the Alpha Zoo registry. Each alpha is metadata-validated (AlphaMeta schema with theme, universe, columns_required, decay_horizon, min_warmup_bars), shape-checked against panel["close"], and rejected if it emits +/- inf or >95% NaN — so the factor CSV you feed to factor_analysis is already sanity-checked.

python
from src.factors.registry import Registry

registry = Registry()
ids = registry.list(theme="momentum", universe="equity_cn")  # filter the catalogue
factor_panel = registry.compute("alpha101_001", panel)        # wide DataFrame, same shape as panel["close"]
factor_panel.to_csv("factor_alpha101_001.csv")                # ready for factor_analysis tool

For combining several validated alphas into one composite signal, see the multi-factor skill's ZooSignalEngine (it z-scores, weights, and ranks alphas for you, with per-alpha skip isolation). For browsing the catalogue and inspecting individual __alpha_meta__ records, see the alpha-zoo skill.

Artifact Placement

When factor_analysis runs inside a backtest or swarm run, set output_dir to <run_dir>/artifacts/factor/<factor_name>/ so the Run Detail Factor tab can render the results. Use one subdirectory per factor (for example artifacts/factor/momentum_20d/), and keep the three standard output files (ic_series.csv, ic_summary.json, group_equity.csv) together inside it. Artifacts written elsewhere under artifacts/ are still discovered by the recursive scan, but the canonical layout keeps runs comparable.

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in agent/src/skills/factor-research of HKUDS/Vibe-Trading.

Open the folder on GitHubat commit 14cabaf

Compare with similar skills

Factor Research with IC and IR next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Factor Research with IC and IR compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Factor Research with IC and IR this skillHKUDS/Vibe-Trading35k—~2.1kAutomated safety check: PassMIT
Fin Guru Quant AnalysisAojdevStudio/Finance-Guru322—~838Automated safety check: PassCustom licence
Polymarketmachina-sports/sports-skills242—~1.9kAutomated safety check: PassMIT
Comps Analysisginlix-ai/LangAlpha1.8k—~6.4kAutomated safety check: PassApache-2.0
Strategy Performance Reporttradesdontlie/tradingview-mcp6.8k3 repos~591Automated safety check: PassCustom licence
WorldQuant BRAIN Alpha ResearchQuantML-Research/wq-alpha-research405—~4.9kAutomated safety check: PassNone

Similar skills

  • Fin Guru Quant Analysis

    AojdevStudio/Finance-Guru

    Quantitative analysis of tickers or the portfolio through the engine's calculators.

    322 GitHub stars~838 tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Polymarket

    machina-sports/sports-skills

    Polymarket sports prediction markets — read-only live odds, prices, order books, events, series, and market search.

    242 GitHub stars~1.9k tokensUpdated 3 days ago
    Data & AnalyticsAuto-check passed
  • Comps Analysis

    ginlix-ai/LangAlpha

    Comparable company analysis: peer set, operating metrics, valuation multiples, statistics and an implied value.

    1.8k GitHub stars~6.4k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Strategy Performance Report

    tradesdontlie/tradingview-mcp

    Builds a performance report for a backtested Pine Script strategy from TradingView data, covering metrics, trades, the equity curve and improvement ideas.

    6.8k GitHub starsUsed in 3 repos~591 tokens
    Business, Finance & HRAuto-check passed
  • WorldQuant BRAIN Alpha Research

    QuantML-Research/wq-alpha-research

    Chinese-language playbook for WorldQuant BRAIN alphas: choose fields, write expressions, backtest, diagnose check failures, tune turnover, submit and build portfolios.

    405 GitHub stars~4.9k tokensUpdated 3 mo ago
    Business, Finance & HRAuto-check passed
  • Portfolio Risk Metrics

    wshobson/agents

    Covers portfolio risk measurement with VaR, CVaR, Sharpe, Sortino and drawdown, plus guidance on limits, stress tests and tail risk.

    40k GitHub starsUsed in 13 repos~502 tokens
    Business, Finance & HRAuto-check passed

More from HKUDS/Vibe-Trading

All 89 skills in this repo
  • Eastmoney Market Data

    HKUDS/Vibe-Trading

    Index of Eastmoney's free, no-token market data interfaces for China A-shares and Hong Kong stocks: fund flows, dragon-tiger lists, margin trading, reports and news.

    35k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • OKX Market Data

    HKUDS/Vibe-Trading

    Retrieves public OKX cryptocurrency market data such as spot prices, candlesticks, funding rates and open interest through the OKX V5 REST API, with no authentication.

    35k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • SEC EDGAR Filings Fetcher

    HKUDS/Vibe-Trading

    Fetches U.S. SEC EDGAR data: resolves tickers to CIK numbers, lists recent 10-K, 10-Q and 8-K filings with document URLs, and pulls XBRL financial series.

    35k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • A-Share ST Risk Screener

    HKUDS/Vibe-Trading

    Predicts whether a mainland China A-share company risks an ST or *ST warning after its next annual report, using financial thresholds and Sina penalty records.

    35k GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Breaks a structural trend such as AI infrastructure into its physical supply chain and ranks lesser-known listed companies sitting on each bottleneck.

    35k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Plans and drafts an eight-part, roughly 120k-word investigative series on one company, built around a strict fact-check pass rather than fast drafting.

    35k GitHub stars~2.4k tokensUpdated today
    Auto-check passed

Questions about Factor Research with IC and IR

What does Factor Research with IC and IR do?

Evaluates factors across many instruments with IC and IR statistics and quantile backtests, then guides screening and weighting; uses the factor_analysis tool with factor and return CSVs. The workflow starts by computing factor values for each instrument and date into a factor CSV, and each instrument's forward N-day return into a return CSV with identical rows and columns. The agent then calls the factor_analysis tool with the two CSVs, an output directory and an optional number of quantile groups, which defaults to 5.

When should I use Factor Research with IC and IR?

Factor Research with IC and IR fits situations like: testing whether a single factor such as momentum or value has stock-selection power; choosing weights for a multi-factor combination; analyzing factor decay across holding periods; comparing a factor's behavior across industries or markets.

How do I install Factor Research with IC and IR in Claude Code?

Run `npx skills add HKUDS/Vibe-Trading --skill factor-research -a claude-code`. Or copy the skill folder (agent/src/skills/factor-research in HKUDS/Vibe-Trading) into .claude/skills/factor-research in your project. Claude Code loads it when a task matches its description.

How do I install Factor Research with IC and IR in Codex?

Run `npx skills add HKUDS/Vibe-Trading --skill factor-research -a codex`. Or copy the skill folder (agent/src/skills/factor-research in HKUDS/Vibe-Trading) into .agents/skills/factor-research in your project. Codex loads it when a task matches its description.

Can I use Factor Research with IC and IR in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/Vibe-Trading --skill factor-research -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/factor-research, .gemini/skills/factor-research, .github/skills/factor-research and .opencode/skills/factor-research in your project.

What does Factor Research with IC and IR need to run?

Going by SKILL.md and its folder, Factor Research with IC and IR needs the command-line tools its instructions call (pip). Our summary lists: The factor_analysis tool; Aligned factor and forward-return CSV files.

Does Factor Research with IC and IR access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Factor Research with IC and IR safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Factor Research with IC and IR use?

Factor Research with IC and IR is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Factor Research with IC and IR use?

About 2.1k tokens (SKILL.md is roughly 8.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Factor Research with IC and IR?

Skills that share tags, products or a category with Factor Research with IC and IR: Fin Guru Quant Analysis (AojdevStudio/Finance-Guru, 322 stars), Polymarket (machina-sports/sports-skills, 242 stars), Comps Analysis (ginlix-ai/LangAlpha, 1.8k stars) and Strategy Performance Report (tradesdontlie/tradingview-mcp, 6.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Factor Research with IC and IR?

HKUDS (a GitHub organization) maintains it in HKUDS/Vibe-Trading, which has 34,949 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 8, 2026.

Source: HKUDS/Vibe-Trading on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.