The Triple Sine Oscillator is a responsive mean reversion indicator. Due to the math of the sine cubed function, smaller changes around the mean cause larger movement of the indicator; and conversely smaller moves near the peaks. This causes the indicator to quickly and decisively show reversion from the mean.
More here: https://www.mql5.com/en/articles/20220
LOWER STUDY BELOW:
More here: https://www.mql5.com/en/articles/20220
Code:
# Triple-Sine Oscillator
# by whoDAT 1/2026
declare lower;
input Periods = 20; # Period for SMA and StdDev
input Sensitivity = 0.5; # Sensitivity multiplier
# --- Moving Average and Standard Deviation
def ma = Average(close, Periods);
def sd = StDev(close, Periods);
# --- Prevent division by zero
def ScaledResult =
if sd != 0 then
Sensitivity * (close - ma) / sd
else
0;
# --- Triple Sine Function: (sin(x))^3
def TripleSine = Power(Sin(ScaledResult), 3);
# --- Plot
plot TSO = TripleSine;
TSO.SetDefaultColor(Color.LIGHT_GREEN);
# --- Reference Levels
plot Upper = 0.7;
plot Lower = -0.7;
plot Zero = 0;
Upper.SetDefaultColor(Color.GRAY);
Lower.SetDefaultColor(Color.GRAY);
Zero.SetDefaultColor(Color.GRAY);
Upper.SetStyle(Curve.SHORT_DASH);
Lower.SetStyle(Curve.SHORT_DASH);
Zero.SetStyle(Curve.LONG_DASH);
LOWER STUDY BELOW:
Last edited by a moderator: