Renko "bricks" are time-agnostic blocks built purely from price
movement. A new brick appears only after price has moved at least
brickSize from the previous brick's close.
The output conforms to the Candle shape so it can feed straight
into OHLCVChart, but:
t is the timestamp of the SOURCE candle that triggered the brick
o is the previous brick's close
c = o ± brickSize (up or down)
h/l equal the extremes of o and c
v is 0 (bricks don't correspond to a single source bar)
This is the classic "one brick per move" variant — gaps larger than
brickSize emit multiple stacked bricks in the same direction.
Reversal behavior: to flip direction, price must move 2 * brickSize
from the last brick's close (one brick to cancel the current run,
one brick to start the new run). This matches TradingView's default.
Renko "bricks" are time-agnostic blocks built purely from price movement. A new brick appears only after price has moved at least
brickSizefrom the previous brick's close.The output conforms to the
Candleshape so it can feed straight into OHLCVChart, but:tis the timestamp of the SOURCE candle that triggered the brickois the previous brick's closec = o ± brickSize(up or down)h/lequal the extremes ofoandcvis 0 (bricks don't correspond to a single source bar)This is the classic "one brick per move" variant — gaps larger than
brickSizeemit multiple stacked bricks in the same direction.Usage:
const bricks = toRenko(rawCandles, 50); chart.setData(bricks);
Reversal behavior: to flip direction, price must move 2 * brickSize from the last brick's close (one brick to cancel the current run, one brick to start the new run). This matches TradingView's default.