GitHub - davidy749/tickflow: High-frequency financial time-series toolkit: tick/volume/dollar bars, realized-volatility estimators, microstructure and order-flow metrics in Python · GitHub
Skip to content

davidy749/tickflow

tickflow

CI Python License: MIT

Tools for analysing high-frequency financial time series in Python.

tickflow is a small, dependency-light toolkit of estimators for tick-level data: bar sampling, realized-volatility estimators (including noise-robust ones), microstructure and liquidity metrics, order-flow utilities, jump detection, and execution benchmarks. Everything is a plain function over NumPy arrays or a normalised pandas frame — no framework to learn, easy to drop into a notebook.

Install

pip install tickflow

Quick start

import pandas as pd
import tickflow as tf

trades = tf.read_trades(pd.read_csv("trades.csv"))

# information-driven bars
bars = tf.volume_bars(trades, volume=10_000)
close = bars["close"].to_numpy()

# realized volatility, annualised
print(tf.realized_volatility(close, annualize=252))

# noise-robust estimate at high sampling frequency
print(tf.realized_kernel(close, bandwidth=5))

# implied bid-ask spread from price reversals
print(tf.roll_spread(close))

What's inside

  • Bars — time, tick, volume and dollar bars (time_bars, tick_bars, volume_bars, dollar_bars)
  • Volatility — realized variance/vol, bipower variation, two-scale RV, realized kernel, HAR features
  • Microstructure — Roll spread, Corwin-Schultz, quoted/effective spread, Amihud illiquidity, Kyle's lambda
  • Order flow — VPIN toxicity
  • Order book — mid, weighted mid, microprice, order-flow imbalance, Lee-Ready classification
  • Jumps — Lee-Mykland test
  • Execution — VWAP, TWAP, implementation shortfall
  • CLItickflow rv and tickflow bars for quick CSV work

Documentation

License

MIT — see LICENSE.

About

High-frequency financial time-series toolkit: tick/volume/dollar bars, realized-volatility estimators, microstructure and order-flow metrics in Python

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

Contributors