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
Crossovers
indicators.macd.crossover - Most recent MACD line/signal crossover, or null:
direction - "up" (MACD crossed above signal = bullish) or "down" (crossed below = bearish)
days_ago - Trading bars since the crossover (0 = happened on the most recent bar)
indicators.ema.crossover - Most recent EMA9/EMA21 crossover (same shape; null if none).
indicators.ema also reports ema9 and ema21 alongside ema12/ema26.
Interpretation
- RSI > 70 = overbought, RSI < 30 = oversold
- MACD crossover = momentum shift;
crossover.days_ago of 0-5 = fresh signal
- EMA9/21 crossover confirms short-term momentum; MACD typically leads, EMA confirms
- 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
Timezone
All timestamps and time-based calculations must use the America/New_York timezone. All JSON output must include generated_at (NY time string) and data_delay fields.
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.4dependencies: ["trading-skills"]5metadata:6 source: https://skillmd.com/skills/staskh/technical-analysis7---89# Technical Analysis1011Compute technical indicators using pandas-ta. Supports multi-symbol analysis and earnings data.1213## Instructions1415> **Note:** If `uv` is not installed or `pyproject.toml` is not found, replace `uv run python` with `python` in all commands below.1617```bash18uv run python scripts/technicals.py SYMBOL [--period PERIOD] [--indicators INDICATORS] [--earnings]19```2021## Arguments2223- `SYMBOL` - Ticker symbol or comma-separated list (e.g., `AAPL` or `AAPL,MSFT,GOOGL`)24- `--period` - Historical period: 1mo, 3mo, 6mo, 1y (default: 3mo)25- `--indicators` - Comma-separated list: rsi,macd,bb,sma,ema,atr,adx (default: all)26- `--earnings` - Include earnings data (upcoming date + history)2728## Output2930Single symbol returns:31- `price` - Current price and recent change32- `indicators` - Computed values for each indicator33- `risk_metrics` - Volatility (annualized %) and Sharpe ratio34- `signals` - Buy/sell signals based on indicator levels35- `earnings` - Upcoming date and EPS history (if `--earnings`)3637Multiple symbols returns:38- `results` - Array of individual symbol results3940### Crossovers4142- `indicators.macd.crossover` - Most recent MACD line/signal crossover, or `null`:43 - `direction` - `"up"` (MACD crossed above signal = bullish) or `"down"` (crossed below = bearish)44 - `days_ago` - Trading bars since the crossover (0 = happened on the most recent bar)45- `indicators.ema.crossover` - Most recent EMA9/EMA21 crossover (same shape; `null` if none).46 `indicators.ema` also reports `ema9` and `ema21` alongside `ema12`/`ema26`.4748## Interpretation4950- RSI > 70 = overbought, RSI < 30 = oversold51- MACD crossover = momentum shift; `crossover.days_ago` of 0-5 = fresh signal52- EMA9/21 crossover confirms short-term momentum; MACD typically leads, EMA confirms53- Price near Bollinger Band = potential reversal54- Golden cross (SMA20 > SMA50) = bullish55- ADX > 25 = strong trend56- Sharpe ratio > 1 = good risk-adjusted returns, > 2 = excellent57- Volatility (annualized) = standard deviation of returns scaled to annual basis5859## Examples6061```bash62# Single symbol with all indicators63uv run python scripts/technicals.py AAPL6465# Multiple symbols66uv run python scripts/technicals.py AAPL,MSFT,GOOGL6768# With earnings data69uv run python scripts/technicals.py NVDA --earnings7071# Specific indicators only72uv run python scripts/technicals.py TSLA --indicators rsi,macd73```7475---7677# Correlation Analysis7879Compute price correlation matrix between multiple symbols for diversification analysis.8081## Instructions8283```bash84uv run python scripts/correlation.py SYMBOLS [--period PERIOD]85```8687## Arguments8889- `SYMBOLS` - Comma-separated ticker symbols (minimum 2)90- `--period` - Historical period: 1mo, 3mo, 6mo, 1y (default: 3mo)9192## Output9394- `symbols` - List of symbols analyzed95- `period` - Time period used96- `correlation_matrix` - Nested dict with correlation values between all pairs9798## Interpretation99100- Correlation near 1.0 = highly correlated (move together)101- Correlation near -1.0 = negatively correlated (move opposite)102- Correlation near 0 = uncorrelated (independent movement)103- For diversification, prefer low/negative correlations104105## Examples106107```bash108# Portfolio correlation109uv run python scripts/correlation.py AAPL,MSFT,GOOGL,AMZN110111# Sector comparison112uv run python scripts/correlation.py XLF,XLK,XLE,XLV --period 6mo113114# Check hedge effectiveness115uv run python scripts/correlation.py SPY,GLD,TLT116```117118## Dependencies119120- `numpy`121- `pandas`122- `pandas-ta`123- `yfinance`124125126## Timezone127128All timestamps and time-based calculations must use the `America/New_York` timezone. All JSON output must include `generated_at` (NY time string) and `data_delay` fields.