Using Pair Analyzer
Master the Pair Analyzer tool to perform deep statistical analysis on stock pairs using four different models.
🚀 Quick Start Guide
Stock Selection & Setup
Start by selecting two stocks that you want to analyze as a trading pair. Choose stocks with strong historical relationships.
📊 Stock Selection Criteria:
- • Same Sector: Stocks in related industries often move together
- • Market Cap Similarity: Similar-sized companies for balanced analysis
- • Liquidity: Ensure both stocks have sufficient trading volume
- • Data Availability: Both stocks must have historical price data
📅 Date Range Setup:
- • From Date: Start of analysis period (default: 2021-01-01)
- • To Date: End of analysis period (default: today)
- • Recommended Duration: At least 1-2 years for reliable statistics
- • Market Cycles: Include both bull and bear market periods
Choosing Your Statistical Model
Select from four different statistical models, each with unique strengths for different market conditions and trading strategies.
📈 Ratio Model:
- • Best For: Traditional pairs trading with stable relationships
- • Calculation: Simple price ratio (Stock A / Stock B)
- • Key Parameter: Lookback window for ratio statistics
- • Advantage: Simple, intuitive, works well in stable markets
📊 OLS Regression Model:
- • Best For: Pairs with changing correlation patterns
- • Calculation: Linear regression of Stock A on Stock B
- • Key Parameters: Lookback window, rolling regression
- • Advantage: Adapts to changing market relationships
🔄 Kalman Filter Model:
- • Best For: Real-time analysis and adaptive trading
- • Calculation: State-space model with dynamic updates
- • Key Parameters: Process noise, measurement noise
- • Advantage: Continuously adapts to new market data
📏 Euclidean Distance Model:
- • Best For: Pairs with complex, non-linear relationships
- • Calculation: Geometric distance between price vectors
- • Key Parameters: Distance threshold, normalization
- • Advantage: Captures non-linear price movements
Parameter Configuration
Configure model-specific parameters to optimize your analysis for your trading strategy and market conditions.
⚙️ Common Parameters:
- • Z-Score Lookback: Days for calculating mean and standard deviation
- • Entry Threshold: Z-score level to trigger trade entry (default: 2.5)
- • Exit Threshold: Z-score level to close positions (default: 1.5)
- • Plot Type: Choose between ratio, spread, or Z-score charts
🎯 Model-Specific Settings:
- • Ratio Model: Adjust lookback window (20-120 days)
- • OLS Model: Set rolling regression window size
- • Kalman Model: Fine-tune noise parameters
- • Euclidean Model: Set distance thresholds
Running Your Analysis
Execute your analysis and wait for the comprehensive results that will help you make informed trading decisions.
▶️ Execution Steps:
- 1. Verify all parameters are set correctly
- 2. Ensure both stocks have data for the selected date range
- 3. Click the "Run Analysis" button
- 4. Wait for the analysis to complete
- 5. Review the generated results and charts
📊 What Happens During Analysis:
- • Data Processing: Historical prices are aligned and normalized
- • Statistical Calculation: Model-specific computations performed
- • Z-Score Generation: Current deviation from historical mean
- • Chart Generation: Visual representations created
Interpreting Trading Signals
Understand the analysis results and use them to identify profitable trading opportunities with proper risk management.
📈 Entry Signals:
- • Long Entry: When Z-score < -2.5 (pair is oversold)
- • Short Entry: When Z-score > 2.5 (pair is overbought)
- • Confirmation: Look for correlation > 0.7 and stable spread
- • Signal Strength: Higher absolute Z-score = stronger signal
📋 Key Metrics to Review:
- • Correlation: Strength of relationship between stocks
- • Half-Life: Speed of mean reversion (days)
- • ADF Test: Statistical significance of mean reversion
- • Current Z-Score: How extreme the current deviation is
💡 Best Practices & Tips
🎯 Model Selection:
- • Use Ratio model for stable market conditions
- • Choose OLS for changing correlations
- • Apply Kalman for real-time trading
- • Try Euclidean for complex relationships
⚡ Parameter Optimization:
- • Start with default parameters
- • Adjust based on market volatility
- • Test different lookback periods
- • Document successful configurations
🔄 Continuous Improvement:
- • Regularly re-run analyses
- • Compare different models
- • Track signal success rates
- • Integrate with backtesting
🎯 What's Next?
Now that you understand how to use the Pair Analyzer, start analyzing stock pairs and integrate the results into your trading strategy.