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.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionpair-trade-screenerExecute the skills CLI command in your project's root directory to begin installation:
Fetches pair-trade-screener from tradermonty/claude-trading-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate pair-trade-screener. Access via /pair-trade-screener in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
1
total installs
1
this week
667
GitHub stars
0
upvotes
Run in your terminal
1
installs
1
this week
667
stars
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:
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:
Spread = Price_A - (Beta × Price_B)Cointegration Interpretation:
Half-Life Calculation:
Estimate mean-reversion speed:
Half-Life = -log(2) / log(mean_reversion_coefficient)
Python Implementation:
from statsmodels.tsa.stattools import adfuller
# Calculate spread
spread = price_a - (beta * price_b)
# ADF test
result = adfuller(spread)
adf_stat = result[0]
p_value = result[1]
# Interpret
is_cointegrated = p_value < 0.05
Objective: Quantify current spread deviation from equilibrium.
Spread Calculation:
Two common methods:
Method 1: Price Difference (Additive)
Spread = Price_A - (Beta × Price_B)
Best for: Stocks with similar price levels
Method 2: Price Ratio (Multiplicative)
Spread = Price_A / Price_B
Best for: Stocks with different price levels, easier interpretation
Z-Score Calculation:
Measures how many standard deviations spread is from its mean:
Z-Score = (Current_Spread - Mean_Spread) / Std_Dev_Spread
Z-Score Interpretation:
Historical Spread Analysis:
Objective: Provide actionable trading signals with clear rules.
Entry Conditions:
Conservative Approach (Z ≥ ±2.0):
LONG Signal:
- Z-score < -2.0 (spread 2+ std devs below mean)
- Spread is mean-reverting (cointegration p < 0.05)
- Half-life < 60 days
→ Action: Buy Stock A, Short Stock B (hedge ratio = beta)
SHORT Signal:
- Z-score > +2.0 (spread 2+ std devs above mean)
- Spread is mean-reverting (cointegration p < 0.05)
- Half-life < 60 days
→ Action: Short Stock A, Buy Stock B (hedge ratio = beta)
Aggressive Approach (Z ≥ ±1.5):
Exit Conditions:
Primary Exit: Mean Reversion (Z = 0)
Exit when spread returns to mean (z-score crosses 0)
→ Close both legs simultaneously
Secondary Exit: Partial Profit Take
Exit 50% when z-score reaches ±1.0
Exit remaining 50% at z-score = 0
Stop Loss:
Exit if z-score extends beyond ±3.0 (extreme divergence)
Risk: Possible structural break in relationship
Time-Based Exit:
Exit after 90 days if no mean-reversion
Prevents holding broken pairs indefinitely
Objective: Determine dollar amounts for market-neutral exposure.
Market Neutral Sizing:
For a pair (Stock A, Stock B) with beta = β:
Equal Dollar Exposure:
If portfolio size = $10,000 allocated to this pair:
- Long $5,000 of Stock A
- Short $5,000 × β of Stock B
Example (β = 1.2):
- Long $5,000 Stock A
- Short $6,000 Stock B
→ Market neutral, beta = 0
Position Sizing Considerations:
Risk Metrics:
Objective: Create structured markdown report with findings and recommendations.
Report Sections:
Executive Summary
Cointegrated Pairs Table
Detailed Analysis (Top 10 Pairs)
Spread Charts (Text-Based)
Risk Warnings
File Naming Convention:
pair_trade_analysis_[SECTOR]_[YYYY-MM-DD].md
Example: pair_trade_analysis_Technology_2025-11-08.md
Minimum Requirements for Valid Pair:
Red Flags (Exclude Pair):
Transaction Costs:
Short Selling:
Execution:
Purpose: Screen for cointegrated pairs within a sector or custom list.
Usage:
# Sector-based screening
python scripts/find_pairs.py --sector Technology --min-correlation 0.70
# Custom stock list
python scripts/find_pairs.py --symbols AAPL,MSFT,GOOGL,META --min-correlation 0.75
# Full options
python scripts/find_pairs.py \
--sector Financials \
--min-correlation 0.70 \
--min-market-cap 2000000000 \
--lookback-days 730 \
--output pairs_analysis.json
Parameters:
--sector: Sector name (Technology, Financials, etc.)--symbols: Comma-separated list of tickers (alternative to sector)--min-correlation: Minimum correlation threshold (default: 0.70)--min-market-cap: Minimum market cap filter (default: $2B)--lookback-days: Historical data period (default: 730 days)--output: Output JSON file (default: stdout)--api-key: FMP API key (or set FMP_API_KEY env var)Output:
[
{
"pair": "AAPL/MSFT",
"stock_a": "AAPL",
"stock_b": "MSFT",
"correlation": 0.87,
"beta": 1.15,
"cointegration_pvalue": 0.012,
"adf_statistic": -3.45,
"half_life_days": 42,
"current_zscore": -2.3,
"signal": "LONG",
"strength": "Strong"
}
]
Purpose: Analyze a specific pair's spread behavior and generate trading signals.
Usage:
# Analyze specific pair
python scripts/analyze_spread.py --stock-a AAPL --stock-b MSFT
# Custom lookback period
python scripts/analyze_spread.py \
--stock-a JPM \
--stock-b BAC \
--lookback-days 365 \
--entry-zscore 2.0 \
--exit-zscore 0.5
Parameters:
--stock-a: First stock ticker--stock-b: Second stock ticker--lookback-days: Analysis period (default: 365)--entry-zscore: Z-score threshold for entry (default: 2.0)--exit-zscore: Z-score threshold for exit (default: 0.0)--api-key: FMP API keyPrerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
tradermonty/claude-trading-skills
davila7/claude-code-templates
intellectronica/agent-skills
am-will/codex-skills
sickn33/antigravity-awesome-skills
myzy-ai/dokie-ai-ppt
Registry listing for pair-trade-screener matched our evaluation — installs cleanly and behaves as described in the markdown.
Keeps context tight: pair-trade-screener is the kind of skill you can hand to a new teammate without a long onboarding doc.
Useful defaults in pair-trade-screener — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
I recommend pair-trade-screener for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
pair-trade-screener is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Registry listing for pair-trade-screener matched our evaluation — installs cleanly and behaves as described in the markdown.
pair-trade-screener fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
Solid pick for teams standardizing on skills: pair-trade-screener is focused, and the summary matches what you get after install.
We added pair-trade-screener from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
pair-trade-screener has been reliable in day-to-day use. Documentation quality is above average for community skills.
showing 1-10 of 42