RicardoSantos

[RS]Point And Figure Overlay V0

Point and Figure Overlay:
  • tf: time frame to use.
  • mode: ATR or Traditional.
  • modeValue: can be whole number for ATR mode(ex:.15) or floating point value for Traditional(ex:.0.12345).
  • reversal: number of reversal bricks.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
study("[RS]Point And Figure Overlay V0", shorttitle="[RS]PFO.V0", overlay=true)
tf = input('D')
mode = input('ATR')
modeValue = input(14.00, type=float)
reversal = input(1)

pf = pointfigure(tickerid, 'close', mode, modeValue, reversal)
pfh = pointfigure(tickerid, 'high', mode, modeValue, reversal)
pfl = pointfigure(tickerid, 'low', mode, modeValue, reversal)

spfo = security(pf, tf, open)
spfc = security(pf, tf, close)
spfh = security(pfh, tf, high)
spfl = security(pfl, tf, low)

p1 = plot(spfo, color=gray)
p2 = plot(spfc, color=black)

osc = spfc > spfo ? spfc : spfo
p0 = plot(osc, color=gray)

fill(p0, p1, color=green, transp=70)
fill(p0, p2, color=maroon, transp=70)

t0 = plot(max(spfo, spfc), color=silver)
t1 = plot(spfh, color=silver)
b0 = plot(min(spfo, spfc), color=silver)
b1 = plot(spfl, color=silver)

fill(t0, t1, color=maroon, transp=40)
fill(b0, b1, color=green, transp=40)