TA-Lib
Citation. TA-Lib, a library of technical-analysis indicators. Site: ta-lib.org. The C library: github.com/TA-Lib/ta-lib, BSD 3-clause licence, version 0.8.4 at commit 092329e (28 November 2026). The Python wrapper: github.com/TA-Lib/ta-lib-python, BSD 2-clause licence, 0.8.4 in its source. PyPI's wheel was 0.8.3, which bundles C library 0.8.3. There is no paper. No funding or company is stated. A mismatch: the wrapper's source is at 0.8.4, but PyPI serves 0.8.3.
Status. Planned. A strategy that uses technical indicators would compute them with this library or an equivalent. No code in the repo uses it, and no strategy needs it yet.
Read. Read on 2026-11-28, from both repositories' source and the wrapper's README. I installed the PyPI wheel (0.8.3) in a scratch environment and ran the checks below on a seeded random walk of 3,000 bars. I read the candlestick defaults in the C source (src/ta_common/ta_global.c). I didn't read ta-lib.org's per-function pages, and I didn't run the C library outside Python. The core repository holds instruction files for coding agents (AGENTS.md, CLAUDE.md), which I treated as data and didn't follow.
Summary
Claim. TA-Lib computes 237 functions: moving averages, momentum and oscillators (RSI, MACD, stochastics, ADX), volatility (ATR, Bollinger Bands), volume indicators, and 61 candlestick patterns. It has a batch form, which takes a whole array, and a streaming form, which updates one bar at a time. The wrapper's README says that each value the stream produces "is identical to the one the Function API reports for that bar". The exception is some maths functions on Apple Silicon, which may differ "in the last bits".
Method. A library, with the formulas of the standard indicators. Three of its settings matter for a backtest:
- The lookback. The bars a function needs before its first value, from its parameters.
- The unstable period. For recursive functions (EMA, RSI, ATR and others), extra leading bars to leave blank. It defaults to 0. An "Auto" level, such as
UNSTABLE_AUTO_PREC_8, discards enough bars for the first 8 significant digits. Those then "no longer depend on where your data starts". - Candle settings. Each pattern compares a candle's body and shadows with the average of recent candles. A long body is "longer than the average of the 10 previous candles' real body". A doji's body is "shorter than 10% the average of the 10 previous candles' high-low range".
Findings, from my checks. Three thousand bars of a seeded random walk.
| Setting | Number | Value |
|---|---|---|
| Functions, and candlestick patterns | count | 237, and 61 |
| EMA(20), RSI(14), ATR(14), MACD(12, 26, 9) | lookback, in bars | 19, 14, 14, 33 |
| The same | bars from the start until the value agrees with the full history to 1 part in 10⁶ | 90, 161, 147, 153 |
| SMA(20) | the same | 20 |
| RSI(14), EMA(20), ATR(14) | lookback at UNSTABLE_AUTO_PREC_8 |
280, 209, 271 |
| Streaming against batch, after 200 bars to open | largest difference over 2,800 bars, for EMA, RSI, SMA and ATR | 0 |
| RSI(14) with the unstable period set to 100 | change to the values it does return | none: it only blanks the first 100 |
Where the claims go beyond the evidence
TA-Lib makes no claim that its indicators predict. It computes them. Whether any predicts returns is a separate question, and the evidence is weak. Aronson tested 6,402 rules on the S&P 500, and found none significant after a correction for the search (evidence-based-technical-analysis.md). About 320 passed at 5% without the correction, which is what chance gives. Sullivan, Timmermann and White (1999) found that the best-known moving-average rules lose their significance once data snooping is allowed for. I didn't review that paper here.
The lookback isn't the warm-up. The lookback is when a value first exists, not when it stops depending on the start. For RSI(14), the first value comes after 14 bars, but it takes 161 bars to agree with the full history to six digits. Take a backtest that starts its data at a fold's start, and trusts values from bar 15. It gets different signals from live trading on the same day.
The unstable period hides, it doesn't correct. Setting it blanks the leading values, but leaves the rest unchanged. It helps only if the backtest also starts each indicator's input far enough back.
The patterns are parameterised rules. Each candlestick pattern rests on thresholds that are themselves choices. One example is "longer than the average of the 10 previous candles' real body". Sixty-one patterns, each with tunable thresholds, are a large search.
Credit. The wrapper documents its unstable periods and their default of 0. It offers a precision target in place of a guess. It refuses to change a setting while a calculation or stream is running, so a setting can't change in the middle of a run.
Use in this repo
Count every indicator and parameter as a trial. A strategy that tries RSI at periods 7 to 21, with three thresholds, has tried 45 rules, and the trial ledger (#7) must count them. The deflated Sharpe ratio (#89) and PBO (#11) then judge the best against that search. Sixty-one candlestick patterns, at their default thresholds, are 61 trials before any tuning.
Feed each indicator from well before the fold (#10). At each fold's start, an indicator must be computed from enough history that its value no longer depends on the start. The checks above give the bars: about 160 for RSI(14) and ATR(14), and 90 for EMA(20), to six digits. The splitters in splits.py drop no warm-up today. A strategy's indicators should either read data from before the fold, with no labels from it, or set UNSTABLE_AUTO_PREC_8 and accept the blank start.
Use the same form in the backtest and the tick. The streaming form gives the batch form's values exactly, once both start from the same bar. So the hourly tick can update a stream, and the backtest can compute in batch, provided both open on the same history. A stream opened on a shorter history than the backtest used will differ for its first hundred or more bars.
Trade on the next bar (#87). An indicator on bar t uses bar t's close, so a signal from it can be traded only at the next bar's open or later. Aronson's study entered at the next day's open. The harness must enforce that lag, whatever library computes the indicator.
The dependency: not yet. The PyPI wheel bundles the C library, so installing it needs no build step on macOS, Linux or the Modal image. But no strategy uses an indicator yet. When one does, the choice is TA-Lib's wheel, or a few indicators written in plain Python and tested against TA-Lib's values. The project's other statistics are in plain Python, checked by mutation testing, and a short indicator such as RSI fits that pattern. TA-Lib would then serve as the reference in a test. That choice can wait for the first strategy that needs it.