Skip to main content

Module resample

Module resample 

Source
Expand description

Deterministic tick-to-bar aggregation shared by stored bars and in-memory replay series.

Historical replay builds its analysis bars from ticks while it runs, and a research workflow needs the same bars on disk so that a parameter search over bars agrees with a confirmation run over ticks. Both paths therefore use the bucket arithmetic and accumulation rules in this module, and a parity test asserts that they produce identical bars for the same input.

The module is intentionally free of storage and dataframe dependencies so that it compiles for consumers that only need the models.

Structs§

BarAggregator
Accumulates ticks into fixed-duration bars using the replay engine’s bucket rules.
BucketSpec
Fixed-duration bucket geometry.

Enums§

PriceBasis
Quote side used to derive one bar price from a tick.

Functions§

bucket_bounds
Half-open [open, close) bucket containing timestamp.
is_executable_quote
Whether a two-sided quote is executable, matching the replay feed’s acceptance rule.