Sidechair

ticker.renko()

Browse the reference

Builds a ticker id that serves Renko bricks for a symbol, sized by ATR or by a fixed box size.

Try it in the editor

ticker.renko(symbol, style, param) returns an id that request.security can turn into a Renko series. A brick forms only when price moves a full brick size from the last brick, so time does not matter and several bricks can come from one bar.

Renko bars are not tied to calendar bars, so a value taken from one is aligned to the chart bar on which it forms.

Syntax

Pine Script
ticker.renko(symbol: simple string, style: simple string, param: simple int/float, request_wicks: simple bool (optional), source: simple string (optional)) -> simple string
ticker.renko(symbol: series string, style: series string, param: series int/float, request_wicks: series bool (optional), source: series string (optional)) -> series string

Arguments

NameTypeDefaultDescription
symbolsimple/series stringrequiredThe ticker id to convert, such as syminfo.tickerid.
stylesimple/series stringrequiredHow the brick size is set: "ATR" (param is an ATR length) or "Traditional" (param is a fixed price size).
paramsimple/series int/floatrequiredThe ATR length for "ATR", or the brick size in price units for "Traditional".
request_wickssimple/series boolfalseWhen true, the bricks carry wicks that show the price range inside them.
sourcesimple/series string"Close"The price the bricks are built from: "Close" or "HL" (highs and lows).

Returns

simple/series string: A ticker id string. Pass it to request.security as its symbol argument.

Remarks

  • The "ATR" size is recalculated when bricks form, so it changes slowly. "Traditional" stays fixed.

Example

Pine ScriptRenko close with an ATR brickOpen in editor
//@version=6
indicator("Renko close", overlay = true)
renkoId = ticker.renko(syminfo.tickerid, "ATR", 14)
renkoClose = request.security(renkoId, timeframe.period, close)
plot(close, "Close", color.gray)
plot(renkoClose, "Renko close", color.orange, style = plot.style_stepline)

See also

Runs on Sidechair