indicator · own pane · open source
Adaptive Stochastic indicator
Adaptive Stochastic is a free open-source indicator by @deepwick. Adaptive Stochastic — the %K lookback widens in chop (fewer signals) and tightens in trend… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Adaptive Stochastic does
Adaptive Stochastic — the %K lookback widens in chop (fewer signals) and tightens in trend (more signals), driven by the Efficiency Ratio.
- Same 20/80 extremes, just better-timed.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Adaptive Stochastic", overlay=false)
len = input.int(14, "Base length", minval=5, maxval=100)
colorLine = input.color("color.blue", "Color Line")
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)
aLen = na(er) ? 14 : math.max(5, math.min(200, math.round(len * (1 - er / 2))))
kRaw = ta.stoch(close, high, low, aLen)
hline(80, "OB", color=colorNeutral)
hline(20, "OS", color=colorNeutral)
p_K = plot(kRaw, "K", color=colorLine)
alertcondition(ta.crossover(kRaw, 20), "Stoch above OS", "Adaptive stochastic crossed up from oversold")
alertcondition(ta.crossunder(kRaw, 80), "Stoch below OB", "Adaptive stochastic crossed down from overbought")
No comments yet.
Sign in to comment.