This is the Onset Trend Detector study, a NO-LAG oscillator that assesses trends by John F. Ehlers.
This oscillator combines two filters, the Super Smoother Filter and the Roofing Filter, also, designed by Ehlers.
The information from these filters goes through an automatic gain control algorithm and then undergoes a process called the quotient transform. This transform, regulated by the K coefficient, minimizes small oscillator values while maintaining higher values.
The upper study buy and sell signals are from:
https://usethinkscript.com/threads/supertrend-indicator-by-mobius-for-thinkorswim.7/ for confirmation
thinkScript Code
Shareable Link
https://tos.mx/aQbyVg
This oscillator combines two filters, the Super Smoother Filter and the Roofing Filter, also, designed by Ehlers.
The information from these filters goes through an automatic gain control algorithm and then undergoes a process called the quotient transform. This transform, regulated by the K coefficient, minimizes small oscillator values while maintaining higher values.
The upper study buy and sell signals are from:
https://usethinkscript.com/threads/supertrend-indicator-by-mobius-for-thinkorswim.7/ for confirmation
> Configure two lower studies
> [1] cutoffLength = 20 / k = 0.8
> [2] cutoffLength = 20 / k = 0.4
> Rules:
> [1] Buy when the first 30-period QT with K = 0.8 crosses 0 from below
> [2] Sell the position when the second 30-period QT with K = 0.4 crosses 0 from above
thinkScript Code
Rich (BB code):
declare lower;
input price = close;
input cutoffLength = 10;
input k = .8;
def alpha1 = (Cos(Sqrt(2) * Double.Pi / 100) + Sin (Sqrt(2) * Double.Pi / 100) - 1) / Cos(Sqrt(2) * Double.Pi / 100);
def highpass = if IsNaN(price + price[1] + price[2]) then highpass[1] else Sqr(1 - alpha1 / 2) * (price - 2 * price[1] + price[2]) + 2 * (1 - alpha1) * highpass[1] - Sqr(1 - alpha1) * highpass[2];
def filt = reference EhlersSuperSmootherFilter(highpass, cutoffLength);
def peak = if AbsValue(filt) > peak[1] * .991 then AbsValue(filt) else peak[1] * .991;
plot NormRoofingFilter = filt / peak;
plot Quotient = (NormRoofingFilter + k) / (k * NormRoofingFilter + 1);
plot ZeroLine = 0;
NormRoofingFilter.SetDefaultColor(GetColor(1));
Quotient.SetDefaultColor(GetColor(2));
ZeroLine.SetDefaultColor(GetColor(7));
Shareable Link
https://tos.mx/aQbyVg
Last edited by a moderator: