Skip to main content

High-performance technical analysis wrappers over QuanTAlib NativeAOT

Project description

quantalib

PyPI Python License

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 for period=.

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, kchannel, dchannel, 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 psar, pivot, fractals, swings
Statistics statistics zscore, correlation, 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

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

quantalib-0.8.6-py3-none-win_arm64.whl (3.3 MB view details)

Uploaded Python 3Windows ARM64

quantalib-0.8.6-py3-none-win_amd64.whl (3.7 MB view details)

Uploaded Python 3Windows x86-64

quantalib-0.8.6-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

quantalib-0.8.6-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

quantalib-0.8.6-py3-none-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

quantalib-0.8.6-py3-none-macosx_10_13_x86_64.whl (6.0 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

File details

Details for the file quantalib-0.8.6-py3-none-win_arm64.whl.

File metadata

  • Download URL: quantalib-0.8.6-py3-none-win_arm64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quantalib-0.8.6-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 a393cb29460b695cf4450be742ac1042eb4422904f44ee0b62c35b15a477f4f3
MD5 edf1aa498ea33ec7ce815859860f48c2
BLAKE2b-256 034a2746f8e4a15e1ad5f6de037bad056f14f3f211393d0af85b4f10d23216b4

See more details on using hashes here.

File details

Details for the file quantalib-0.8.6-py3-none-win_amd64.whl.

File metadata

  • Download URL: quantalib-0.8.6-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quantalib-0.8.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 79affae70d619630cb2cb19405a7c9301bcf842788fa84380f45f7f3cdec3429
MD5 026432c16c362c094df2c75d4a94ae3a
BLAKE2b-256 1ae7c38923e3f700b3aac48fa4247749ca773737e7d7be675798e3bd9aa605b0

See more details on using hashes here.

File details

Details for the file quantalib-0.8.6-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for quantalib-0.8.6-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9434f5ef576d99cc76dd1759bc7b9171a93a2c317ceaff5728e04bd2924eb78f
MD5 d5a5462e0d82339d3deda034f401d1c8
BLAKE2b-256 1f573bbb8881ff4e679cd93724f3fe92f39caa72f3cebb8c90b51afbd4ebc468

See more details on using hashes here.

File details

Details for the file quantalib-0.8.6-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for quantalib-0.8.6-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 81daa0da404c9ad4795d5cdacf0d3df312267048157e63f292593dbe30a1bdd1
MD5 b09815d817fa232a2079b20eaaaea4e0
BLAKE2b-256 ce8ce7033585705d3ed700b24ea32d014a090b0e0d7e858ddc977d857728d90b

See more details on using hashes here.

File details

Details for the file quantalib-0.8.6-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for quantalib-0.8.6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 844635df1534d54253f896fbd83be48262511c365fe805dda9e9d75afaa9e7f0
MD5 5d6e5b57b6bd09458626b16332bb7392
BLAKE2b-256 3a6b247cc823afc4ec571d28a5e22238735c6237a6ac2df4a1149f1c849259b4

See more details on using hashes here.

File details

Details for the file quantalib-0.8.6-py3-none-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for quantalib-0.8.6-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 b6163d155632a9ce6aaf6b66e76ead1b15efe1728a4829b94e332ed165b6969a
MD5 380cac5d2a33656ff8a3b95e863bb91c
BLAKE2b-256 14a789365e6c23c800dbbde735554d2a9c65864bc57074467fa4b872aef81a36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page