Skills may execute instructions and code that could affect your environment. Marketplace scans reduce risk but do not guarantee safety. Always review files, run your own security checks, and use at your own risk.
pair-trade-screener
Security Scan Summary
Status: Safe
Source: Syntic Skills registry
Automated security scan completed with no high-risk patterns detected. Manual review is still required.
About This Skill
Use when screening for pair trading opportunities, statistical arbitrage, cointegrated stock pairs, mean-reversion strategies, or market-neutral portfolios, including correlation and z-score analysis.
Downloadable SKILL.md
Download SKILL.md and place it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review contents, and run in a controlled environment first. Acknowledge the risk notice above to enable the download.
--- name: pair-trade-screener description: Use when screening for pair trading opportunities, statistical arbitrage, cointegrated stock pairs, mean-reversion strategies, or market-neutral portfolios, including correlation and z-score analysis. category: Screening version: 1.0.0 tools: [] --- # Pair Trade Screener Identify and analyze statistical arbitrage opportunities through pair trading — a market-neutral strategy that profits from the relative price movements of two correlated securities, regardless of overall market direction, using rigorous statistical methods including correlation analysis and cointegration testing. **Core Methodology:** - Identify stock pairs with high correlation and similar sector/industry exposure. - Test for cointegration (long-term statistical relationship). - Calculate spread z-scores to identify mean-reversion opportunities. - Generate entry/exit signals from statistical thresholds. - Size positions for market-neutral exposure. **Key advantages**: market-neutral (profits up, down, or sideways); limited exposure to broad market moves; data-driven rather than discretionary; diversifying versus long-only strategies. ## When to Use User asks for pair trading opportunities, market-neutral strategies, statistical arbitrage screening, "which stocks move together," sector-hedge ideas, mean-reversion trade ideas, or relative-value trades — e.g. "Find pair trading opportunities in tech," "Which stocks are cointegrated?", "Find mean-reversion pairs." ## Analysis Workflow ### Step 1: Define Pair Universe Select a sector (Technology, Financials, Healthcare, Consumer Discretionary, Industrials, Energy, Materials, Consumer Staples, Utilities, Real Estate, Communication Services), a custom ticker list (e.g. AAPL, MSFT, GOOGL, META, NVDA), or a narrower industry within a sector (e.g. "Software" within Technology, "Regional Banks" within Financials). Filter to: minimum market cap $2B (mid-cap and above), minimum average volume 1M shares/day, actively traded (no delisted/inactive), same-exchange preference to avoid cross-exchange complications. ### Step 2: Retrieve Historical Price Data Gather at least 2 years (252+ trading days) of daily closing prices, adjusted for splits and dividends, via web_search or knowledge_base_search against available market-data sources. Verify consistent date ranges across symbols, drop stocks with >10% missing data, forward-fill minor gaps, and note data-quality issues. ### Step 3: Calculate Correlation and Beta For each candidate pair, calculate the Pearson correlation coefficient (ρ) and a 90-day rolling correlation for stability. Filter to ρ ≥ 0.70. Interpret: ρ ≥ 0.90 very strong (best candidates); 0.70-0.90 strong (good candidates); 0.50-0.70 moderate (marginal); <0.50 weak (exclude). Compute beta as Covariance(A,B) ÷ Variance(B) — the hedge ratio (e.g. beta 1.5 means $1.50 of B per $1.00 of A). Check correlation stability across 6-month, 1-year, and 2-year windows; flag pairs where recent correlation falls more than 0.15 below historical. ### Step 4: Cointegration Testing Correlation measures short-term co-movement; cointegration proves a long-term equilibrium relationship — cointegrated pairs mean-revert predictably, non-cointegrated pairs may diverge permanently. **ADF Test** (Augmented Dickey-Fuller): for each correlated pair, compute the spread = Price_A − (Beta × Price_B), then run the ADF test on the spread series. A p-value < 0.05 indicates cointegration (rejects the null hypothesis of a unit root); extract the ADF statistic for strength ranking. Interpret: p < 0.01 very strong cointegration; p 0.01-0.05 moderate cointegration; p > 0.05 no cointegration (exclude). Estimate mean-reversion speed via half-life = −log(2) ÷ log(mean-reversion coefficient): <30 days fast (good for short-term trading); 30-60 days moderate (standard); >60 days slow (long holding periods). ### Step 5: Spread Analysis and Z-Score Two spread constructions: **Price Difference** (additive) = Price_A − (Beta × Price_B), best for similar price levels; **Price Ratio** (multiplicative) = Price_A ÷ Price_B, best for differing price levels and easier interpretation. Z-score = (current spread − mean spread) ÷ std dev of spread, using a 90-day rolling window. Interpret: Z > +2.0 A expensive relative to B (short A, long B); +1.5 to +2.0 moderately expensive (watch for entry); −1.5 to +1.5 normal range (no trade); −2.0 to −1.5 moderately cheap (watch for entry); Z < −2.0 A cheap relative to B (long A, short B). Also track maximum historical z-score deviations and check for structural breaks (spread regime change). ### Step 6: Entry/Exit Recommendations **Conservative entry (|Z| ≥ 2.0)**: if cointegration p < 0.05 and half-life < 60 days — Long signal (Z < −2.0): buy A, short B at the beta hedge ratio; Short signal (Z > +2.0): short A, buy B at the beta hedge ratio. **Aggressive entry (|Z| ≥ 1.5)**: more frequent trades, higher win rate but smaller average profit, requires tighter risk management. **Exits**: primary — mean reversion, close both legs when Z crosses 0; partial profit — exit 50% at |Z| = 1.0, remainder at Z = 0; stop loss — exit if |Z| exceeds 3.0 (possible structural break); time-based — exit after 90 days if no mean reversion, to avoid holding broken pairs indefinitely. ### Step 7: Position Sizing and Risk For a pair with beta β, size for equal-dollar market-neutral exposure — e.g. on $10,000 allocated with β = 1.2: long $5,000 of A, short $6,000 of B (market neutral, net beta ≈ 0). Allocate 10-20% of portfolio per pair, cap active pairs at 5-8 for diversification, and avoid highly correlated pairs across the book. Risk limits: max loss per pair 2-3% of total portfolio; stop-loss trigger |Z| > 3.0 or -5% loss on the spread; portfolio-level risk across all pairs ≤ 10%. ### Step 8: Report Produce a structured chat report: executive summary (pairs analyzed, cointegrated pairs found, top 5 ranked by statistical strength); a cointegrated-pairs table (pair, correlation, cointegration p-value, current z-score, signal, half-life); detailed analysis of the top 10 pairs (metrics, current spread position, entry/exit, sizing, risk); a text-based historical z-score summary with entry/exit levels marked; and risk warnings (deteriorating correlation, structural breaks, low liquidity). ## Quality Standards **Minimum requirements for a valid pair**: correlation ≥ 0.70 over 2 years; cointegration p-value < 0.05 (ADF Test); confirmed spread stationarity; half-life < 90 days; no structural breaks in the last 6 months. **Red flags (exclude)**: correlation dropped >0.20 in the last 6 months; cointegration p-value > 0.05; half-life increasing over time (weakening mean reversion); significant corporate events (merger, spin-off, bankruptcy risk); average volume < 500K shares/day. **Practical considerations**: assume ~0.1% round-trip transaction cost per leg (≈0.4% total for entry + exit on both legs) — the entry z-score threshold should clear this cost; verify shortability and factor in borrow fees and short-squeeze risk; enter and exit both legs simultaneously to avoid leg risk, and use limit orders to control slippage. **Common pitfalls**: survivorship bias (universe excludes delisted/failed names, inflating apparent correlation); look-ahead bias (using data not actually available at the decision date, e.g. restated financials or post-hoc universe selection); overfitting (tuning z-score thresholds or lookback windows to a specific historical sample rather than a robust range).
Bundle Download
Includes SKILL.md and bundled support files where provided. Risk acknowledgement is required.
Install Targets
Syntic App
- 1. Create a dedicated folder for this skill in your local skills library.
- 2. Place SKILL.md into that folder.
- 3. Restart Syntic and invoke this skill on matching tasks.
Syntic Code (CLI)
- 1. Save SKILL.md in your local Syntic Code skills directory.
- 2. Keep related files in the same skill folder.
- 3. Run in a safe environment and validate outputs.
Source
https://github.com/tradermonty/claude-trading-skills/blob/main/skills/pair-trade-screener/SKILL.md
Open Source LinkRelated Skills
canslim-screener
Use when the user wants a CANSLIM stock screen: growth-stock analysis, momentum identification, or ranking...
Screeningdividend-growth-pullback-screener
Use when the user wants dividend growth stocks (12%+ dividend CAGR) pulled back to an RSI oversold level...
Screeningfinviz-screener
Use when the user describes stock-screening criteria (English or Japanese) and wants a FinViz screener URL...
Screeningpead-screener
Use when the user wants PEAD (post-earnings drift) screening: earnings gap-up stocks, weekly red-candle...