indicator · own pane · open source
Adaptive RSI indicator
Adaptive RSI is a free open-source indicator. Adaptive RSI — Kaufman's Efficiency Ratio drives the RSI length. Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Adaptive RSI does
Adaptive RSI — Kaufman's Efficiency Ratio drives the RSI length. In choppy markets the RSI looks at 100 bars (almost noise); in trends it tightens to ~20 bars so it actually turns with price.
- Same 30/70 extremes, but they fire more reliably than fixed-length RSI.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Adaptive RSI", overlay=false)
len = input.int(14, "Base length", minval=5, maxval=100)
colorBg = input.color("color.purple", "Color Bg")
colorNeutral = input.color("color.gray", "Color Neutral")
cumAbs = ta.cum(math.abs(ta.change(close)))
sumAbs = cumAbs - cumAbs[len]
er = math.abs(close - close[len]) / math.max(sumAbs, 0.0001)
alpha = math.max(0.01, er)
adaptLen = na(er) ? 50 : math.max(20, math.min(100, math.round(1 / alpha)))
adaptRsi = ta.rsi(close, math.max(2, adaptLen))
hline(70, "OB", color=colorNeutral)
hline(30, "OS", color=colorNeutral)
p_Adaptive_RSI = plot(adaptRsi, "Adaptive RSI", color=colorBg, linewidth=2)
alertcondition(ta.crossover(adaptRsi, 70), "Adaptive OB", "Adaptive RSI above 70")
alertcondition(ta.crossunder(adaptRsi, 30), "Adaptive OS", "Adaptive RSI below 30")
No comments yet.
Sign in to comment.