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.8-py3-none-win_arm64.whl (3.3 MB view details)

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

quantalib-0.8.8-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.8-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

quantalib-0.8.8-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.8-py3-none-win_arm64.whl.

File metadata

  • Download URL: quantalib-0.8.8-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.8-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 87068e8dbe3b573acda68b28860fe65fb4c96a753db049126f56891532d675d1
MD5 a6fbef05930b26fa3fbfd39aa5222196
BLAKE2b-256 2013ce2e79354e96bfab4588d9214e88703cf51353de31ece4cac0cd86a6addc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: quantalib-0.8.8-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.8-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 976da3b50c64056b5f2d0da42a387e3f0c32e8215f402dd35e15a528f0ddb4d4
MD5 fc861effc1cabbc9eb6248724f4c2792
BLAKE2b-256 2ede3d1ba11191a838141b0c78c031abd09b4a169d49fc736ea786d396bb29af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quantalib-0.8.8-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 353fdf07af943d1b7a81fe37c90633593b3b4a791051791291e501c31543e12e
MD5 d0fa7d9b798e578d9e12007e8b38da87
BLAKE2b-256 af1edbbd6ccb5a0e5c96d4b4a678af0539d40efbaefd1f5f168462da0c86ad74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quantalib-0.8.8-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 2c0aff81092379e9f3a8e5a2890e68993b384844b151a83acd2852bac569a3bd
MD5 eedb3785a399d6523db2d31736bddf0b
BLAKE2b-256 3475d14c8bb0d7a414dec2c40e906d1be610420aa32b14add1499bf73a4ebeba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quantalib-0.8.8-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bbbd2da04a0927c69a6f48122573e54b0ed9631c98ccd39f91b4c26a11adaf73
MD5 02cb1ff5d1fcf982296d64b128ccb578
BLAKE2b-256 bd8e4861b6320d3a33fb2141979550471d9b168e01395b6e8f0866a71cd45935

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quantalib-0.8.8-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 62b3ad7288f9c6e4a7d3c9e187c8dd26ff3292850cad2115574f316ea7acae96
MD5 7d7c7e2b144afd98db23c5c508a66622
BLAKE2b-256 f5753f48d4acb9b10a1a908f5db292695f0336f1f91efb968888671d0099f617

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