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):
- streaming:
RangeBarBuilder::nextpushes one price, returns a bar when the current bar’s span completes (elseNone); - batch:
range_bars_batchfolds the builder over a price slice.
Structs§
- Range
Bar - One completed range bar. Its
high - lowis>= range_size. - Range
BarBuilder - 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
RangeBarBuilderover a price slice.