A comprehensive tool for analyzing technical indicators across multiple timeframes. The tool calculates statistical distributions, generates visualizations, and provides detailed analysis for various technical indicators.
This tool helps traders and analysts understand:
- How current indicator values compare to their historical distributions
- When indicators are showing extreme readings
- The volatility and trend characteristics of different timeframes
- Relationships between different components of technical indicators
- Spread and ratio analysis between two securities
-
RSI (Relative Strength Index)
- Momentum oscillator (0-100 scale)
- Traditional overbought/oversold levels (70/30)
- Includes price returns correlation analysis
-
MACD (Moving Average Convergence Divergence)
- Trend and momentum indicator
- Components: MACD line, Signal line, MACD histogram
- Shows relationship between components via scatter plots
-
Bollinger Bands
- Price and volatility indicator
- Components: Upper band, Middle band (20 SMA), Lower band
- Bollinger Band Width (BBW) for volatility analysis
- Shows price distribution relative to bands
-
Stochastic Oscillator
- Momentum indicator (0-100 scale)
- Components: %K (fast) and %D (slow) lines
- Shows relationship between %K and %D via scatter plots
-
Moving Averages
- Multiple periods: 20, 50, 100, 200
- Both Simple (SMA) and Exponential (EMA)
- Helps identify different trend timeframes
The tool can analyze the relationship between two securities by:
- Calculating the ratio between their prices
- Identifying overlapping data periods
- Applying all technical indicators to the ratio
- Generating comprehensive visualizations of the relationship
- Providing statistical analysis of the spread
Common use cases:
- GLD/SPY: Gold vs S&P 500 relationship
- TLT/SPY: Bonds vs S&P 500 relationship
- VIX/SPY: Volatility vs S&P 500 relationship
- Any pair of securities for relative strength analysis
- 1 Hour (1H): Short-term analysis
- 1 Day (1D): Medium-term analysis
- 1 Week (1W): Long-term analysis
- 1 Month (1M): Very long-term analysis
For each indicator and timeframe, the tool generates:
-
Statistical Distribution Plots
- Box plot showing quartiles and outliers
- Probability density curve
- Standard deviation markers
- Current value indicator
-
Distribution Analysis
- Histogram with kernel density estimation
- Box plot with current value marker
- Shows data distribution shape and outliers
-
Percentile Distribution
- Key percentile levels (5%, 25%, 50%, 75%, 95%)
- Current value marker
- Helps identify extreme readings
-
Time Series Analysis
- Price/indicator movement over time
- Moving average overlay
- Quartile reference lines
- Current value marker
-
Scatter Plot Relationships (where applicable)
- RSI vs Price Returns
- MACD vs Signal Line
- Stochastic %K vs %D
- Price vs Bollinger Bands
-
Comprehensive Dashboard
- Price/Ratio plot
- All indicators in one view
- Current percentile summary
- Multiple timeframe analysis
For each indicator, the tool calculates:
- Current value
- Current percentile ranking
- Key statistical levels:
- Bottom 5th percentile
- 1st quartile (25th percentile)
- Median (50th percentile)
- 3rd quartile (75th percentile)
- Top 5th percentile
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
Run the script with a ticker symbol:
python main.py AAPLRun the script with two ticker symbols:
python main.py TICKER1 TICKER2Example:
python main.py GLD SPYThe tool creates an organized directory structure:
TICKER/
├── RSI/
│ ├── explanation/
│ │ └── explanation.md
│ └── data/
│ ├── 1H/
│ ├── 1D/
│ ├── 1W/
│ └── 1M/
├── MACD/
├── BB/
├── Stochastic/
└── MA/
For spread analysis, the structure is:
TICKER1_TICKER2_spread/
├── 1H/
│ ├── comprehensive_dashboard_1H.png
│ ├── spread_ratio.csv
│ └── [indicator folders]
├── 1D/
├── 1W/
└── 1M/
Each indicator's data directory contains:
- Statistical analysis files (CSV)
- Distribution plots
- Time series analysis
- Scatter plots (where applicable)
- Percentile distribution plots
Summary files at the root level:
TICKER_detailed_statistics.csv: Comprehensive statistics in long formatTICKER_summary_statistics.csv: Summary statistics in pivot table format
Processing time varies by ticker and data availability:
- 1H timeframe: ~25-30 seconds
- 1D timeframe: ~35-40 seconds
- 1W timeframe: ~35-40 seconds
- 1M timeframe: ~40-50 seconds
- Total analysis time: ~2-3 minutes
Each indicator folder contains an explanation.md file that provides:
- Mathematical formulas
- Interpretation guidelines
- Key signals and patterns
- Typical usage scenarios
- Limitations and considerations
The statistical distribution plots show:
- Normal distribution curve
- Standard deviation bands
- Current value position
- Box plot with quartiles
- Outlier identification
Time series plots display:
- Historical indicator values
- Moving average trend
- Support/resistance levels
- Current value context
Relationship plots reveal:
- Correlation between components
- Clustering patterns
- Extreme value identification
- Signal confirmation points
The comprehensive dashboard shows:
- Price/ratio relationship over time
- All technical indicators applied to the ratio
- Current percentile rankings
- Multiple timeframe context
- Monthly timeframe may have limited data for longer-period indicators (e.g., 200 MA)
- Statistical significance improves with more historical data
- Consider multiple timeframes for comprehensive analysis
- Use in conjunction with other analysis tools for best results
- For spread analysis, ensure both securities have sufficient overlapping data