Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- indicator('QQE Adv')
- RSI_Period = 8
- SF = 1
- QQE = 2.618
- Wilders_Period = RSI_Period * 2 - 1
- Rsi = ta.rsi(close, RSI_Period)
- blueLine = ta.ema(Rsi, SF)
- AtrRsi = math.abs(blueLine[1] - blueLine)
- MaAtrRsi = ta.ema(AtrRsi, Wilders_Period)
- dar = ta.ema(MaAtrRsi, Wilders_Period) * QQE
- DeltaFastAtrRsi = dar
- RSIndex = blueLine
- newshortband = RSIndex + DeltaFastAtrRsi
- newlongband = RSIndex - DeltaFastAtrRsi
- longband = 0.0
- longband := RSIndex[1] > longband[1] and RSIndex > longband[1] ? math.max(longband[1], newlongband) : newlongband
- shortband = 0.0
- shortband := RSIndex[1] < shortband[1] and RSIndex < shortband[1] ? math.min(shortband[1], newshortband) : newshortband
- trend = 0.0
- trend := ta.cross(RSIndex, shortband[1]) ? 1 : ta.cross(longband[1], RSIndex) ? -1 : nz(trend[1], 1)
- orangeLine = trend == 1 ? longband : shortband
- plot(orangeLine, color=color.new(#ffa500, 0), linewidth=2)
- plot(blueLine, color=color.new(#58CCED, 0), linewidth=2)
- hline(50)
Advertisement
Add Comment
Please, Sign In to add comment