Advertisement
Guest User

DT Oscillator [LazyBear]

a guest
Sep 12th, 2014
8,052
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. //
  2. // @author LazyBear
  3. // List of all my indicators:
  4. // https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
  5. //
  6. study("DT Oscillator [LazyBear]", shorttitle="DTOsc_LB")
  7. rsiLength = input(13, title="RSI period")
  8. stochLength=input(8, title="Stoch period")
  9. maType = input(1, title="MA type: 1=>SMA, 2=>EMA")
  10. kPeriod = input(5, title="K period")
  11. dPeriod = input(3, title="D period")
  12. upper = input(70, title="Upper band")
  13. lower = input(30, title="Lower band")
  14. src=close
  15. WiMA(src, length) =>
  16. ms=(src + nz(ms[1] * (length-1)))/length
  17. ms
  18.  
  19. ma(ma, s, l) =>
  20. ma == 1? sma(s,l) : ema(s,l)
  21.  
  22.  
  23. stoRSI = 100*(( WiMA( src, rsiLength) - lowest( WiMA( src, rsiLength ) , stochLength ) ) / ((highest( WiMA( src, rsiLength) , stochLength ) ) - lowest(WiMA( src, rsiLength ), stochLength)))
  24. sk=ma(maType, stoRSI,kPeriod)
  25. sd=ma(maType, sk, dPeriod)
  26.  
  27. plot(sk, color=blue, title="DTOscK")
  28. plot(sd, color=gray, title="DTOscD")
  29. plot (50)
  30. ul = plot(upper, color=red)
  31. ll = plot(lower, color=green)
  32. fill(ul, ll)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement