Skip to main content
skill CX Codex

pandas-ta — Claude Code skill: what it does, how to install

Equips coding agents with patterns for 130+ technical analysis indicators using pandas-ta on crypto market data.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add agiprolabs/claude-trading-skills --skill pandas-ta -a claude-code
Open on GitHub

What pandas-ta does

The skill instructs the agent how to use the pandas-ta library via the df.ta namespace. It provides ready code patterns for trend, momentum, volatility, and volume indicators such as RSI, MACD, SuperTrend, and Bollinger Bands. The agent also learns to batch indicator calculations using the ta.Strategy class.

Executing the code requires Python with pandas-ta, pandas, and httpx. The input OHLCV DataFrame demands lowercase column names: open, high, low, close, and volume. If column headers use uppercase like Close, calculations fail immediately. Time-dependent indicators like VWAP require a DatetimeIndex.

The guidance directly handles continuous 24/7 crypto markets. Because crypto swings hard, the skill suggests widening Bollinger Bands standard deviation to 2.5–3x and increasing the SuperTrend multiplier to 3–4x. On low-cap tokens with thin order books, volume indicators like OBV or CMF are unreliable; the skill flags this risk.

What it helps with

  • calculate technical indicators on OHLCV market DataFrames
  • run multi-indicator setups using ta.Strategy
  • clean cryptocurrency candlestick data with forward-fill and dropna
  • tune indicator parameters for crypto volatility

Example prompts for the agent

  • Calculate RSI(14) and Bollinger Bands for this hourly candle DataFrame using pandas-ta
  • Create a ta.Strategy with EMA crossover and SuperTrend for crypto swing trading
  • Format this raw OHLCV data with DatetimeIndex and compute VWAP

How to install pandas-ta

1Skills CLI (Vercel)

npx skills add agiprolabs/claude-trading-skills --skill pandas-ta -a claude-code

2Manually: put the files in place

~/.claude/skills/pandas-ta/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/pandas-ta/

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

Questions about pandas-ta

How to install pandas-ta in Claude Code?

Install the skill by running npx skills add agiprolabs/claude-trading-skills --skill pandas-ta -a claude-code. Install the required Python dependencies with uv pip install pandas-ta pandas httpx.

What does the pandas-ta skill do?

It instructs your coding agent how to use pandas-ta to calculate over 130 technical indicators. It includes patterns for single indicators, custom strategies, and crypto-specific volatility adjustments.

What DataFrame format does pandas-ta require?

Column names must be strictly lowercase: open, high, low, close, and volume. Intraday indicators like VWAP also require the DataFrame index to be a DatetimeIndex.

Source text

SKILL.md · MIT
---
name: pandas-ta
description: Technical analysis with 130+ indicators using pandas-ta for crypto market data
---

# pandas-ta — Technical Analysis for Crypto Markets

pandas-ta is a Python library that extends pandas DataFrames with 130+ technical analysis indicators accessible via `df.ta`. It covers trend, momentum, volatility, volume, and overlap indicator categories — all callable with a single method on any OHLCV DataFrame.

## Installation

```bash
uv pip install pandas-ta pandas httpx
```

## Quick Start

```python
import pandas as pd
import pandas_ta as ta

# Assume df is a DataFrame with columns: open, high, low, close, volume
# All lowercase column names required

# Single indicator
df["rsi"] = df.ta.rsi(length=14)
df["atr"] = df.ta.atr(length=14)

# Multiple indicators via strategy
df.ta.strategy(ta.Strategy(
    name="Quick Check",
    ta=[
        {"kind": "rsi", "length": 14},
        {"kind": "macd", "fast": 12, "slow": 26, "signal": 9},
        {"kind": "bbands", "length": 20, "std": 2.0},
    ]
))
```

## OHLCV DataFrame Format

pandas-ta expects a DataFrame with lowercase column names:

```python
import pandas as pd

df = pd.DataFrame({
    "open": [...],
    "high": [...],
    "low": [...],
    "close": [...],
    "volume": [...]
}, index=pd.DatetimeIndex([...]))
```

**Important**: Set the index to a `DatetimeIndex` for time-aware indicators like VWAP. Column names must be lowercase (`close`, not `Close`).

### Handling Missing Data

```python
# Drop rows with NaN in OHLCV columns
df = df.dropna(subset=["open", "high", "low", "close", "volume"])

# Forward-fill small gaps (1-2 bars max)
df = df.ffill(limit=2)

# Verify no zero-volume bars for volume indicators
df = df[df["volume"] > 0]
```

## Core Indicator Categories

### Trend Indicators

Identify market direction and trend strength.

| Indicator | Call | Key Signal |
|-----------|------|------------|
| SMA | `df.ta.sma(length=20)` | Price above = bullish |
| EMA | `df.ta.ema(length=20)` | Faster than SMA, less lag |
| SuperTrend | `df.ta.supertrend(length=10, multiplier=3)` | Direction column: 1=bull, -1=bear |
| Ichimoku | `df.ta.ichimoku()` | Returns tuple of (span, lines) DataFrames |
| VWMA | `df.ta.vwma(length=20)` | Volume-weighted price trend |
| HMA | `df.ta.hma(length=20)` | Minimal lag, smooth trend |
| ADX | `df.ta.adx(length=14)` | >25 = trending, <20 = ranging |

### Momentum Indicators

Measure speed and magnitude of price changes.

| Indicator | Call | Key Signal |
|-----------|------|------------|
| RSI | `df.ta.rsi(length=14)` | >70 overbought, <30 oversold |
| MACD | `df.ta.macd(fast=12, slow=26, signal=9)` | Histogram crossover = entry |
| Stochastic | `df.ta.stoch(k=14, d=3, smooth_k=3)` | >80 overbought, <20 oversold |
| CCI | `df.ta.cci(length=20)` | >100 overbought, <-100 oversold |
| Williams %R | `df.ta.willr(length=14)` | >-20 overbought, <-80 oversold |
| ROC | `df.ta.roc(length=10)` | Positive = upward momentum |
| MFI | `df.ta.mfi(length=14)` | Money flow version of RSI |

### Volatility Indicators

Measure price dispersion and expected range.

| Indicator | Call | Key Signal |
|-----------|------|------------|
| Bollinger Bands | `df.ta.bbands(length=20, std=2)` | Squeeze = breakout pending |
| ATR | `df.ta.atr(length=14)` | Position sizing, stop placement |
| Keltner Channels | `df.ta.kc(length=20, scalar=1.5)` | BB inside KC = squeeze |
| Donchian Channels | `df.ta.donchian(lower_length=20, upper_length=20)` | Breakout detection |

### Volume Indicators

Confirm price moves with volume analysis.

| Indicator | Call | Key Signal |
|-----------|------|------------|
| OBV | `df.ta.obv()` | Divergence from price = reversal |
| VWAP | `df.ta.vwap()` | Intraday fair value (needs DatetimeIndex) |
| CMF | `df.ta.cmf(length=20)` | >0 accumulation, <0 distribution |
| AD | `df.ta.ad()` | Accumulation/Distribution line |

## Strategy Class

Run multiple indicators in a single call using `ta.Strategy`:

```python
import pandas_ta as ta

# Built-in "All" strategy runs every indicator
df.ta.strategy(ta.AllStrategy)

# Custom strategy
my_strategy = ta.Strategy(
    name="Crypto Scalp",
    description="Fast indicators for crypto scalping",
    ta=[
        {"kind": "ema", "length": 9},
        {"kind": "ema", "length": 21},
        {"kind": "rsi", "length": 7},
        {"kind": "stoch", "k": 5, "d": 3, "smooth_k": 3},
        {"kind": "atr", "length": 7},
        {"kind": "bbands", "length": 10, "std": 2.0},
        {"kind": "obv"},
    ]
)
df.ta.strategy(my_strategy)
```

### Named Strategy Patterns

```python
# Trend following
trend_strategy = ta.Strategy(
    name="Trend",
    ta=[
        {"kind": "ema", "length": 20},
        {"kind": "ema", "length": 50},
        {"kind": "adx", "length": 14},
        {"kind": "supertrend", "length": 10, "multiplier": 3},
        {"kind": "atr", "length": 14},
    ]
)

# Mean reversion
reversion_strategy = ta.Strategy(
    name="Mean Reversion",
    ta=[
        {"kind": "rsi", "length": 14},
        {"kind": "bbands", "length": 20, "std": 2.0},
        {"kind": "stoch", "k": 14, "d": 3, "smooth_k": 3},
        {"kind": "cci", "length": 20},
    ]
)

# Momentum
momentum_strategy = ta.Strategy(
    name="Momentum",
    ta=[
        {"kind": "macd", "fast": 12, "slow": 26, "signal": 9},
        {"kind": "rsi", "length": 14},
        {"kind": "obv"},
        {"kind": "roc", "length": 10},
        {"kind": "mfi", "length": 14},
    ]
)
```

## Crypto-Specific Considerations

### 24/7 Markets
- No session gaps — indicators that rely on open/close of sessions behave differently
- VWAP resets at midnight UTC by default; consider anchored VWAP for custom periods
- Weekend data is continuous — no Monday gap effects

### High Volatility Adjustments
- **Bollinger Bands**: Use 2.5-3x standard deviation instead of the default 2x
- **RSI periods**: Shorter periods (7-10) capture faster crypto cycles
- **ATR**: Use for dynamic stop-losses; crypto ATR is typically 2-5x equity ATR
- **SuperTrend multiplier**: 3-4x for crypto vs 2-3x for equities

### Low-Cap Token Considerations
- Volume indicators (OBV, CMF, MFI) are unreliable with thin order books
- Prefer price-based indicators (RSI, BBands, SuperTrend) for low-liquidity tokens
- ATR-based position sizing is critical — wide spreads amplify losses
- Wash trading inflates volume; cross-reference with on-chain data

### Timeframe Selection
| Timeframe | Use Case | Recommended Indicators |
|-----------|----------|----------------------|
| 1m-5m | Scalping, PumpFun | RSI(5-7), EMA(5,13), ATR(5) |
| 15m-1h | Day trading | MACD, RSI(14), BBands, EMA(20,50) |
| 4h-1d | Swing trading | SuperTrend, ADX, EMA(50,200) |
| 1w | Position trading | SMA(20,50), RSI(14), monthly VWAP |

## Common Indicator Combinations

### Trend Following
```python
# EMA crossover + ADX confirmation + SuperTrend direction
ema_fast = df.ta.ema(length=20)
ema_slow = df.ta.ema(length=50)
adx_df = df.ta.adx(length=14)
st_df = df.ta.supertrend(length=10, multiplier=3)

bullish = (
    (ema_fast > ema_slow) &
    (adx_df["ADX_14"] > 25) &
    (st_df["SUPERTd_10_3.0"] == 1)
)
```

### Mean Reversion
```python
# RSI oversold + price at lower BB + Stochastic oversold
rsi = df.ta.rsi(length=14)
bb = df.ta.bbands(length=20, std=2.5)
stoch = df.ta.stoch(k=14, d=3, smooth_k=3)

buy_signal = (
    (rsi < 30) &
    (df["close"] <= bb["BBL_20_2.5"]) &
    (stoch["STOCHk_14_3_3"] < 20)
)
```

### Momentum Confirmation
```python
# MACD histogram positive + RSI above 50 + OBV rising
macd = df.ta.macd(fast=12, slow=26, signal=9)
rsi = df.ta.rsi(length=14)
obv = df.ta.obv()

momentum_bull = (
    (macd["MACDh_12_26_9"] > 0) &
    (rsi > 50) &
    (obv > obv.shift(1))
)
```

### Volatility Breakout (BB Squeeze)
```python
# Bollinger Band width contracting + volume spike
bb = df.ta.bbands(length=20, std=2.0)
atr = df.ta.atr(length=14)
vol_sma = df["volume"].rolling(20).mean()

bb_width = (bb["BBU_20_2.0"] - bb["BBL_20_2.0"]) / bb["BBM_20_2.0"]
squeeze = bb_width < bb_width.rolling(120).quantile(0.1)
vol_spike = df["volume"] > (vol_sma * 2.0)

breakout_setup = squeeze & vol_spike
```

## Integration with Other Skills

- **birdeye-api**: Fetch OHLCV data → feed into pandas-ta for indicator computation
- **vectorbt**: Use pandas-ta indicators as signal inputs for backtesting
- **trading-visualization**: Plot indicator overlays on price charts
- **slippage-modeling**: Combine ATR with slippage estimates for realistic execution modeling
- **position-sizing**: Use ATR-based sizing from pandas-ta output

## Files

### References
- `references/indicator_guide.md` — Top 20 crypto indicators with syntax, parameters, and interpretation
- `references/strategy_patterns.md` — Pre-built strategy combinations for scalping, day trading, and swing trading
- `references/common_pitfalls.md` — Common mistakes with technical indicators in crypto markets

### Scripts
- `scripts/compute_indicators.py` — Fetch OHLCV data and compute standard indicator set with signal summary
- `scripts/multi_indicator_scan.py` — Run multiple strategy profiles and score current signal alignment

© agiprolabs · MIT · agiprolabs/claude-trading-skills

Similar skills

Everything for Finance and business →

From the same set52

walk-forward-validation Walk-forward validation framework for trading strategies and ML models. It handles financial time-series splits, prevents lookahead bias, and tests for overfitting. CX Codex +1 703installs risk-management A skill that sets portfolio risk rules for crypto trading: drawdown limits, daily and weekly loss stops, concentration caps and automated circuit breakers. CX Codex +1 631installs position-sizing Calculates trade position sizes using five risk management models. Useful for setting up systematic trading rules and managing drawdown risks. CX Codex +1 572installs regime-detection A Claude skill that classifies the current market as trending or ranging and tells you how volatile it is. Useful before you pick a strategy. CX Codex +1 574installs kelly-criterion A skill that works out position size with the Kelly criterion: the formula, fractional variants, edge estimation and a correlation adjustment. CX Codex +1 528installs trade-journal Logs trading activity with entry rationale, attributes returns to strategy tags, and detects revenge trading or FOMO. Useful for systematic performance reviews. CX Codex +1 515installs feature-engineering Builds features from market data for ML trading models: price, volume, microstructure, on-chain. Useful when a model trained on raw candles keeps overfitting. CX Codex +1 517installs signal-classification A skill that builds ML trading signal classifiers on XGBoost and LightGBM, with walk-forward validation, SHAP importance and threshold tuning. CX Codex +1 516installs

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