quantalib
393 technical analysis indicators compiled to native code via .NET NativeAOT, called from Python through ctypes. Same SIMD-accelerated engine as the QuanTAlib .NET package. Zero Python math reimplementation.
pip install quantalib
Quick Start
import numpy as np
import quantalib as qtl
close = np.random.default_rng(42).normal(100, 2, size=500)
sma = qtl.sma(close, period=20)
rsi = qtl.rsi(close, period=14)
upper, mid, lower = qtl.bbands(close, period=20, std=2.0)
Works with pandas, polars, and pyarrow — same-type-in, same-type-out:
# pandas — preserves index
import pandas as pd
s = pd.Series(close, name="close")
rsi = qtl.rsi(s, period=14) # → pd.Series
# polars — zero-copy-friendly
import polars as pl
s = pl.Series("close", close)
rsi = qtl.rsi(s, period=14) # → pl.Series
bb = qtl.bbands(s, period=20) # → pl.DataFrame (upper, mid, lower)
# pyarrow — for Arrow-native pipelines
import pyarrow as pa
a = pa.array(close, type=pa.float64())
rsi = qtl.rsi(a, period=14) # → pa.Array
pandas-ta users:
length=is accepted everywhere as an alias forperiod=.
Install optional backends:
pip install quantalib[pandas] # pandas / pd.Series support
pip install quantalib[polars] # polars / pl.Series support
pip install quantalib[pyarrow] # pyarrow / pa.Array support
pip install quantalib[all] # all three
Performance (500,000 bars, AVX-512)
| Indicator | quantalib | pandas-ta | Ratio |
|---|---|---|---|
| SMA | 328 μs | ~50 ms | ~150× |
| EMA | 421 μs | ~45 ms | ~107× |
| WMA | 302 μs | ~60 ms | ~199× |
| RSI | 517 μs | ~80 ms | ~155× |
The ctypes call adds 5-15 μs overhead. For arrays above a few hundred bars, NativeAOT wins by two orders of magnitude.
Categories
| Category | Module | Examples |
|---|---|---|
| Channels | channels |
bbands, kc, dc, aberr |
| Core | core |
ha, midpoint, avgprice, typprice |
| Cycles | cycles |
ht_dcperiod, ht_sine, cg, dsp |
| Dynamics | dynamics |
adx, aroon, ichimoku, supertrend |
| Errors | errors |
mse, rmse, mae, mape, huber |
| Filters | filters |
kalman, sgf, hp, butter2, wavelet |
| Momentum | momentum |
rsi, macd, roc, mom, tsi |
| Numerics | numerics |
fft, normalize, sigmoid, slope |
| Oscillators | oscillators |
stoch, cci, fisher, qqe, willr |
| Reversals | reversals |
sar, pivot, fractals, swings |
| Statistics | statistics |
zscore, correl, entropy, linreg |
| Trends FIR | trends_fir |
sma, wma, hma, alma, trima |
| Trends IIR | trends_iir |
ema, dema, tema, kama, jma |
| Volatility | volatility |
atr, bbw, stddev, hv, tr |
| Volume | volume |
obv, vwma, mfi, cmf, adl |
Requirements
- Python 3.10+
- NumPy >= 1.24
- Pre-built wheels:
win-x64,linux-x64,osx-x64,osx-arm64
Optional dependencies
| Extra | Minimum version | Enables |
|---|---|---|
pandas |
≥ 1.5 | pd.Series / pd.DataFrame round-trip |
polars |
≥ 0.20 | pl.Series / pl.DataFrame round-trip |
pyarrow |
≥ 14.0 | pa.Array / pa.ChunkedArray round-trip |
License
Metadata
Release files for quantalib 0.8.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| quantalib-0.8.10-py3-none-win_arm64.whl | Python 3 | none | Windows ARM64 | Details |
| quantalib-0.8.10-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| quantalib-0.8.10-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| quantalib-0.8.10-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| quantalib-0.8.10-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| quantalib-0.8.10-py3-none-macosx_10_13_x86_64.whl | Python 3 | none | macOS 10.13+ x86-64 | Details |
Total release size: 26.5 MB
Release files / quantalib-0.8.10-py3-none-win_arm64.whl
| Download URL | quantalib-0.8.10-py3-none-win_arm64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | Python 3 Windows ARM64 |
|
SHA-256 checksum How to use checksums |
87cfbf2cbdcd153967ddc6c28cabcd99adb544eece6354b54ca8d398f17dc0e8
|
|
BLAKE2b-256 checksum How to use checksums |
056694ed64051e2d247ad5bce13645b5f502ee79b26f253e211bb5f9aefcf084
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / quantalib-0.8.10-py3-none-win_amd64.whl
| Download URL | quantalib-0.8.10-py3-none-win_amd64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e3e84e6d632b37490660f124c50df127ba9ef79b4f7d36745c0cd290dae1c408
|
|
BLAKE2b-256 checksum How to use checksums |
9ff98cb4c86ed0ebad9f00d6403cc7eb9eb257755c6b6c4d014c36ee6d0d22e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / quantalib-0.8.10-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | quantalib-0.8.10-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
77b42a02808dbfa641ff82e716d63ba03880f28477f2a5a43565bae042d5b87d
|
|
BLAKE2b-256 checksum How to use checksums |
bce6e14447db8e818485392e53faf8255a5cac8f3d4edf594affd6e714624882
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / quantalib-0.8.10-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | quantalib-0.8.10-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
7f8ec4ea4ad343a49a9ad652669c97c7c13462c8b3ecd172a0690c629979ea88
|
|
BLAKE2b-256 checksum How to use checksums |
93585e9da2e887d10d17f10c60c4b1ab27b1a38a32ccc61d925c06c6a8d649a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / quantalib-0.8.10-py3-none-macosx_11_0_arm64.whl
| Download URL | quantalib-0.8.10-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
258770ce2ef389257c194bcedba32381a654e20b8251c1c91e26f77c63e0547a
|
|
BLAKE2b-256 checksum How to use checksums |
632a76760ca951a635f033444d6b6841b1a5452eeea3454dbca116c25d539049
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / quantalib-0.8.10-py3-none-macosx_10_13_x86_64.whl
| Download URL | quantalib-0.8.10-py3-none-macosx_10_13_x86_64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | Python 3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
5c4e8708f55cc42625582d421e421bf137ef1d309632fa053d20d765ddaca4fd
|
|
BLAKE2b-256 checksum How to use checksums |
a7f8d7f56f1d255824169c211e1911767c1c408d130b1f256c8cb7d0205de1af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|