quantalib
447 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)
| Indicator | quantalib | wickra | pandas-ta |
|---|---|---|---|
| SMA | 1,298 μs | 12,548 μs | 63,721 μs |
| EMA | 1,067 μs | 12,179 μs | 4,280 μs |
| WMA | 1,139 μs | 12,547 μs | 83,903 μs |
| HMA | 2,647 μs | 14,768 μs | 152,733 μs |
quantalib calls the same SIMD-optimized NativeAOT core as the .NET package through a single ctypes call (5-15 μs overhead). wickra (Rust/PyO3) returns stdlib array.array; pandas-ta stays in pure Python/numpy. For arrays above a few hundred bars, NativeAOT wins by an order of magnitude or more.
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 — the NativeAOT core is compiled per platform in CI and ships inside the wheel, so there is no source build and no C++ toolchain:
| Platform | Wheel tag |
|---|---|
| Windows x64 | win_amd64 |
| Linux x64 | manylinux_2_17_x86_64 |
| Linux arm64 (AWS Graviton) | manylinux_2_17_aarch64 |
| macOS arm64 (Apple Silicon) | macosx_11_0_arm64 |
| macOS x64 (Intel) | macosx_10_13_x86_64 |
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.12
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.12-py3-none-win_arm64.whl | Python 3 | none | Windows ARM64 | Details |
| quantalib-0.8.12-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| quantalib-0.8.12-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| quantalib-0.8.12-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| quantalib-0.8.12-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| quantalib-0.8.12-py3-none-macosx_10_13_x86_64.whl | Python 3 | none | macOS 10.13+ x86-64 | Details |
Total release size: 27.2 MB
Release files / quantalib-0.8.12-py3-none-win_arm64.whl
| Download URL | quantalib-0.8.12-py3-none-win_arm64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | Python 3 Windows ARM64 |
|
SHA-256 checksum How to use checksums |
e5a74672951a529228e2592d136f5f9e51406abac7e8ba4fb2d6c62b52f0957c
|
|
BLAKE2b-256 checksum How to use checksums |
2554d0d128d75712c550d013c8e04b73abb6963a33650e37ad524dc60a76241e
|
| 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.12-py3-none-win_amd64.whl
| Download URL | quantalib-0.8.12-py3-none-win_amd64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
256b868a44cb599c977d9d287b801016edfab27339def59403a5f0ddfcc45bed
|
|
BLAKE2b-256 checksum How to use checksums |
1eb746dd4094a8171a60628883cb4933641bd7dea55f30e3fa0e8600344019f5
|
| 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.12-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | quantalib-0.8.12-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
4f6fb8a82da83e149c7ec665d755e076e55110787a2e13fadde7dfab352349c0
|
|
BLAKE2b-256 checksum How to use checksums |
63a06146d1b84eba3ebfe635b199d6f48adbd601f77cf0998c917dffa267aef3
|
| 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.12-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | quantalib-0.8.12-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
322d64649959a56c70cc30525b5545a02997f60940a9df3ff3c9714d5e2cd266
|
|
BLAKE2b-256 checksum How to use checksums |
516f07c5e858cd37efb4507c278d70d7e30e8d21a94ce2f6b7a08b175b4e9a01
|
| 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.12-py3-none-macosx_11_0_arm64.whl
| Download URL | quantalib-0.8.12-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f64d9f8dd3af47f213fc169fdbf9e0a275a9ec7fcd9a9aaa9b92d5776f72d131
|
|
BLAKE2b-256 checksum How to use checksums |
6f786b0ce54cc932841bed20831da0f8293da8f5444de76fae8359d3d04ce3e8
|
| 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.12-py3-none-macosx_10_13_x86_64.whl
| Download URL | quantalib-0.8.12-py3-none-macosx_10_13_x86_64.whl |
|---|---|
| Size | 6.3 MB |
| Tags | Python 3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
31d230c9a63c40a0ee0160f105fd5c7e146bb0a97a3d0ab5634bbd47da0aac65
|
|
BLAKE2b-256 checksum How to use checksums |
d0f900f449bb4a27912dbdbf018c8b71b68a6271959cdd7cf755040fc02b8340
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|