$npx -y skills add minihellboy/factorminer --skill factor-backtestCombine a factor library into a composite signal and quintile-backtest it under transaction costs — long-short return, monotonicity, turnover, and tearsheets. Use for the portfolio-level view that single-factor IC does not give. Triggers on "backtest", "composite signal", "combin
| 1 | # Factor Backtest |
| 2 | |
| 3 | A library of individually-decent factors is not a strategy. This skill combines them into one composite signal and backtests the portfolio that signal implies — the level at which transaction costs and capacity actually bite. |
| 4 | |
| 5 | ## Workflow |
| 6 | |
| 7 | ### 1. Combine and backtest |
| 8 | |
| 9 | ```bash |
| 10 | factorminer combine output/run1/factor_library.json \ |
| 11 | --data path/to/market_data.csv \ |
| 12 | --method all --fit-period train --eval-period test |
| 13 | ``` |
| 14 | |
| 15 | - `--method` — `equal-weight`, `ic-weighted`, `orthogonal`, or `all` to compare every method. |
| 16 | - `--fit-period` — split used to fit weights / run selection (use `train`). |
| 17 | - `--eval-period` — split used to score the composite (use `test`). |
| 18 | - `--selection` — optional pre-filter: `lasso`, `stepwise`, `xgboost`, or `none`. |
| 19 | - `--top-k` — keep only the top-K factors before combining. |
| 20 | |
| 21 | The report gives composite `IC Mean`, `ICIR`, `Long-Short` return, `Monotonicity`, and `Avg Turnover`. |
| 22 | |
| 23 | ### 2. Generate tearsheets |
| 24 | |
| 25 | For the visual portfolio view — quintile returns, IC time series, correlation heatmap: |
| 26 | |
| 27 | ```bash |
| 28 | factorminer -o output/run1 visualize output/run1/factor_library.json \ |
| 29 | --data market_data.csv --period test --tearsheet --quintile --correlation |
| 30 | ``` |
| 31 | |
| 32 | ## What to look for |
| 33 | |
| 34 | - **Monotonicity** — quintile returns should step up Q1→Q5. A non-monotone composite is fragile regardless of headline IC. |
| 35 | - **Long-short return net of turnover** — high `Avg Turnover` means the gross return is optimistic; FactorMiner's transaction-cost model is what makes the net number honest. |
| 36 | - **Method spread** — if `orthogonal` and `equal-weight` disagree sharply, the library has redundant or unstable factors; revisit `factor-evaluation`. |
| 37 | |
| 38 | ## Guardrails |
| 39 | |
| 40 | - Fit weights on `train`, score on `test` — never fit and score on the same split. |
| 41 | - The backtest estimates historical behavior; it is not a forward return promise. Present it as a research artifact for review. |
| 42 | - Report net-of-cost numbers as the headline; gross numbers only as context. |