Builds a ticker id that serves Renko bricks for a symbol, sized by ATR or by a fixed box size.
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
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 stringArguments
| Name | Type | Default | Description |
|---|---|---|---|
| symbol | simple/ | required | The ticker id to convert, such as syminfo.tickerid. |
| style | simple/ | required | How the brick size is set: "ATR" (param is an ATR length) or "Traditional" (param is a fixed price size). |
| param | simple/ | required | The ATR length for "ATR", or the brick size in price units for "Traditional". |
| request_wicks | simple/ | false | When true, the bricks carry wicks that show the price range inside them. |
| source | simple/ | "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
//@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