backtest-expert
Expert guidance for systematic backtesting of trading strategies. Use when developing,…
Separate a strategy return series into declared baseline exposure and residual edge with returns-based OLS attribution, HAC inference, rolling stability, alternate-baseline sensitivity, and regime breakdowns. Use when evaluating whether backtest, out-of-sample, or live returns
$ npx -y skills add tradermonty/claude-trading-skills --skill residual-edge-analyzer --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/residual-edge-analyzerContext preview
The summary Claude sees to decide when to auto-load this skill.
Separate a strategy return series into declared baseline exposure and residual edge with returns-based OLS attribution, HAC inference, rolling stability, alternate-baseline sensitivity, and regime breakdowns. Use when evaluating whether backtest, out-of-sample, or live returns
name: residual-edge-analyzer description: Separate a strategy return series into declared baseline exposure and residual edge with returns-based OLS attribution, HAC inference, rolling stability, alternate-baseline sensitivity, and regime breakdowns. Use when evaluating whether backtest, out-of-sample, or live returns contain independent alpha beyond market, equal-weight, momentum, sector, or user-supplied factor returns; when explaining whether a drawdown came from baseline exposure or strategy-specific behavior; or when a strategy needs an attribution quality gate after backtesting. Do not use for holdings-based Brinson attribution, feature-level Shapley explanations, or analysis from summary metrics without a dated return series.
Test whether a strategy's apparent performance survives explicit comparison with predeclared baseline return series. Produce an auditable JSON artifact and a concise Markdown report without fetching data or changing trading exposure.
Treat this as a falsification gate after `backtest-expert`, not as trade authorization.
the same row.
[input contract](https://github.com/tradermonty/claude-trading-skills/blob/main/skills/residual-edge-analyzer/references/input-contract.md).
summary metrics.
State the claimed independent edge in one sentence. Select a primary baseline that is a plausible simple copy of the strategy, then select at least one alternate baseline model.
Record these declarations in the config:
Every declaration is mandatory for a decision-grade verdict. Omitting one is treated as undeclared, not as benign, and drops the report to `REVIEW_REQUIRED`. `not_applicable` exists so that a baseline with no universe membership can be declared explicitly rather than left blank.
Do not choose a baseline because it gives the preferred residual result.
Require:
Stop if the input lacks a dated strategy return series. Report summary-only input as insufficient rather than inventing observations.
python3 skills/residual-edge-analyzer/scripts/analyze_residual_edge.py \ --input reports/strategy_returns.csv \ --config reports/residual_edge_config.json \ --output-json reports/residual_edge_report.json \ --output-markdown reports/residual_edge_report.md
The script runs the predeclared primary model and all sensitivity models in one execution. It uses an intercept OLS model and HAC/Newey-West standard errors. It reports the residual edge ratio as annualized alpha divided by annualized residual volatility; do not calculate a Sharpe ratio from raw OLS residual mean because an intercept makes that mean zero.
Use the four statuses as diagnostic labels:
thresholds.
baseline models. Also use this status when rolling analysis is disabled, unavailable, incomplete, or no sensitivity model was supplied.
Read `decision_eligibility` separately. A statistically interesting result remains `REVIEW_REQUIRED` when critical provenance, cost-basis, sample, or multicollinearity warnings exist, when rolling evidence is unavailable, or when no alternate baseline was tested.
Inspect:
1. primary and sensitivity-model status; 2. annualized alpha and HAC t-stat; 3. residual edge ratio and residual autocorrelation; 4. rolling alpha stability; 5. VIF for multi-factor models; 6. active-return breakdown across predeclared regimes.
and interaction effects require historical holdings, benchmark weights, and constituent returns.
point-in-time.
confirm findings out of sample.
and implementation value require separate evidence.
Claude Trading Skills started as a personal project to use AI to improve my own trading process. Claude Trading Skills is a Claude Skills-based trading workflow toolkit for time-constrained individual investors.
Expert guidance for systematic backtesting of trading strategies. Use when developing,…
This skill should be used when analyzing market breadth charts, specifically the S&P 500…
Generate Minervini-style breakout trade plans from VCP screener output with worst-case risk…
Screen US stocks using William O'Neil's CANSLIM growth stock methodology. Use when user…
Synthesize the three Jason Shapiro contrarian-pipeline verdicts (COT crowding, news-reaction…
Detect crowded speculative positioning in CFTC futures markets (COT report analysis) to find…