Technical Analysis
Compute technical indicators using pandas-ta. Supports multi-symbol analysis and earnings data.
Instructions
Note: If uv is not installed or pyproject.toml is not found, replace uv run python with python in all commands below.
uv run python scripts/technicals.py SYMBOL [--period PERIOD] [--indicators INDICATORS] [--earnings]
Arguments
SYMBOL - Ticker symbol or comma-separated list (e.g., AAPL or AAPL,MSFT,GOOGL)
--period - Historical period: 1mo, 3mo, 6mo, 1y (default: 3mo)
--indicators - Comma-separated list: rsi,macd,bb,sma,ema,atr,adx (default: all)
--earnings - Include earnings data (upcoming date + history)
Output
Single symbol returns:
price - Current price and recent change
indicators - Computed values for each indicator
risk_metrics - Volatility (annualized %) and Sharpe ratio
signals - Buy/sell signals based on indicator levels
earnings - Upcoming date and EPS history (if --earnings)
Multiple symbols returns:
results - Array of individual symbol results
Interpretation
- RSI > 70 = overbought, RSI < 30 = oversold
- MACD crossover = momentum shift
- Price near Bollinger Band = potential reversal
- Golden cross (SMA20 > SMA50) = bullish
- ADX > 25 = strong trend
- Sharpe ratio > 1 = good risk-adjusted returns, > 2 = excellent
- Volatility (annualized) = standard deviation of returns scaled to annual basis
Examples
# Single symbol with all indicators
uv run python scripts/technicals.py AAPL
# Multiple symbols
uv run python scripts/technicals.py AAPL,MSFT,GOOGL
# With earnings data
uv run python scripts/technicals.py NVDA --earnings
# Specific indicators only
uv run python scripts/technicals.py TSLA --indicators rsi,macd
Correlation Analysis
Compute price correlation matrix between multiple symbols for diversification analysis.
Instructions
uv run python scripts/correlation.py SYMBOLS [--period PERIOD]
Arguments
SYMBOLS - Comma-separated ticker symbols (minimum 2)
--period - Historical period: 1mo, 3mo, 6mo, 1y (default: 3mo)
Output
symbols - List of symbols analyzed
period - Time period used
correlation_matrix - Nested dict with correlation values between all pairs
Interpretation
- Correlation near 1.0 = highly correlated (move together)
- Correlation near -1.0 = negatively correlated (move opposite)
- Correlation near 0 = uncorrelated (independent movement)
- For diversification, prefer low/negative correlations
Examples
# Portfolio correlation
uv run python scripts/correlation.py AAPL,MSFT,GOOGL,AMZN
# Sector comparison
uv run python scripts/correlation.py XLF,XLK,XLE,XLV --period 6mo
# Check hedge effectiveness
uv run python scripts/correlation.py SPY,GLD,TLT
Dependencies
numpy
pandas
pandas-ta
yfinance
1---2name: technical-analysis3description: Compute technical indicators like RSI, MACD, Bollinger Bands, SMA, EMA for a stock. Use when user asks about technical analysis, indicators, RSI, MACD, moving averages, overbought/oversold, or chart analysis.4---56# Technical Analysis78Compute technical indicators using pandas-ta. Supports multi-symbol analysis and earnings data.910## Instructions1112> **Note:** If `uv` is not installed or `pyproject.toml` is not found, replace `uv run python` with `python` in all commands below.1314```bash15uv run python scripts/technicals.py SYMBOL [--period PERIOD] [--indicators INDICATORS] [--earnings]16```1718## Arguments1920- `SYMBOL` - Ticker symbol or comma-separated list (e.g., `AAPL` or `AAPL,MSFT,GOOGL`)21- `--period` - Historical period: 1mo, 3mo, 6mo, 1y (default: 3mo)22- `--indicators` - Comma-separated list: rsi,macd,bb,sma,ema,atr,adx (default: all)23- `--earnings` - Include earnings data (upcoming date + history)2425## Output2627Single symbol returns:28- `price` - Current price and recent change29- `indicators` - Computed values for each indicator30- `risk_metrics` - Volatility (annualized %) and Sharpe ratio31- `signals` - Buy/sell signals based on indicator levels32- `earnings` - Upcoming date and EPS history (if `--earnings`)3334Multiple symbols returns:35- `results` - Array of individual symbol results3637## Interpretation3839- RSI > 70 = overbought, RSI < 30 = oversold40- MACD crossover = momentum shift41- Price near Bollinger Band = potential reversal42- Golden cross (SMA20 > SMA50) = bullish43- ADX > 25 = strong trend44- Sharpe ratio > 1 = good risk-adjusted returns, > 2 = excellent45- Volatility (annualized) = standard deviation of returns scaled to annual basis4647## Examples4849```bash50# Single symbol with all indicators51uv run python scripts/technicals.py AAPL5253# Multiple symbols54uv run python scripts/technicals.py AAPL,MSFT,GOOGL5556# With earnings data57uv run python scripts/technicals.py NVDA --earnings5859# Specific indicators only60uv run python scripts/technicals.py TSLA --indicators rsi,macd61```6263---6465# Correlation Analysis6667Compute price correlation matrix between multiple symbols for diversification analysis.6869## Instructions7071```bash72uv run python scripts/correlation.py SYMBOLS [--period PERIOD]73```7475## Arguments7677- `SYMBOLS` - Comma-separated ticker symbols (minimum 2)78- `--period` - Historical period: 1mo, 3mo, 6mo, 1y (default: 3mo)7980## Output8182- `symbols` - List of symbols analyzed83- `period` - Time period used84- `correlation_matrix` - Nested dict with correlation values between all pairs8586## Interpretation8788- Correlation near 1.0 = highly correlated (move together)89- Correlation near -1.0 = negatively correlated (move opposite)90- Correlation near 0 = uncorrelated (independent movement)91- For diversification, prefer low/negative correlations9293## Examples9495```bash96# Portfolio correlation97uv run python scripts/correlation.py AAPL,MSFT,GOOGL,AMZN9899# Sector comparison100uv run python scripts/correlation.py XLF,XLK,XLE,XLV --period 6mo101102# Check hedge effectiveness103uv run python scripts/correlation.py SPY,GLD,TLT104```105106## Dependencies107108- `numpy`109- `pandas`110- `pandas-ta`111- `yfinance`