Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- study(title = "POC bands 2.0 Slope", shorttitle="POCB_S", overlay=false)
- resCustom = input(title="Timeframe", type=resolution, defval="240")
- Length = input(6, minval=1)
- xPrice = security(tickerid, resCustom, hlc3)
- xvnoise = abs(xPrice - xPrice[1])
- nfastend = 0.666
- nslowend = 0.0645
- nsignal = abs(xPrice - xPrice[Length])
- nnoise = sum(xvnoise, Length)
- nefratio = iff(nnoise != 0, nsignal / nnoise, 0)
- nsmooth = pow(nefratio * (nfastend - nslowend) + nslowend, 2)
- nAMA = nz(nAMA[1]) + nsmooth * (xPrice - nz(nAMA[1]))
- basis = nAMA
- slope = change(basis, 1)
- signalcolor = slope > slope[1] ? yellow : orange
- plot(slope, style=histogram, color=signalcolor, transp=40)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement