Expand description
Renko bar construction (close-based, Drozda et al. 2024 Definition 1).
A Renko brick spans a fixed height ΔP (the “box”); a new brick is created
only when the latest close leaves the current brick’s [min, max] band, so
small moves are filtered out. This follows the formal definition in:
Drozda, Cavojsky, Sebes (2024), “On Suitability of Renko Charts for
Algorithmic Trading”. Def. 1: the first brick R⁰ is anchored at the first
close p₀; a close above p_max creates an up-brick [p_max, p_max + ΔP]
and a close below p_min creates a down-brick [p_min − ΔP, p_min]
(adjacent, non-retracing); several bricks may be created for one close.
ΔP may vary per brick, so an ATR-derived box is the natural default.
A high/low-based variant (symmetric threshold |P(u) − P(τ)| = H) is used for
pairs trading in Bogomolov (2013), “Pairs trading based on statistical
variability of the spread process”, Quantitative Finance 13(9): 1411–1430;
this module implements the close-based Drozda definition.
Two surfaces kept in parity (see the proptest):
- streaming:
RenkoBuilder::nextpushes one close, returns 0+ new bricks; - batch:
renko_batchfolds the builder over a close slice.
Structs§
- Renko
Brick - One Renko brick.
directionis +1 (up) or -1 (down);open/closeare the brick’s price boundariesbox_sizeapart, in the direction of travel. - Renko
Builder - Stateful close-based Renko builder (Drozda et al. 2024, Def. 1) with a fixed box size.
Functions§
- renko_
atr_ batch - ATR-box Renko: box size is
multiplier * atr, a single representative volatility value (Drozda et al. use ATR as the default box). Per Def. 1 the box may vary per brick; a fixed box per run keeps boundaries reproducible. - renko_
batch - Batch Renko: fold
RenkoBuilderover a close slice, returning all bricks.