Examples#

Runnable notebooks, grouped by task. Each one executes on real or seeded data at build time.

Getting started#

Quickstart: the polymorphic API

One operator on scalars, arrays, and live streams.

Polymorphic input: arrays, lists, scalars, and generators
NaN handling

How missing values flow through operators and warm up.

NaN handling

Statistics & indicators#

Window statistics

Rolling mean, dispersion, quantiles, and ranks.

Window statistics: rolling, exponential, expanding
Financial indicators

Moving averages, momentum, bands, and volume.

Financial indicators: several inputs and outputs
Signal processing

Filters and smoothers on noisy series.

Denoising filters: a comparison

Streaming & pipelines#

Streaming live events

Feed events one at a time from an iterator or generator.

Streaming live events
Multi-stream operators

Align and combine streams that do not tick together.

Multi-stream operators
Pipelines

Wire operators into a reusable graph.

Pipelines
Bars from ticks

Resample a trade tape into OHLC bars.

Bars from ticks: bucketing and aggregations
Custom and multi-column bars

Build bespoke bar aggregations.

Custom and multi-column bars

Market microstructure#

Order flow and trade signs

Recover trade direction and order-flow imbalance.

Microstructure I: order flow, trade signs, and imbalance
Price impact and liquidity

Kyle's lambda, Amihud, Roll spread, and the propagator.

Microstructure II: price impact and liquidity
Toxicity, book pressure, and spreads

VPIN, queue imbalance, micro-price, and spread decomposition.

Microstructure III: toxicity, book pressure, and spreads

Backtesting#

Backtesting a signal

From a position signal to a costed equity curve.

Backtesting a signal: from indicator to a costed equity curve
Event-driven backtests

Fills on bars, the trade tape, and top-of-book quotes.

Event-driven backtests: bars, tape, and quotes

Machine learning#

Supervised forecasting

Build a leak-safe training set with forecast_pairs, fit, and backtest.

Supervised forecasting with forecast_pairs