mit einem Klick
factor-research
// Factor research framework with IC/IR analysis, quantile backtesting, and factor combination. Suitable for cross-sectional factor evaluation across multiple instruments.
// Factor research framework with IC/IR analysis, quantile backtesting, and factor combination. Suitable for cross-sectional factor evaluation across multiple instruments.
Professional finance research toolkit — backtesting (7 engines + benchmark comparison panel), factor analysis, Alpha Zoo (452 pre-built alphas across qlib158/alpha101/gtja191/academic), options pricing, 75 finance skills, 29 multi-agent swarm teams, Trade Journal analyzer, and Shadow Account (extract → backtest → render) across 6 data sources (tushare, yfinance, okx, akshare, ccxt, futu).
Browse and bench the bundled alpha zoos — prebuilt cross-sectional factor libraries (Kakushadze 101, GTJA 191, Qlib 158, Fama-French / Carhart). Use when the user asks "which alphas exist", wants metadata on a named alpha, or wants to run IC/IR on a whole zoo over a universe.
Multi-factor cross-sectional stock ranking. Combines factor standardization, equal-weight or IC-weighted scoring, and TopN portfolio construction. Suitable for multi-instrument portfolio strategies.
Read web pages, articles, and document links by converting URLs into Markdown text. Use the `read_url` tool directly, without bash. Sends the full URL to the third-party Jina Reader (r.jina.ai).
Fundamental factor screening — filter stocks by PE/PB/ROE, financial statement fields, and other metrics for value or growth selection. Supports A-shares (via tushare extra_fields or fundamental_fields) and HK/US stocks (via yfinance Ticker info).
Create, modify, and optimize quantitative trading strategies, then backtest and evaluate them.
| 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 |
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:
index=date, columns=codes)factor_analysis tool: pass in the factor CSV, return CSV, and output directoryKey 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| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| factor_csv | string | Yes | - | Path to the factor-value CSV |
| return_csv | string | Yes | - | Path to the return CSV |
| output_dir | string | Yes | - | Output directory for results |
| n_groups | integer | No | 5 | Number of quantile groups |
| File | Contents |
|---|---|
| ic_series.csv | Daily IC series |
| ic_summary.json | IC mean, IC standard deviation, IR, proportion of IC > 0 |
| group_equity.csv | Cumulative equity curves for each quantile group |
| Metric | Threshold | Interpretation |
|---|---|---|
| IC mean | > 0.03 | Factor has basic predictive power |
| IC mean | > 0.05 | Factor has strong predictive power |
| IC mean | > 0.10 | Unusually high; check for look-ahead bias |
| IR (IC mean / IC std) | > 0.5 | Factor is stably effective |
| IR | > 1.0 | Extremely 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 backtesting sorts instruments into N groups by factor value from low to high (default 5 groups), with equal-weight holding inside each group.
Criteria:
Group_1 to Group_N should show a monotonic rising (or falling) pattern. Better monotonicity means stronger factor discriminationlong_short_spread). A larger spread means stronger selection powerWarning signs:
When multiple single factors pass validity tests, they should be combined into a composite factor:
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
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))
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
n_groups instrumentspip install pandas numpy scipy
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.
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.