Skip to main content

High-performance technical analysis indicators with optional SIMD/CUDA and language bindings.

Project description

vector-ta

VectorTA is a Rust crate of technical analysis indicators focused on speed and predictable allocations, with optional SIMD/CUDA acceleration and optional Python/WASM bindings.

Full documentation (indicator list, API reference, and guides): https://vectoralpha.dev/projects/ta

The CUDA bindings are predominantly only worth using if used in a VRAM-resident workflow. For example, It is possible to achieve a benchmark timing of 6.08 ms for 250 million calculated ALMA indicator data points on an RTX 4090, whereas the CPU (AMD 9950X) AVX-512, AVX2, and scalar timings are approximately 140.61 ms, 188.64 ms, and 386.20 ms, respectively.

The Tauri backtest optimization demo application using this library can achieve 58300 backtests for a double ALMA crossover strategy over 200k data points in only 98.31 milliseconds on the same hardware (RTX 4090 + AMD 9950X).

Rust usage

Example: ADX over HLC slices

use vector_ta::indicators::adx::{adx, AdxInput, AdxParams};

fn compute_adx(
    high: &[f64],
    low: &[f64],
    close: &[f64],
) -> Result<Vec<f64>, Box<dyn std::error::Error>> {
    let input = AdxInput::from_slices(high, low, close, AdxParams { period: Some(14) });
    Ok(adx(&input)?.values)
}

Features

  • cuda: GPU acceleration using prebuilt PTX (compute_89) shipped in the crate.
  • cuda-build-ptx: You can compile PTX from kernels/cuda/** using nvcc.
  • nightly-avx: Runtime-selected AVX2/AVX512 kernels on x86_64 (nightly required).
  • python: PyO3 bindings (build from source via maturin).
  • wasm: wasm-bindgen bindings (build from source via wasm-pack).

Python (optional)

Build + install into a virtualenv:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip maturin numpy
maturin develop --release --features python

WASM (optional)

Build with wasm-pack:

rustup target add wasm32-unknown-unknown
wasm-pack build --target nodejs --release --features wasm

CUDA (optional)

Enable:

[dependencies]
vector-ta = { version = "0.1.3", features = ["cuda"] }

Notes:

  • To force-disable CUDA probing/usage (tests/CI): set CUDA_FORCE_SKIP=1.
  • To override where prebuilt PTX is sourced from, set VECTOR_TA_PREBUILT_PTX_DIR (see docs link above).

Nsight Compute profiling (CUDA)

Profile one indicator benchmark with Nsight Compute and export report + summary artifacts:

pwsh -NoProfile -File scripts/profile_cuda_indicator_ncu.ps1 -Indicator rsi -Scenario batch -NcuSet full

Useful flags:

  • -ListOnly: list available benchmark IDs for a given indicator.
  • -BenchId <id>: profile an exact Criterion benchmark ID instead of auto-picking one.
  • -KernelRegex <regex>: override kernel filter (default: .*<indicator>.*).

If you see ERR_NVGPUCTRPERM, enable GPU performance counters in NVIDIA Control Panel (Developer -> Manage GPU Performance Counters) or run with sufficient privileges, then rerun.

License

Apache-2.0 (see LICENSE).

Project details


Download files

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

Source Distribution

vector_ta-0.1.3.tar.gz (5.6 MB view details)

Uploaded Source

Built Distributions

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

vector_ta-0.1.3-cp313-cp313-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.13Windows x86-64

vector_ta-0.1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

vector_ta-0.1.3-cp313-cp313-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

vector_ta-0.1.3-cp312-cp312-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.12Windows x86-64

vector_ta-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

vector_ta-0.1.3-cp312-cp312-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

vector_ta-0.1.3-cp311-cp311-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.11Windows x86-64

vector_ta-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

vector_ta-0.1.3-cp311-cp311-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

vector_ta-0.1.3-cp310-cp310-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.10Windows x86-64

vector_ta-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

vector_ta-0.1.3-cp310-cp310-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file vector_ta-0.1.3.tar.gz.

File metadata

  • Download URL: vector_ta-0.1.3.tar.gz
  • Upload date:
  • Size: 5.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vector_ta-0.1.3.tar.gz
Algorithm Hash digest
SHA256 fc5886e2d73b5ca5956fb302e84fe38c2936052c60b36d0786aecc5ed82a8b56
MD5 ab78c1051bc5202ac62a9de5a0a8bb96
BLAKE2b-256 f0ebb6d7d5cd07746a3c74f9ed9e31e89d5ddd92d3d40b4681f5c2418c22f91a

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: vector_ta-0.1.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vector_ta-0.1.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6d60a14f5c3daf690e05bd86be2c2c1bdf53eaaa0d72c419f2431e0565962a18
MD5 f2a5a7fe55cacde2641936787669d3c0
BLAKE2b-256 e613060fdbc5e94e3de9e62623ff1a026fe63fc4300c2a5a065634151abf82f7

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vector_ta-0.1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3908fa57a38dba4da2975f797220bda03fa622a8ede9c3d92f876222edb1adc7
MD5 6ac2c22342b57c5a44659b0d4222d214
BLAKE2b-256 999e108f20e0ddce81aee703832c2eeae35201a83d2521dcaea44b93c988c68b

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vector_ta-0.1.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3f28dcdb7f2071ba81072415beb3a2a48205b31244b5655f4fd821fa19c65ec5
MD5 2998d26ba91c37b01a59d089224bc3bb
BLAKE2b-256 ea038bac7fb12f80b93fe34339ad7349827435168dc326132f32fe45be73a39c

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: vector_ta-0.1.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vector_ta-0.1.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e2c3b39bc1f42b942240ceef118bbf3b9bc904c1bfc32d3ad24ae027a89b745b
MD5 b3b7f1ba083d7a51bdd5cd6fc0ae0e1b
BLAKE2b-256 a73ad46e0908e0713ebcf17103b27f696193b086607d1e923d31c770be42cc08

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vector_ta-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9949bfdc9151deb141e8c043c0096ee679469f6c07354ee569e64cac499d03c8
MD5 cfa2ac4a217e5df17344faaac74496ae
BLAKE2b-256 7f3449555321aab012c2235f3c7c972906816da1f6459b725e434125d9a734b8

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vector_ta-0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7c945424c8d1497e934cc8827b3dd8daddf016abf0836ae06a3cb186702c67e7
MD5 6b401ab839e7845b7d29cb05da542839
BLAKE2b-256 05e8350f7087610ef47981fa78c05c6d8e0e11c9be2aa8fcf0fe9511a4615b13

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: vector_ta-0.1.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vector_ta-0.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c1c25ba333d680597b9c80e7c4a0885c905fb8613830fa84dccc3b6ffc55151b
MD5 40ea5ee625d2d01dbf81d23c0cc3076f
BLAKE2b-256 6ad9491b2d125ecfb7201ff9617398e7b9e2fb722279e04820416bd8239c8181

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vector_ta-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 75bccebbb9e24596289164596863dce55704d885757539b2fa28de7cbb845c2e
MD5 cc55e2ceb61327011a852917a5b32757
BLAKE2b-256 027005f58023868bb987cf0a5e0e0ec525b1e76d9c81293b2062e2793ff7ff06

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vector_ta-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a81aafb69a7dc22b1d97685d9d8b2ca1cb137b07aee4cf85475b703494d941e
MD5 ecc829818946c1e87e6653ab808e3dc8
BLAKE2b-256 136ed3aff81d41e797b5ec78b318eb503ade451c73d76d9ddccf594d7cea74b5

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: vector_ta-0.1.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vector_ta-0.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6c3e2366ca02f3410c9f3792c21967367bcc2a01ea73ed12390debbe9cb6884a
MD5 39f759abf5aa4e2f6d961931636dcf1e
BLAKE2b-256 5bec108c98a753c180550cfb37cc3f57f7fcec792b6939d3ab471bc8f9a280f0

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vector_ta-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8beb11284d75a3008cffa11dc6c7ed13e6160c029816214607c9e308208abe72
MD5 95a4c11fa986409c600aabdca0d094dd
BLAKE2b-256 80a43f2cdafcf05390aca4f5b4615f6fa16576912fe6a0650703dc1ec7971164

See more details on using hashes here.

File details

Details for the file vector_ta-0.1.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vector_ta-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1130f55e62270dfb36dc07c8c1297a22bfda0a76ce55941af9216f7838287c50
MD5 4fc177eff50f38059c6dddab0eedbda0
BLAKE2b-256 f643ec9b7033b3d8b7e15f7660183d34ece59e93fb4cd2e82a11fe7835e7ca92

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