In his article, “Predictive And Successful Indicators,” author John Ehlers presents two new indicators: the SuperSmoother filter, which is superior to moving averages for removing aliasing noise, and the MESA Stochastic oscillator, a stochastic successor that removes the effect of spectral dilation through the use of a roofing filter.
To demonstrate the effects of using the new indicators, Ehlers introduces a simple countertrend system that goes long when MESA Stochastic crosses below the oversold value and reverses the trade by taking a short position when the oscillator exceeds the overbought threshold.
This stochastic oscillator eliminate noises a lot and then make reading of this oscillator more convenient with a clearer view. Because of smoothing / lag phenomena, this indicator must be used in convergence with other indicator to give good signals. Another ways of using it for counter trend trades would be to directly enter trade when the oscillator cross the oversold area for a buy order and the overbought area for a short sell order.
//PRC_MyStochastic J.Ehlers | indicator
//03.11.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from EasyLanguage version
// --- parameters
Length = 20
if barindex>Length then
//Highpass Filter cyclic components whose periods are shorter than 48 bars
alpha1 = (Cos(.707*360 / 48) + Sin(.707*360 / 48) - 1) / Cos(.707*360 / 48)
HP = (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) + 2*(1 - alpha1)*HP[1] - (1 - alpha1)*(1 - alpha1)*HP[2]
//Smooth with a Super Smoother Filter
a1 = exp(-1.414*3.14159 / 10)
b1 = 2*a1*Cos(1.414*180 / 10)
c2 = b1
c3 = -a1*a1
c1 = 1 - c2 - c3
Filt = c1*(HP + HP[1]) / 2 + c2*Filt[1] + c3*Filt[2]
HighestC = Filt
LowestC = Filt
For count = 0 to Length - 1 do
If Filt[count] > HighestC then
HighestC = Filt[count]
endif
If Filt[count] < LowestC then
LowestC = Filt[count]
endif
Next
Stoc = (Filt - LowestC) / (HighestC - LowestC)
MyStochastic = c1*(Stoc + Stoc[1]) / 2 + c2*MyStochastic[1] + c3*MyStochastic[2]
endif
RETURN MyStochastic as "My Stochastic", 0.8 as "0.8 level", 0.2 as "0.2 level"