Skip to main content

Pandas TA Classic

Pandas TA Classic - Technical Analysis Library

License Build Status Documentation Python Version PyPI Version Package Status Downloads Stars Forks Dependents Contributors

Example Chart

Pandas TA Classic is an easy-to-use library that leverages the Pandas package with 224 indicators and utility functions and 62 native candlestick patterns (284 total unique — no TA-Lib required). Many commonly used indicators are included, such as: Simple Moving Average (sma), Moving Average Convergence Divergence (macd), Hull Exponential Moving Average (hma), Bollinger Bands (bbands), On-Balance Volume (obv), Aroon & Aroon Oscillator (aroon), Squeeze (squeeze) and many more.

This is the classic/community maintained version of the popular pandas-ta library.

New to Pandas TA Classic?

Get started quickly with our comprehensive guides:

  • Quickstart Guide - Installation, your first indicators, and common workflows
  • Tutorials - Step-by-step tutorials for real-world use cases:
  • Moving Average Crossover Strategy
  • Building Custom Indicator Strategies
  • Backtesting with Performance Metrics
  • Integrating with backtesting.py
  • Integrating with backtrader
  • Integrating with VectorBT
  • Integrating with manifoldbt
  • Multi-Timeframe Analysis
  • Creating Custom Indicators
  • Candlestick Pattern Recognition

Complete documentation: https://xgboosted.github.io/pandas-ta-classic/

Key Features

  • 284 Unique Indicators & Patterns: 224 Category indicators + 62 CDL patterns via cdl_pattern() = 284 unique (doji and inside appear in both counts; all CDL patterns use native Python — no TA-Lib required)
  • All-Native Candlestick Patterns: All 62 CDL patterns have native Python implementations — TA-Lib is never used for CDL patterns
  • Optional TA-Lib Acceleration: Core indicators (EMA, SMA, RSI, MACD, OBV, ATR, etc.) use native implementations by default; pass talib=True to use TA-Lib
  • Compatibility Scope Is Explicit: Not every TA-Lib/tulipy function has a pandas-ta-classic counterpart. See the full per-indicator matrix for current coverage: docs/indicator_support_matrix.rst
  • Optional Performance Boost: Install numba to compile the recursive loops (RSX, HWMA, MCGD, SSF, Supertrend, PSAR, QQE and others): 6–200× faster on 100,000-bar series (see below)
  • Automatic Versioning: Version management via git tags using setuptools-scm
  • Modern Package Management: Full support for both uv and pip
  • Production Ready: Stable status with comprehensive test coverage including property-based testing (Hypothesis)
  • Active Development: Regular updates with community contributions

Quick Start

Installation

The library supports both modern uv and traditional pip package managers.

Stable Release

Using uv (recommended - faster):

uv pip install pandas-ta-classic

Using pip:

pip install pandas-ta-classic

Latest Version

Using uv:

uv pip install git+https://github.com/xgboosted/pandas-ta-classic

Using pip:

pip install -U git+https://github.com/xgboosted/pandas-ta-classic

Development Installation

Using uv:

# Clone the repository
git clone https://github.com/xgboosted/pandas-ta-classic.git
cd pandas-ta-classic

# Install with all core dependencies (excludes the platform-fragile
# backtest extra — install it explicitly if needed)
uv pip install -e ".[all]"

# Or install specific dependency groups:
uv pip install -e ".[dev]" # Development tools
uv pip install -e ".[optional]" # Optional runtime features
uv pip install -e ".[oracle]" # Oracle parity lib: TA-Lib
uv pip install -e ".[backtest]" # Backtesting: backtesting, vectorbt, backtrader

Using pip:

# Clone the repository
git clone https://github.com/xgboosted/pandas-ta-classic.git
cd pandas-ta-classic

# Install with all core dependencies (excludes the platform-fragile
# backtest extra — install it explicitly if needed)
pip install -e ".[all]"

# Or install specific dependency groups:
pip install -e ".[dev]" # Development tools
pip install -e ".[optional]" # Optional runtime features
pip install -e ".[oracle]" # Oracle parity lib: TA-Lib
pip install -e ".[backtest]" # Backtesting: backtesting, vectorbt, backtrader

Basic Usage

import pandas as pd
import pandas_ta_classic as ta

# Load your data
df = pd.read_csv("path/to/symbol.csv")
# OR fetch OHLCV with yfinance directly (pandas-ta-classic does not fetch data;
# see examples/fetch_market_data.py):
# import yfinance as yf
# df = yf.download("AAPL", period="1y")

# Calculate indicators
df.ta.sma(length=20, append=True) # Simple Moving Average
df.ta.rsi(append=True) # Relative Strength Index 
df.ta.macd(append=True) # MACD
df.ta.bbands(append=True) # Bollinger Bands

# Fluent API chaining (v0.6+)
df.ta.chain().sma(20).ta.rsi(14).ta.macd().ta.bbands(20)

# Or run a strategy with multiple indicators
df.ta.strategy(ta.CommonStrategy) # Runs commonly used indicators

Features

  • 224 Technical Indicators & Utilities across 10 categories (Candles, Cycles, Math, Momentum, Overlap, Trend, Volume, etc.)
  • 62 Native Candlestick Patterns — all patterns natively implemented, no TA-Lib required
  • 284 Unique Indicators & Patterns - 224 category indicators plus 62 CDL patterns via cdl_pattern()
  • Dynamic Category Discovery - automatically detects all available indicators from the filesystem
  • Optional Numba Acceleration - 6–200× faster recursive indicators on long series via pip install pandas-ta-classic[performance]
  • Strategy System for bulk indicator processing, with opt-in multiprocessing
  • Fluent API Chaining: df.ta.chain().sma(20).ta.rsi(14).ta.macd().ta.bbands(20) — chain multiple indicators in a single expression
  • Pandas DataFrame Extension for seamless integration (df.ta.<indicator>(), e.g. df.ta.rsi())
  • TA-Lib Integration (dual-role) - (1) acceleration backend: core indicators use native implementations by default; pass talib=True to use TA-Lib's C implementation. (2) oracle: test_oracle_talib.py verifies parity against TA-Lib
  • tulipy Integration (frozen oracle only) - test_oracle_tulipy.py verifies native output against a committed golden snapshot of tulipy's output (tests/fixtures/tulipy_oracle.json); tulipy itself is no longer installed at test time, only to regenerate the snapshot; never used as a computation backend
  • Backtesting.py Integration — bridge function and runnable SMA crossover example in examples/backtesting_py_strategy.py
  • backtrader Integration — precompute-then-feed pattern with dynamic PandasData subclass; runnable example in examples/backtrader_strategy.py
  • Vectorbt Integration - compatible with popular backtesting framework
  • manifoldbt Integration - precompute-then-register pattern using exogenous series; runnable example in examples/manifoldbt_strategy.py
  • Custom Indicators - easily create and chain your own indicators

Documentation

Complete documentation is available at: https://xgboosted.github.io/pandas-ta-classic/

Learning Resources

Start Here:

Reference Documentation:

Python Version Support

Pandas TA Classic follows a rolling support policy for the latest stable Python version plus 4 preceding minor versions: currently Python 3.11–3.15.

Note: The window is set by LATEST_PYTHON_VERSION in the CI workflow. A maintainer raises it after a new Python release; the CI test matrix follows from it, and each release derives the PyPI classifiers and requires-python from it.

TA-Lib and tulipy serve different roles — both are fully optional and skip gracefully when not installed.

Library Role Effect when installed
TA-Lib Acceleration backend + live oracle Core indicators — native by default, opt-in via talib=True; also used live in test_oracle_talib.py for parity checks
tulipy Frozen oracle only Not a computation backend and not installed at test time; test_oracle_tulipy.py compares against a committed golden snapshot of tulipy's output. tulipy is only needed to regenerate that snapshot (CPython <3.12)
Area Behaviour without TA-Lib Behaviour with TA-Lib
CDL patterns (62) Native Python — always used Still native — TA-Lib never used for patterns
Core indicators (59) Native Python (default) TA-Lib available via talib=True
# CDL patterns — always native, no TA-Lib needed
df.ta.cdl_pattern(name="all") # run all 62 patterns
df.ta.cdl_pattern(name="engulfing") # individual pattern

# Core indicators — native by default
df.ta.ema(length=20) # native implementation
df.ta.ema(length=20, talib=True) # use TA-Lib

Installing oracle libraries:

# uv
uv pip install pandas-ta-classic[oracle] # installs TA-Lib (the live oracle)
uv pip install TA-Lib # TA-Lib only (also enables acceleration backend)
# pip
pip install pandas-ta-classic[oracle] # installs TA-Lib (the live oracle)
pip install TA-Lib # TA-Lib only (also enables acceleration backend)
# tulipy is only needed to regenerate the frozen oracle snapshot (CPython <3.12):
pip install tulipy && python tests/fixtures/generate_tulipy_oracle.py

Note: test_oracle_talib.py skips automatically (@unittest.skipUnless) when TA-Lib is not installed. test_oracle_tulipy.py runs on every Python version against the committed tulipy_oracle.json snapshot (skips only if that fixture is missing) — it does not require tulipy installed. Neither is required for normal use. Installing TA-Lib additionally enables C-library acceleration for core indicators via talib=True.

Performance boost: Install numba to compile the recursive indicators' loops. Measured with tools/bench_indicators.py, run with numba and with NUMBA_DISABLE_JIT=1: on 100,000 bars RSX is 200× faster, HWMA 67×, MCGD 55×, SSF 53×, Supertrend 32×, PSAR 18× and QQE 6×; on 5,000 bars the same indicators gain 2–80×. Both paths agree to 1e-12 relative (tests/test_numba_parity.py).

  • Using uv: uv pip install pandas-ta-classic[performance]
  • Using pip: pip install pandas-ta-classic[performance]

Contributing

We welcome contributions! Please see our contributing guidelines and issues page.

Reporting Issues

  • Check existing issues first
  • Provide reproducible code examples
  • Include relevant error messages and data samples

Changelog

For detailed information about changes, improvements, and new features, please see the CHANGELOG.md file.

Upgrading from 0.8.x: 0.9.0 is a breaking release. Invalid arguments and non-Series input now raise instead of falling back to a default, short input returns an all-NaN result instead of None, and some results and column names change. Read Upgrading from 0.8.x before you upgrade.

Sources

Original TA-LIB | TradingView | Sierra Chart | MQL5 | FM Labs | Pro Real Code | User 42

Support

If you find this library helpful, please consider:

Sponsor

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for pandas-ta-classic 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pandas-ta-classic 0.9.0
File Interpreter ABI Platform Actions
pandas_ta_classic-0.9.0-py3-none-any.whl Python 3 none any Details for pandas_ta_classic-0.9.0-py3-none-any.whl

Release files / pandas_ta_classic-0.9.0-py3-none-any.whl

Download URL pandas_ta_classic-0.9.0-py3-none-any.whl
Size 473.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9792bfc478e6ab20dc67008eea748fd5f7042a986f96dbef582b270b706cc57
BLAKE2b-256 checksum
How to use checksums
1b7c3f0874916661cd4cdf4164db965773e401fe1014c56832dca78c1ce1090b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.1

Security for pandas-ta-classic 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page