Advertisement
Guest User

POC ma slope

a guest
Sep 27th, 2015
568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. study(title = "POC bands 2.0 Slope", shorttitle="POCB_S", overlay=false)
  2. resCustom = input(title="Timeframe", type=resolution, defval="240")
  3. Length = input(6, minval=1)
  4. xPrice = security(tickerid, resCustom, hlc3)
  5. xvnoise = abs(xPrice - xPrice[1])
  6. nfastend = 0.666
  7. nslowend = 0.0645
  8. nsignal = abs(xPrice - xPrice[Length])
  9. nnoise = sum(xvnoise, Length)
  10. nefratio = iff(nnoise != 0, nsignal / nnoise, 0)
  11. nsmooth = pow(nefratio * (nfastend - nslowend) + nslowend, 2)
  12. nAMA = nz(nAMA[1]) + nsmooth * (xPrice - nz(nAMA[1]))
  13. basis = nAMA
  14. slope = change(basis, 1)
  15. signalcolor = slope > slope[1] ? yellow : orange
  16. plot(slope, style=histogram, color=signalcolor, transp=40)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement