jpskill.com
📦 その他 コミュニティ

pandas-ta

pandas-taを活用し、暗号資産市場のデータ分析に役立つ130種類以上のテクニカル指標を手軽に利用できるようになり、より高度な市場分析と投資判断を支援するSkill。

📜 元の英語説明(参考)

Technical analysis with 130+ indicators using pandas-ta for crypto market data

🇯🇵 日本人クリエイター向け解説

一言でいうと

pandas-taを活用し、暗号資産市場のデータ分析に役立つ130種類以上のテクニカル指標を手軽に利用できるようになり、より高度な市場分析と投資判断を支援するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o pandas-ta.zip https://jpskill.com/download/10424.zip && unzip -o pandas-ta.zip && rm pandas-ta.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10424.zip -OutFile "$d\pandas-ta.zip"; Expand-Archive "$d\pandas-ta.zip" -DestinationPath $d -Force; ri "$d\pandas-ta.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して pandas-ta.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → pandas-ta フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

pandas-ta — 暗号市場向けのテクニカル分析

pandas-ta は、df.ta を介してアクセス可能な 130 以上のテクニカル分析指標で pandas の DataFrame を拡張する Python ライブラリです。トレンド、モメンタム、ボラティリティ、出来高、オーバーラップの各指標カテゴリを網羅しており、すべての OHLCV DataFrame で単一のメソッドで呼び出すことができます。

インストール

uv pip install pandas-ta pandas httpx

クイックスタート

import pandas as pd
import pandas_ta as ta

# df は、open、high、low、close、volume の列を持つ DataFrame であると仮定します
# すべて小文字の列名が必要です

# 単一の指標
df["rsi"] = df.ta.rsi(length=14)
df["atr"] = df.ta.atr(length=14)

# ストラテジーによる複数の指標
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 の形式

pandas-ta は、小文字の列名を持つ DataFrame を想定しています。

import pandas as pd

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

重要: VWAP のような時間対応の指標については、インデックスを DatetimeIndex に設定してください。列名は小文字にする必要があります(close であり、Close ではありません)。

欠損データの処理

# OHLCV 列に NaN がある行を削除します
df = df.dropna(subset=["open", "high", "low", "close", "volume"])

# 小さなギャップを前方補完します(最大 1〜2 バー)
df = df.ffill(limit=2)

# 出来高指標について、出来高がゼロのバーがないことを確認します
df = df[df["volume"] > 0]

主要な指標カテゴリ

トレンド指標

市場の方向とトレンドの強さを特定します。

指標 呼び出し 主要なシグナル
SMA df.ta.sma(length=20) 価格が上にある = 強気
EMA df.ta.ema(length=20) SMA より高速、ラグが少ない
SuperTrend df.ta.supertrend(length=10, multiplier=3) 方向列:1=強気、-1=弱気
Ichimoku df.ta.ichimoku() (スパン、ライン) DataFrame のタプルを返します
VWMA df.ta.vwma(length=20) 出来高加重価格トレンド
HMA df.ta.hma(length=20) 最小限のラグ、スムーズなトレンド
ADX df.ta.adx(length=14) >25 = トレンドあり、<20 = レンジ相場

モメンタム指標

価格変動の速度と大きさを測定します。

指標 呼び出し 主要なシグナル
RSI df.ta.rsi(length=14) >70 買われすぎ、<30 売られすぎ
MACD df.ta.macd(fast=12, slow=26, signal=9) ヒストグラムのクロスオーバー = エントリー
Stochastic df.ta.stoch(k=14, d=3, smooth_k=3) >80 買われすぎ、<20 売られすぎ
CCI df.ta.cci(length=20) >100 買われすぎ、<-100 売られすぎ
Williams %R df.ta.willr(length=14) >-20 買われすぎ、<-80 売られすぎ
ROC df.ta.roc(length=10) プラス = 上向きのモメンタム
MFI df.ta.mfi(length=14) RSI のマネーフロー版

ボラティリティ指標

価格のばらつきと予想される範囲を測定します。

指標 呼び出し 主要なシグナル
Bollinger Bands df.ta.bbands(length=20, std=2) スクイーズ = ブレイクアウト間近
ATR df.ta.atr(length=14) ポジションサイジング、ストップ配置
Keltner Channels df.ta.kc(length=20, scalar=1.5) KC 内の BB = スクイーズ
Donchian Channels df.ta.donchian(lower_length=20, upper_length=20) ブレイクアウト検出

出来高指標

出来高分析で価格変動を確認します。

指標 呼び出し 主要なシグナル
OBV df.ta.obv() 価格からの乖離 = 反転
VWAP df.ta.vwap() 日中の公正価値(DatetimeIndex が必要です)
CMF df.ta.cmf(length=20) >0 アキュムレーション、<0 ディストリビューション
AD df.ta.ad() アキュムレーション/ディストリビューションライン

Strategy クラス

ta.Strategy を使用して、単一の呼び出しで複数の指標を実行します。

import pandas_ta as ta

# 組み込みの "All" ストラテジーは、すべての指標を実行します
df.ta.strategy(ta.AllStrategy)

# カスタムストラテジー
my_strategy = ta.Strategy(
    name="Crypto Scalp",
    description="暗号スキャルピングのための高速指標",
    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)

名前付きストラテジーパターン

# トレンドフォロー
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},
    ]
)

# 逆張り
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_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},
    ]
)

暗号通貨固有の考慮事項

24 時間 365 日の市場

  • セッションギャップなし — セッションの始値/終値に依存する指標は異なる動作をします
  • VWAP はデフォルトで UTC の午前 0 時にリセットされます。カスタム期間にはアンカー付き VWAP を検討してください
  • 週末のデータは連続しています — 月曜日のギャップ効果はありません

高ボラティリティの調整

  • Bollinger Bands: デフォルトの 2 倍の代わりに 2.5〜3 倍の標準偏差を使用します
  • RSI 期間: 短い期間(7〜10)は、より速い暗号通貨サイクルを捉えます
  • ATR: 動的なストップロスに使用します。暗号通貨の ATR は通常、株式の ATR の 2〜5 倍です
  • SuperTrend multiplier: 株式の場合は 2〜3 倍ですが、暗号通貨の場合は 3〜4 倍です

低時価総額トークンの考慮事項

  • 出来高

(原文はここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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

uv pip install pandas-ta pandas httpx

Quick Start

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:

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

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

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

# 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

# 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

# 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

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

# 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