Skip to main content

Module range_bars

Module range_bars 

Source
Expand description

Range bar construction (price → constant-range OHLC bars).

A range bar closes as soon as its high-low span reaches range_size, then a new bar opens at the price that triggered the close. Like Renko this discards time; unlike Renko it keeps full OHLC per bar.

Two surfaces kept in parity (see the proptest):

Structs§

RangeBar
One completed range bar. Its high - low is >= range_size.
RangeBarBuilder
Stateful constant-range bar builder.

Functions§

range_bars_atr_batch
ATR-range bars: range size is multiplier * atr (a single representative ATR).
range_bars_batch
Batch range bars: fold RangeBarBuilder over a price slice.