SHARE
TWEET

RSI & MACD Aligned [LazyBear]

lazybeartv Aug 24th, 2016 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //@version=2
  2. study("RSI & MACD Aligned [LazyBear]", shorttitle="NORMRSIMACD_LB", precision=5)
  3. src=input(close)
  4. fastLen=input(12), slowLen=input(26), signal=input(9)
  5.  
  6. mult=input(2, title="Stdev Multiplier")
  7. lb=input(20, title="Stdev Lookback Period")
  8.  
  9. calc_norm(src, mult, length,center) =>
  10.     offs=mult*stdev(src, length)
  11.     u=center+offs, l=center-offs
  12.     nr=(src-l)/(u-l)
  13.     nr
  14.  
  15.  
  16. rsiLen=input(14), rsiSignalLen=input(9)
  17. r=rsi(src,rsiLen)
  18. [m,s,_]=macd(src, fastLen, slowLen, signal)
  19.  
  20. r:=calc_norm(r, mult,lb, 50), rs=ema(r, rsiSignalLen)
  21. m:=calc_norm(m, mult,lb, 0), s:=calc_norm(s, mult,lb, 0)
  22.  
  23. hline(1.0,color=gray), hline(0,color=gray), hline(0.5, color=gray, linewidth=2)
  24. plot(r, color=black, linewidth=2, title="RSI"), plot(rs, color=gray, linewidth=2, title="RSISignal")
  25. plot(m, color=blue, linewidth=1, title="MACD"), plot(s, color=orange, linewidth=1, title="MACDSignal")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top