Skip to content
SkillScript-led3,533 tokens in use

Pair Trade Screener

Two Python scripts that screen a sector or ticker list for correlated, cointegrated stock pairs and report hedge ratio, half-life and the current spread z-score.

7,428 stars on the repository MIT Licensetradermonty/claude-trading-skills · skills/pair-trade-screener

Skill label

measured from its files

What installing Pair Trade Screener costs

87tokens idle
3,533tokens in use
17,220tokens, 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_spread.py, scripts/find_pairs.py, scripts/fmp_client.py, scripts/pair_fmp_client.py, scripts/statsmodels_support.py.

Touches

shelldetectednetworkdetectedcredentialsdetected

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
  • Structure25/25
  • Examples12/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 →
Good
  • Runs shell commands−5

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

    SKILL.md, line 52
  • Reads credentials−15

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

    scripts/analyze_spread.py, line 48
  • Reaches the network−10

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

    scripts/fmp_client.py, line 32

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

Pair Trade Screener is a statistical arbitrage research tool. find_pairs.py pulls company lists and two years of daily prices from the Financial Modeling Prep API, filters pairs by correlation, tests the spread for cointegration with an Augmented Dickey-Fuller test, and estimates hedge ratio, half-life and z-score. analyze_spread.py examines a single pair in depth.

The skill also describes entry and exit rules, market-neutral position sizing and report structure in its reference files. It reports statistics and does not give investment advice.

What You Get

  • A JSON file from find_pairs.py with metadata and ranked pairs
  • Per-pair correlation, hedge ratio, ADF result, half-life, z-score and signal
  • A single-pair statistical report from analyze_spread.py printed to the terminal
  • A record of whether each symbol used dividend-adjusted or raw closing prices
  • Reference guidance on entry and exit rules, sizing, costs and shorting

Common Use Cases

  • Screening one sector for pairs that moved together over two years
  • Examining the spread behaviour of two named tickers
  • Checking whether a pair’s correlation has weakened recently
  • Building a watchlist of pairs sorted by cointegration strength

What Makes It Unique

It combines correlation, cointegration, half-life and structural-break checks in one workflow and states quality thresholds and red flags in advance. The scripts validate thresholds, lookback windows and duplicate symbols before they call the API, record the price basis used for each symbol, and fail with a clear message when the statistics library is missing. Reference files cover methodology, cointegration theory, trade rules and sibling skills.

Under The Hood

Claude runs the Python scripts from the shell, often through uv with a pinned statsmodels version. The scripts call the Financial Modeling Prep API for the company screener and daily history, using the API key from the FMP_API_KEY environment variable, and fall back from the dividend-adjusted endpoint to full and older endpoints. find_pairs.py creates the output folder and writes one JSON file, while analyze_spread.py prints to the terminal only. Progress and a ranked summary go to standard output. Access to the endpoints depends on your FMP plan.

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