Skip to content
SkillScript-led1,101 tokens in use

Residual Edge Analyzer

An offline Python analyzer that regresses a strategy's returns on predeclared baselines and reports residual alpha, HAC statistics, rolling stability and regime breakdowns as a diagnostic status.

7,428 stars on the repository MIT Licensetradermonty/claude-trading-skills · skills/residual-edge-analyzer

Skill label

measured from its files

What installing Residual Edge Analyzer costs

133tokens idle
1,101tokens in use
2,934tokens, up to

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Up to adds the files its instructions link. Counts are approximate, made offline with cl100k_base.

Model dependence Script-led

Script-ledMixedModel-led

Most of this skill is scripts, so it behaves much the same whichever model runs it.

This describes the skill's structure, how much of it is scripts. It does not say how well it works. Scripts: scripts/analyze_residual_edge.py.

Touches

shelldetectedwrites filesdetected

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Excellent
  • Frontmatter12/15
  • Structure23/25
  • Examples9/15
  • Output15/15
  • Size15/15
  • Resources9/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Excellent
  • Runs shell commands−5

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 63
  • Writes files−8

    does this on the machine, and the frontmatter does not say so

    scripts/analyze_residual_edge.py, line 1268

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity100
  • Maintenance52
  • Community68
  • Maturity36
  • Momentum40

Residual Edge Analyzer tests whether a strategy’s returns contain performance that simple baselines do not explain. You supply a CSV with a date, the strategy return and each baseline return, plus a JSON config that declares the baseline choice, return basis, analysis scope and universe data type.

The script runs an intercept OLS model with Newey-West standard errors for the primary baseline and all sensitivity baselines, adds rolling alpha stability and regime breakdowns, and writes a JSON artifact and a Markdown report. It fetches no data and changes no exposure. The skill frames it as a falsification gate and not as trade authorization.

What You Get

  • A JSON artifact with the primary and sensitivity model results
  • A concise Markdown report
  • Annualized alpha with a HAC t-statistic, and the residual edge ratio
  • Rolling alpha stability, VIF for multi-factor models and residual autocorrelation
  • An active-return breakdown across predeclared regimes
  • Handoff guidance to backtest-expert, signal-postmortem and trade-performance-coach

Common Use Cases

  • Checking whether a backtest beats a market or equal-weight baseline
  • Explaining whether a drawdown came from baseline exposure or from strategy behaviour
  • Adding an attribution quality gate after backtesting
  • Comparing results across alternate baseline models for sensitivity

What Makes It Unique

It is built to disprove an edge as much as to find one. Baselines must be declared up front, gross and net bases must match, same-universe baselines need point-in-time membership, and missing declarations lower the verdict. The skill lists what it is not: holdings-based Brinson attribution, feature-level Shapley explanations, or analysis from summary metrics without a dated return series.

Under The Hood

Claude runs one Python script, analyze_residual_edge.py, from the shell with an input CSV, a config file and output paths. The script reads those local files, does the statistics itself and writes the JSON and Markdown reports to the paths you give. It makes no network calls and fetches no market data. Two reference files describe the input contract and the statistical methodology, and Claude loads them when it needs to explain the inputs or interpret results.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers