backtest-expert
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating…
Statistical arbitrage tool for identifying and analyzing pair trading opportunities. Detects cointegrated stock pairs within sectors, analyzes spread behavior, calculates z-scores, and provides entry/exit recommendations for market-neutral strategies. Use when user requests pair
$ npx -y skills add BaggaT236/AI-Trading-Skills --skill pair-trade-screener --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/pair-trade-screenerContext preview
The summary Claude sees to decide when to auto-load this skill.
Statistical arbitrage tool for identifying and analyzing pair trading opportunities. Detects cointegrated stock pairs within sectors, analyzes spread behavior, calculates z-scores, and provides entry/exit recommendations for market-neutral strategies. Use when user requests pair
name: pair-trade-screener description: Statistical arbitrage tool for identifying and analyzing pair trading opportunities. Detects cointegrated stock pairs within sectors, analyzes spread behavior, calculates z-scores, and provides entry/exit recommendations for market-neutral strategies. Use when user requests pair trading opportunities, statistical arbitrage screening, mean-reversion strategies, or market-neutral portfolio construction. Supports correlation analysis, cointegration testing, and spread backtesting.
This skill identifies and analyzes statistical arbitrage opportunities through pair trading. Pair trading is a market-neutral strategy that profits from the relative price movements of two correlated securities, regardless of overall market direction. The skill uses rigorous statistical methods including correlation analysis and cointegration testing to find robust trading pairs.
**Core Methodology:**
**Key Advantages:**
Use this skill when:
Example user requests:
**Objective:** Establish the pool of stocks to analyze for pair relationships.
**Option A: Sector-Based Screening (Recommended)**
Select a specific sector to screen:
**Option B: Custom Stock List**
User provides specific tickers to analyze:
Example: ["AAPL", "MSFT", "GOOGL", "META", "NVDA"]
**Option C: Industry-Specific**
Narrow focus to specific industry within sector:
**Filtering Criteria:**
**Objective:** Fetch price history for correlation and cointegration analysis.
**Data Requirements:**
**FMP API Endpoint:**
GET /v3/historical-price-full/{symbol}?apikey=YOUR_API_KEY**Data Validation:**
**Script Execution:**
python scripts/fetch_price_data.py --sector Technology --lookback 730
**Objective:** Identify candidate pairs with strong linear relationships.
**Correlation Analysis:**
For each pair of stocks (i, j) in the universe: 1. Calculate Pearson correlation coefficient (ρ) 2. Calculate rolling correlation (90-day window) for stability check 3. Filter pairs with ρ >= 0.70 (strong positive correlation)
**Correlation Interpretation:**
**Beta Calculation:**
For each candidate pair (Stock A, Stock B):
Beta = Covariance(A, B) / Variance(B)
Beta indicates the hedge ratio:
**Correlation Stability Check:**
**Objective:** Statistically validate long-term equilibrium relationship.
**Why Cointegration Matters:**
**Augmented Dickey-Fuller (ADF) Test:**
For each correlated pair: 1. Calculate spread: `Spread = Price_A - (Beta × Price_B)` 2. Run ADF test on spread series 3. Check p-value: p < 0.05 indicates cointegration (reject null hypothesis of unit root) 4. Extract ADF statistic for strength ranking
**Cointegration Interpretation:**
**Half-Life Calculation:**
Estimate mean-reversion speed:
Half-Life = -log(2) / log(mean_reversion_coefficient)
Build disciplined, repeatable trading workflows with a modern TypeScript platform.
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating…
This skill should be used when analyzing market breadth charts, specifically the S&P 500 Breadth Index (200-Day MA based) and the…
Generate Minervini-style breakout trade plans from VCP screener output with worst-case risk calculation, portfolio heat…
Screen US stocks using William O'Neil's CANSLIM growth stock methodology. Use when user requests CANSLIM stock screening, growth…
Validate data quality in market analysis documents and blog articles before publication. Use when checking for price scale…
Use this skill to find high-quality dividend growth stocks (12%+ annual dividend growth, 1.5%+ yield) that are experiencing…