Skip to main content
skill CX Codex

technical-analysis · staskh — Claude Code skill: what it does, how to install

Runs technical indicator calculations and stock correlation matrices directly via Python scripts. Useful for momentum checks and portfolio diversification.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add staskh/trading_skills --skill technical-analysis -a claude-code
Open on GitHub

What technical-analysis does

This skill executes scripts/technicals.py and scripts/correlation.py to evaluate equities. It calculates RSI, MACD, Bollinger Bands, SMA, EMA, ATR, and ADX using pandas-ta. Output includes risk metrics like annualized volatility and the Sharpe ratio. The script generates buy and sell signals based on indicator thresholds.

It tracks MACD signal line crossovers and EMA9/EMA21 crossovers, returning the exact number of trading bars since each event. For portfolio diversification, scripts/correlation.py computes a price correlation matrix across multiple tickers over periods from 1mo to 1y. Every timestamp in the JSON output strictly uses the America/New_York timezone.

Execution requires pandas-ta, yfinance, pandas, and numpy. Without these packages, the scripts fail immediately. If uv is unavailable on your system, run commands directly with standard python.

What it helps with

  • calculate RSI, MACD, ADX, and Bollinger Bands for stock tickers
  • identify recent EMA9/21 and MACD momentum crossovers
  • build price correlation matrices to evaluate portfolio diversification
  • pull upcoming earnings dates and EPS performance history
  • measure annualized volatility and Sharpe ratio for risk evaluation

Example prompts for the agent

  • Calculate RSI and MACD for AAPL over the last 3 months
  • Compute a price correlation matrix for SPY, GLD, and TLT
  • Check technical indicators and earnings data for NVDA using technicals.py

How to install technical-analysis

1Skills CLI (Vercel)

npx skills add staskh/trading_skills --skill technical-analysis -a claude-code

2Manually: put the files in place

~/.claude/skills/technical-analysis/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/technical-analysis/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about technical-analysis

How to install technical-analysis in Claude Code?

Run npx skills add staskh/trading_skills --skill technical-analysis -a claude-code. You can also place the skill file directly into ~/.claude/skills/technical-analysis/SKILL.md.

What technical indicators can this skill compute?

It computes RSI, MACD, Bollinger Bands, SMA, EMA, ATR, and ADX. It also tracks moving average crossovers, annualized volatility, and Sharpe ratios.

What Python dependencies are required?

The scripts require numpy, pandas, pandas-ta, and yfinance. You can run them through uv run python or standard python.

Source text

SKILL.md · MIT
---
name: technical-analysis
description: 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.
dependencies: ["trading-skills"]
---

# 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.

```bash
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

```bash
# 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

```bash
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

```bash
# 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.

© staskh · MIT · staskh/trading_skills

Similar skills

Everything for Finance and business →

technical-analysis by other authors comes first.

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor