Builds a ticker id that serves a Point and Figure chart for a symbol, from a box size and a reversal count.
ticker.pointfigure(symbol, source, style, param, reversal) returns an id that request.security turns into a Point and Figure series. Columns of X (rising) and O (falling) boxes are drawn; a column flips only after a move of reversal boxes the other way.
Time plays no part, so a column can span many bars or form in one.
Syntax
ticker.pointfigure(symbol: simple string, source: simple string, style: simple string, param: simple int/float, reversal: simple int) -> simple string
ticker.pointfigure(symbol: series string, source: series string, style: series string, param: series int/float, reversal: series int) -> series stringArguments
| Name | Type | Default | Description |
|---|---|---|---|
| symbol | simple/ | required | The ticker id to convert, such as syminfo.tickerid. |
| source | simple/ | required | The price the columns are built from: "hl" (highs and lows) or "close". |
| style | simple/ | required | How the box size is set: "ATR" or "Traditional". |
| param | simple/ | required | The ATR length for "ATR", or the box size in price units for "Traditional". |
| reversal | simple/ | required | How many boxes price must move against the current column to start a new one. Three is the classic value. |
Returns
simple/series string: A ticker id string. Pass it to request.security as its symbol argument.
Remarks
- All five arguments are required.
Example
//@version=6
indicator("P&F close", overlay = true)
pfId = ticker.pointfigure(syminfo.tickerid, "close", "ATR", 14, 3)
pfClose = request.security(pfId, timeframe.period, close)
plot(close, "Close", color.gray)
plot(pfClose, "P&F close", color.orange, style = plot.style_stepline)See also
Runs on Sidechair