The Ergodic oscillator is based on a true strength index by William Blau. It is a double smoothed candlestick oscillator made upon 2 sets of exponential moving average.
This indicator is acting pretty much like a stochastic oscillator, but with less compression in its oversold and overbought areas, which tends to identify more clearly the trend.
It comes with a signal line (in blue in the screenshot) for buy or sell signals triggers.
//parameters
R = 8
S = 5
SignalP = 5
ErgoSignalP = 3
MTM = Close-Close[1]
absMTM = ABS(MTM)
EMA1mtm = exponentialaverage[R](MTM)
EMA1absmtm = exponentialaverage[R](absMTM)
EMA2mtm = exponentialaverage[S](EMA1mtm)
EMA2absmtm = exponentialaverage[S](EMA1absmtm)
TSI = 100*EMA2mtm/EMA2absmtm
Signal = exponentialaverage[SignalP](TSI)
Ergodic = exponentialaverage[5](Signal)
ErgodicSignal = exponentialaverage[ErgoSignalP](Ergodic)
RETURN Ergodic coloured(0,0,210) as "Ergodic oscillator", ErgodicSignal coloured(210,0,0) as "Signal", 20 as "20", -20 as "-20"