Skip to main content

TaCuda — Python Bindings

Version 0.9.2 covers the 237 TA-Lib 0.8.3 functions with matching native libraries and bindings. It adds MA types through ALMA, real int32 and mixed outputs, and four-output HA/ICHIMOKU. Flat RSI/IMI now returns 50; other numerical changes and performance limits are documented in the compatibility guide. New streaming families are a separate API surface. Third-party formula licenses ship in THIRD_PARTY_NOTICES.txt.

Python package for the native tacuda CUDA library. TA-Lib 0.8.3 coverage (237 functions): indicators, MACDEXT, 19 vector math kernels, candlestick patterns, plus typed core APIs with runtime dtype selection and the zero-copy device API.

Prerequisites

  • NVIDIA GPU (Compute Capability >= 6.0)
  • For official binaries: a driver compatible with CUDA 12.9; source builds use the toolkit selected by CMake
  • Built tacuda shared library (tacuda.dll / libtacuda.so / libtacuda.dylib)
  • Python >= 3.8, NumPy >= 1.20

Package Scope

  • High-level NumPy wrappers for indicator functions
  • Precision-aware core indicators (sma, ema, rsi, macd, atr, bbands) via dtype="float16|float32|float64"
  • OHLCV convenience container and input validation helpers

Installation

pip install tacuda

Note: The tacuda native library must be built separately and placed where the Python bindings can find it. See "Library Location" below.

Quick Start

import numpy as np
from tacuda import sma, ema, rsi, macd, bbands, OHLCV

# Generate sample data
prices = np.random.randn(100_000).cumsum().astype(np.float32) + 100

# Moving averages
sma20 = sma(prices, 20)
ema12 = ema(prices, 12)

# RSI
rsi14 = rsi(prices, 14)

# MACD (returns macd_line, signal, histogram)
macd_line, signal, hist = macd(prices, 12, 26, 9)

# Bollinger Bands (returns upper, middle, lower)
upper, middle, lower = bbands(prices, 20, 2.0, 2.0)

# OHLCV container
ohlcv = OHLCV.from_columns(open_arr, high_arr, low_arr, close_arr, volume_arr)

MACDEXT and vector math

import tacuda

# Independent MA types per line (0=SMA 1=EMA 2=WMA ... 8=T3)
ext_macd, ext_signal, ext_hist = tacuda.macdext(
    prices, fastPeriod=12, fastType=1, slowPeriod=26, slowType=0,
    signalPeriod=9, signalType=2)

# Element-wise GPU kernels
log_prices = tacuda.ln(prices)
spread = tacuda.sub(high_arr, low_arr)

Zero-copy device pipeline

n = len(prices)
d_in = tacuda.device_alloc(n)
d_out = tacuda.device_alloc(n)
try:
    tacuda.device_upload(prices, d_in)      # 1 PCIe transfer in
    tacuda.sma_d(d_in, d_out, n, 20)        # compute on GPU
    tacuda.sin_d(d_out, d_out, n)           # chain kernels, zero copies
    tacuda.device_sync()
    result = tacuda.device_download(d_out, n)  # 1 PCIe transfer out
finally:
    tacuda.device_free(d_in)
    tacuda.device_free(d_out)

device_upload takes its element count from the array. An explicit count may transfer a prefix but never more than the array holds: the native call receives only a pointer, so this is checked before it. The raw tacuda._lib entry points do not have this protection.

Single-series functions require a 1D array and raise ValueError otherwise, because a matrix would be read as one concatenated series crossing symbol boundaries. Use the *_batch functions for (numSeries, seriesLen) matrices.

Available Indicators (TA-Lib 0.8.3 coverage)

Category Indicators
Moving Averages SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, T3, MAMA, MAVP, MA
Momentum RSI, MACD, MACDEXT, MACDFIX, Stochastic, StochF, StochRSI, CCI, CMO, ROC, ROCP, ROCR, ROCR100, MOM, WILLR, APO, PPO, PVO, TRIX, ULTOSC, BOP
Volatility ATR, NATR, TRANGE, BBANDS, ACCBANDS, StdDev, VAR
Trend ADX, ADXR, DX, +DI, -DI, +DM, -DM, SAR, SAREXT, Aroon, AroonOsc
Volume AD, ADOSC, OBV, MFI, IMI, NVI, PVI
Statistical LINEARREG, SLOPE, INTERCEPT, ANGLE, TSF, CORREL, BETA, AVGDEV, SUM, MAX, MIN
Price Transform AVGPRICE, MEDPRICE, TYPPRICE, WCLPRICE, MIDPRICE
Hilbert Transform HT_DCPERIOD, HT_DCPHASE, HT_PHASOR, HT_SINE, HT_TRENDLINE, HT_TRENDMODE
Vector Math (19) SIN, COS, TAN, ASIN, ACOS, ATAN, SINH, COSH, TANH, EXP, LN, LOG10, SQRT, CEIL, FLOOR, ADD, SUB, MULT, DIV
Candlestick 63 patterns (Doji, Hammer, Engulfing, MorningStar, etc.)
Device API ct_*_d variants of the above + device_alloc/upload/download/sync/free and buffer-pool controls

Library Location

The bindings search for the native library in this order:

  1. TACUDA_LIBRARY environment variable (full path to shared library)
  2. TACUDA_LIBRARY_PATH / TACUDA_LIBRARY_DIR + library name
  3. System library path (ctypes.util.find_library)
  4. Common build directories relative to the package

Regenerating Metadata

When the C header changes, regenerate from the repository root:

python bindings/generate_bindings.py

Build & Publish (PyPI)

Releases are built and published only by the release-packages workflow (see CONTRIBUTING.md): one platform wheel per native plus a source-only sdist. For a local build, make the sdist before any native is in tacuda/ (setuptools packs package data into it), then put exactly one native there and build only the wheel. Wipe the setuptools cache before each build: build/lib is never pruned, so a second wheel would otherwise also carry the previous build's native:

cd bindings/python
rm -rf build dist ./*.egg-info
python -m build --sdist          # tacuda/ must not contain a native yet
rm -rf build ./*.egg-info
cp /path/to/libtacuda.so tacuda/ # or tacuda.dll for a Windows wheel
python -m build --wheel
python -m twine check dist/*

Changelog

Canonical release history is maintained in CHANGELOG.md.

License

Apache License 2.0 — see LICENSE.

Streaming and version pairing

Streaming was added in 0.8.0 for incremental single-series and portfolio updates across 10 indicator families. Pair bindings with the native library from the same release; 0.9.0 also includes precision, input-validation and stream correctness fixes. A native older than 0.8.0 does not export the streaming functions. See the Streaming API guide. The 237-function target is native/Python TA-Lib 0.8.3; install the pinned reference requirements to reproduce validation.

Fused portfolio batches (0.9.0)

Seventeen indicator families can process a portfolio in one CUDA kernel per call. Supported device batches are CUDA Graph compatible; user-stream calls stay asynchronous. TACUDA_BATCH_FUSED=auto|0|1 controls automatic, per-series or forced fused dispatch. Period/shape limits apply, and the double internal arithmetic can change the last float32 bits from 0.8. See batch dispatch and migration.

Metadata

Release files for tacuda 0.9.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tacuda 0.9.2
File Size Uploaded Provenance Actions
tacuda-0.9.2.tar.gz 47.4 kB Without provenance Details for tacuda-0.9.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for tacuda 0.9.2
File Interpreter ABI Platform Actions
tacuda-0.9.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for tacuda-0.9.2-py3-none-win_amd64.whl
tacuda-0.9.2-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details for tacuda-0.9.2-py3-none-manylinux_2_35_x86_64.whl

Total release size: 90.9 MB

Release files / tacuda-0.9.2.tar.gz

Download URL tacuda-0.9.2.tar.gz
Size 47.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8851584e47b119f42ed0ba2cdc7ad03f041603be30dbbc4a612552964da8b0c4
BLAKE2b-256 checksum
How to use checksums
1b29be29a7d70c1efa815b9b1d06970c24ea856b4f2c2476704f48874ced7d50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / tacuda-0.9.2-py3-none-win_amd64.whl

Download URL tacuda-0.9.2-py3-none-win_amd64.whl
Size 45.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
e9d48cd15d3d4ad69f369c46bbb40d5326a7def299e28c231cfb0d21d3429018
BLAKE2b-256 checksum
How to use checksums
01196cfeb53b4c49f954d30130992f4a6929316d7d34bf5b7665a072501b8dd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / tacuda-0.9.2-py3-none-manylinux_2_35_x86_64.whl

Download URL tacuda-0.9.2-py3-none-manylinux_2_35_x86_64.whl
Size 45.3 MB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
4c04802d6635d4ea51054631809353fd795c474d5684462204bd6a8ecec0501a
BLAKE2b-256 checksum
How to use checksums
4a1183175074b6baff4d271ef343d2a3f42e8b937cb6333938c22f849d6842f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for tacuda 0.9.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page