Writing your own RSI in pandas takes 4 lines. Writing the next 50 indicators takes a week. By the time you've implemented Bollinger Bands, MACD, Stochastic, Ichimoku, and a dozen oscillators, you've spent more time on indicator code than strategy logic. pandas-ta gives you 130+ indicators in a single import, all properly vectorised, all consistent with TradingView's calculations.
This article walks through using pandas-ta for crypto strategy research, the indicators worth knowing, and where the library's defaults don't match what you'd expect.
Three reasons it's worth learning over rolling your own:
**Speed.** Native pandas operations under the hood. A full set of 20 indicators on 10,000 candles runs in under a second. Hand-rolled equivalents are often 5-10× slower because they accidentally use loops where pandas has vectorised primitives.
**Correctness.** Subtle indicator math errors are common in hand-rolled code. RSI's Wilder smoothing versus EMA smoothing changes signals materially. MACD with the wrong signal line period gives plausible-looking but wrong results. pandas-ta matches TradingView's calculations exactly, which matters when comparing backtest signals to chart signals.
**Composability.** Every indicator returns a series or DataFrame that integrates cleanly with the rest of your pipeline. No glue code, no shape mismatches.
Install via pip:
Basic usage on a DataFrame from CCXT:
The column naming convention is `INDICATOR_PARAMS` — `RSI_14`, `BBL_20_2.0` (lower band), `BBM_20_2.0` (middle), `MACD_12_26_9`, `MACDh_12_26_9` (histogram), and so on. Slightly verbose but disambiguates clean across parameter sets.
For crypto strategies specifically, these are the high-utility ones:
Trend identification:
Momentum:
Volatility:
Volume:
These cover 90% of indicator needs for crypto strategy research.
Bringing it together — a mean-reversion signal generator using multiple indicators for confirmation:
Each indicator is calculated in one line. The strategy logic is readable. Adding new conditions (volume confirmation, MACD divergence) is a one-line addition.
pandas-ta and vectorbt complement each other well — pandas-ta generates the signals, vectorbt runs the backtest:
End-to-end: from raw OHLCV to a fully backtested strategy in ~30 lines, with realistic transaction costs and proper signal mechanics.
A few pandas-ta quirks that catch new users:
**EMA initialisation.** pandas-ta's EMA starts from the first available data point and ramps up over N periods. For accurate signals, drop the first 2-3× length data points before evaluating. Otherwise early signals are based on under-warm indicator values.
**VWAP resets.** By default, `ta.vwap()` resets daily at midnight UTC. This is what TradingView does. If your strategy uses session-relative VWAP (resetting at market open, for example), pass `anchor='D'` or override with custom logic.
**RSI calculation.** pandas-ta uses Wilder's smoothing by default, matching TradingView. Some libraries (notably older versions of TA-Lib) use simple moving averages, which gives slightly different values. If you're cross-referencing with another tool, verify which version it uses.
**ADX warm-up period.** ADX needs roughly 2× length bars to stabilise. Signals based on ADX in the first 30-40 bars of any series are unreliable.
Q: pandas-ta vs TA-Lib?
TA-Lib is older, more battle-tested, and harder to install (C library dependency). pandas-ta is pure Python, easier to install, and has more indicators. For crypto retail use, pandas-ta is the better default. For institutional production code, TA-Lib's stability still wins.
Q: Can I write custom indicators?
Yes — pandas-ta has a clean extension API. Define a function that takes pandas Series inputs and returns a Series, register it with `ta.indicators` or just use it directly in your pipeline. Custom indicators behave like the built-ins.
Q: Does it handle multi-timeframe analysis?
Not natively — you resample your DataFrame to the desired timeframe first, then run indicators. The library is timeframe-agnostic, which is the right design but requires the user to manage timeframe state.
Q: How fast is it on large datasets?
1M candles, full indicator suite: ~10-30 seconds depending on which indicators. Faster than hand-rolled by 5-10× because of vectorisation. Still slow enough that parameter sweeps need to be batched intelligently — use vectorbt for that.