xmd79

QQE Adv

Nov 20th, 2021
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. //@version=5
  2. indicator('QQE Adv')
  3.  
  4. RSI_Period = 8
  5. SF = 1
  6. QQE = 2.618
  7.  
  8. Wilders_Period = RSI_Period * 2 - 1
  9.  
  10. Rsi = ta.rsi(close, RSI_Period)
  11. blueLine = ta.ema(Rsi, SF)
  12. AtrRsi = math.abs(blueLine[1] - blueLine)
  13. MaAtrRsi = ta.ema(AtrRsi, Wilders_Period)
  14. dar = ta.ema(MaAtrRsi, Wilders_Period) * QQE
  15.  
  16. DeltaFastAtrRsi = dar
  17. RSIndex = blueLine
  18. newshortband = RSIndex + DeltaFastAtrRsi
  19. newlongband = RSIndex - DeltaFastAtrRsi
  20. longband = 0.0
  21. longband := RSIndex[1] > longband[1] and RSIndex > longband[1] ? math.max(longband[1], newlongband) : newlongband
  22. shortband = 0.0
  23. shortband := RSIndex[1] < shortband[1] and RSIndex < shortband[1] ? math.min(shortband[1], newshortband) : newshortband
  24. trend = 0.0
  25. trend := ta.cross(RSIndex, shortband[1]) ? 1 : ta.cross(longband[1], RSIndex) ? -1 : nz(trend[1], 1)
  26. orangeLine = trend == 1 ? longband : shortband
  27.  
  28. plot(orangeLine, color=color.new(#ffa500, 0), linewidth=2)
  29. plot(blueLine, color=color.new(#58CCED, 0), linewidth=2)
  30. hline(50)
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment