[RELEASE] pandas-ta-classic v0.8.32: lookahead-bias fixes, bit-exact TA-Lib parity, big numba speedups
retained text
Hey r/algotrading, pandas-ta-classic v0.8.32 is out. This is the community-maintained fork of pandas-ta. The main themes of this release are correctness and speed. If you backtest with it, please upgrade. A few of these bugs could make a backtest look better than it really was. ## 🚨 Lookahead bias fixes (please read) * **`non_zero_range` leaked future bars into past rows** (#149). If any bar in your data had `high == low`, the zero-range adjustment was applied to *every* row. One flat bar appended at the end could change your entire history. It now works bar by bar, and this fixes 27 indicators that use it. * **`cdl_z(full=True)`** built a constant column from the whole series, which includes future data. It is now anchored to past data only. * **`cpr()`** silently ignored `lookahead=False`. **`tos_stdevall()`** and **`vp()`** now raise an error instead of pretending to honour it. * **BREAKING:** `mavp` now requires `periods`. The old default depended on the length of the data. * A new causality test suite checks that indicators give the same values bar by bar as they do on the full batch. ## 🎯 TA-Lib parity * **ADX family** (`adx`, `adxr`, `dx`, `plus_dm`, `minus_dm`) is now bit-exact with TA-Lib. The first bars used to be off by up to 49.7%. * `rsi`, `atr` and `natr` warmup lengths match TA-Lib. * `ht_*` Hilbert Transform indicators return NaN for the same lookback bars as TA-Lib. `ht_trendmode` no longer invents a trend mode for undefined bars. * Native candle patterns went silent on chained input (input with a leading NaN run). 33 of 62 were affected, and all 62 are fixed. * 14 indicators returned all-NaN on chained input, for example `macd(rsi(close))` style pipelines. They are fixed now. ```python rsi = ta.rsi(df["close"]) ta.macd(rsi) # used to be all NaN, now works ta.kama(rsi) # same ``` ## 🔧 Bug fixes * **Short input no longer crashes.** `trix`, `qqe`, `tsi`, `ht_*`, `candle_color`, `dm`, `cdl_pattern`, `pvt`, `swma`, `rvi` and `tos_stdevall` now return `None` instead of raising an error. * **Full-length output:** `stoch`, `t3` and `td_seq` return the same number of rows as the input and keep your index. This fixes the backtesting.py alignment error. * **`df.ta.strategy()` multiprocessing** shipped every column to every worker. The payload dropped from 1244 MB to 18 MB, which fixes `WinError 1450` on Windows. * **`df.ta.adjusted = "adj_close"`** had no effect. It works now. * `df.ta` no longer writes into your DataFrame's `attrs`, and property setters work again under pandas 3. * `df.ta.indicators()` prints its list again. ## ⚡ Performance Many hot loops moved to numba or were vectorised: | Indicator | Speedup | |---|---| | `td_seq` | ~3500× | | `ebsw` | ~850× | | `hilo` | ~250× | | `jma` / `kama` | ~130× / ~90× | | `mama` / `ha` / `stc` | ~55× / ~50× / ~40× | | Candlestick patterns | ~32× | Cold `import pandas_ta_classic` is also about 3–4× faster. ## 🆕 Integrations New tutorials and integrations for **backtrader**, **backtesting.py** and **vectorbt**: ```python import pandas_ta_classic as ta df.ta.rsi(append=True) df.ta.adx(append=True) df.ta.cdl_pattern(name="engulfing", append=True) ``` ## ⚠️ Deprecations and breaking changes * Passing a non-Series (for example `df["close"].values`) now raises a `FutureWarning`. A future release will raise `TypeError`. Pass `df["close"]` instead. * Built-in data fetching (`ta.yf()`, `ta.av()`, `df.ta.ticker()`) is deprecated. Use yfinance or your data provider directly. * The `ichimoku()` tuple return is deprecated in favour of a single DataFrame. * **BREAKING:** `from pandas_ta_classic import *` no longer imports the indicator functions. Use `import pandas_ta_classic as ta`. * The inactive `drift` parameters are deprecated. ## 📦 Install ``` pip install -U pandas-ta-classic ``` The package has 224 indicators plus 62 native candlestick patterns, and TA-Lib is not required. It is tested on Python 3.10–3.14, pandas 3, and TA-Lib 0.6 and 0.8. GitHub: https://github.com/xgboosted/pandas-ta-classic Please send feedback, especially if your backtest numbers change after upgrading. I want to hear about the lookahead fixes in particular. Bug reports with a small reproduction help the most. Community maintained. PRs open.
document fetched 2026-09-15 00:45 · canonical https://reddit.com/r/algotrading/comments/1wfyr6y/release_pandastaclassic_v0832_lookaheadbias_fixes