Skip to main content

High-performance tick-to-bar aggregator — 6.7M ticks/s, 1.4× pandas

Project description

tickbar

Crates.io PyPI Rust 2024

High-performance tick-to-bar aggregator for financial market data.

Converts raw trade/quote ticks into OHLCV bars with configurable time alignment, gap filling, VWAP, and corporate action adjustments. One-pass state machine — 119M ticks/s native Rust, 6.7M ticks/s from Python (PEP 3118 buffer protocol).


Features

  • Fast — 119M ticks/s (Rust), 6.7M ticks/s (Python zero-copy)
  • One-pass streaming — no windowing, no sorting
  • VWAP per bar
  • Gap filling + forward fill
  • Multi-symbol parallel (rayon)
  • Time alignment — UTC or custom offset
  • Corporate actions — split/dividend backward adjustment
  • Export — CSV, Arrow IPC, Polars DataFrame
  • Memory-mapped I/OMmapTickReader
  • Python bindings — zero-copy via PEP 3118 buffer protocol

Quick start

Rust

use std::time::Duration;
use tickbar::{TickAggregator, Tick};

let mut agg = TickAggregator::builder()
    .interval(Duration::from_secs(60))
    .symbol("AAPL")
    .build()?;

agg.push_tick(Tick::from_trade(0, 100.0, 1000.0))?;
agg.push_tick(Tick::from_trade(1_000_000_000, 100.5, 500.0))?;
let bars = agg.finalize();

Python

from tickbar import TickAggregator, Tick

agg = TickAggregator(interval_secs=60)
agg.push_tick(Tick(0, 100.0, 1000.0))
agg.push_tick(Tick(1_000_000_000, 100.5, 500.0))
bars = agg.finalize()

Performance

Path Throughput vs pandas
Rust native 119M ticks/s 25×
Python buffer (PEP 3118) 6.7M ticks/s 1.4×
pandas resample 4.7M ticks/s 1.0×

Documentation

Installation

[dependencies]
tickbar = "0.1"
pip install tickbar

License

MIT

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

tickbar-0.1.0.tar.gz (43.6 kB view details)

Uploaded Source

Built Distributions

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

tickbar-0.1.0-cp311-abi3-win_amd64.whl (145.3 kB view details)

Uploaded CPython 3.11+Windows x86-64

tickbar-0.1.0-cp311-abi3-manylinux_2_34_x86_64.whl (248.3 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.34+ x86-64

tickbar-0.1.0-cp311-abi3-macosx_11_0_arm64.whl (221.2 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file tickbar-0.1.0.tar.gz.

File metadata

  • Download URL: tickbar-0.1.0.tar.gz
  • Upload date:
  • Size: 43.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for tickbar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 007a417022fac76568cbd0ac7d114ea11c580160f6617523a740a8a82a80a3a5
MD5 57533b576741124d54a25c1483c209b7
BLAKE2b-256 6d2190bbd93f035c62a546dc302c723ce3b48af4bc5b7bf412a8c0c951350645

See more details on using hashes here.

File details

Details for the file tickbar-0.1.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: tickbar-0.1.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 145.3 kB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for tickbar-0.1.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8e20bed9d36dffd7172f0866111a33b1f6bb2ae3ecfbb15edd234034321f84f8
MD5 a284a5c96bc9084051fed1ecc89229eb
BLAKE2b-256 5c5efcf79271a93e5e9b7e574c3a4eac417c4808fb601b1d2b9504c40ce550a0

See more details on using hashes here.

File details

Details for the file tickbar-0.1.0-cp311-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tickbar-0.1.0-cp311-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 755ab3fb2d40e57dbb643c4b016b12a7a56b7568315de67fe82d8d1c3bfd5875
MD5 9a760827db94288259f5fd1e8af0ba65
BLAKE2b-256 d0ac6d5d889a9314c8bf913e9e5f4bfbc58e5716819cffcf542df00d649ec9f1

See more details on using hashes here.

File details

Details for the file tickbar-0.1.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tickbar-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5272706206865ffc15ff3744b0612171618bfaf80d4d3f99df2c4414217e0a89
MD5 5d8fcea0e4408eb73ce5ec29ad7560bf
BLAKE2b-256 8916c8c575ef806009d0c93dc1a1252067506bdcd2543b2f0e10c448a250e72a

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