xmd79

Pivot Stochastic

Feb 2nd, 2022
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1.  
  2. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  3. // © joaodanielbatista
  4.  
  5. //@version=5
  6. indicator(title="Pivot Stochastic", shorttitle="PivotStoch", format=format.price, precision=2, max_bars_back = 5000)
  7. topLine = input.int(85,title="Top Line")
  8. bottomLine = input.int(15,title="Bottom Line")
  9. kPeriod = input.int(14)
  10. kSmooth = input.int(3, title="Smoothing K", minval=1)
  11. kSmoothF = input.int(1, title="Fast Smoothing K", minval=1)
  12. dPeriod = input.int(3, title="Period D", minval=1)
  13.  
  14.  
  15. PP = (high + low + close) / 3
  16. j = ta.sma(ta.stoch(close, high, low, kPeriod), kSmoothF)
  17. k = ta.sma(ta.stoch(close, high, low, kPeriod), kSmooth)
  18. d = ta.sma(k, dPeriod)
  19. pSr = j * PP /100
  20. pSs = k * PP/100
  21. hLine= close*topLine / 100
  22. lLine= close*bottomLine / 100
  23.  
  24.  
  25.  
  26. plot(pSr, title="Fast line", color=color.blue)
  27. plot(pSs, title="Low Line", color=color.orange)
  28. h1=plot(hLine, title="Top Line", color=color.yellow)
  29. l1=plot(lLine, title="Bottom Line", color=color.yellow)
Advertisement
Add Comment
Please, Sign In to add comment