RSI-Laguerre using an exponent of price (found in the thinkscript lounge archive)
15:40 Mobius: Frank... This is RSI-Laguerre using an exponent of price. It's several bars faster at the same lengths.
15:40 Mobius: And, It will still positive signals at lengths as low as 4.
15:41 Mobius: still make positive signals .......
15:42 Mobius: Nothing particulalry smooth about it though. That was just a by-product of TOS normalizing the MA line when you stuck it in RSIL and not a real picture of what it was doing
15:44 AlphaInvestor: Thanks Mobius - another toy for the toolbox
15:45 UpTheCreek: ^^^ ditto
15:40 Mobius: Frank... This is RSI-Laguerre using an exponent of price. It's several bars faster at the same lengths.
15:40 Mobius: And, It will still positive signals at lengths as low as 4.
15:41 Mobius: still make positive signals .......
15:42 Mobius: Nothing particulalry smooth about it though. That was just a by-product of TOS normalizing the MA line when you stuck it in RSIL and not a real picture of what it was doing
15:44 AlphaInvestor: Thanks Mobius - another toy for the toolbox
15:45 UpTheCreek: ^^^ ditto
Code:
# RSIL_ExponentOfPrice_V09_2022_10_20_Mobius
#
# RSI in Laguerre Time Self Adjusting With Fractal Energy
# Mobius
# V03.06.15.2016
# Both Fractal Energy and RSI are plotted. RSI in cyan and FE in yellow. Look for trend exhaustion in the FE and a reversal of RSI or Price compression in FE and an RSI reversal.
# V09.10.20.2022
# Altered iData to Exponent of price.
# Faster at the same length settings and able to produce absolute signals at lengths as short as 4.
declare lower;
#Inputs:
input nFE = 13;#hint nFE: length for Fractal Energy calculation.
# Variables:
def o;
def h;
def l;
def c;
def cl;
def CU1;
def CU2;
def CU;
def CD1;
def CD2;
def CD;
def L0;
def L1;
def L2;
def L3;
plot RSI;
plot OS;
plot OB;
# Calculations
O = open / (open[2] / open[1]);
H = high / (high[2] / high[1]);
L = low / (low[2] / low[1]);
Cl = close / (close[2] / close[1]);
c = (h+l+Cl)/3;
## GAMMA CALC & PLOT (comment by jq)
plot gamma = Log(Sum((Max(H, C[1]) - Min(L, C[1])), nFE) /
(Highest(H, nFE) - Lowest(L, nFE)))
/ Log(nFE);
gamma.SetDefaultColor(Color.Yellow);
L0 = (1 – gamma) * c + gamma * L0[1];
L1 = -gamma * L0 + L0[1] + gamma * L1[1];
L2 = -gamma * L1 + L1[1] + gamma * L2[1];
L3 = -gamma * L2 + L2[1] + gamma * L3[1];
## DEFINES CU1 & CD2 FOR CU2 & CD2 (comment by jq)
if L0 >= L1
then {
CU1 = L0 - L1;
CD1 = 0;
} else {
CD1 = L1 - L0;
CU1 = 0;
}
## DEFINES CU2 & CD2 FOR CU & CD (comment by jq)
if L1 >= L2
then {
CU2 = CU1 + L1 - L2;
CD2 = CD1;
} else {
CD2 = CD1 + L2 - L1;
CU2 = CU1;
}
## DEFINES CU & CD FOR S (comment by jq)
if L2 >= L3
then {
CU = CU2 + L2 - L3;
CD = CD2;
} else {
CU = CU2;
CD = CD2 + L3 - L2;
}
def s = CU / (CU + CD);
## RSI PLOT (comment by jq)
RSI = if CU + CD <> 0 then s else 0;
RSI.SetDefaultColor(Color.Cyan);
## RSI BANDS (comment by jq)
OS = if IsNaN(close) then Double.NaN else 0.2;
OS.SetDefaultColor(Color.Gray);
OS.HideBubble();
OS.HideTitle();
OB = if IsNaN(close) then Double.NaN else 0.8;
OB.SetDefaultColor(Color.Gray);
OB.HideBubble();
OB.HideTitle();
## FRACTAL ENERGY BANDS (comment by jq)
plot FEh = if isNaN(close) then double.nan else .618;
FEh.SetStyle(Curve.Long_Dash);
FEh.HideBubble();
FEh.SetDefaultColor(Color.Dark_Gray);
FEh.HideTitle();
plot FEl = if isNaN(close) then double.nan else .382;
FEl.SetStyle(Curve.Long_Dash);
FEl.SetDefaultColor(Color.Dark_Gray);
FEl.HideBubble();
FEl.HideTitle();
## CLOUDS (comment by jq)
AddCloud(0, OS, Color.Green, Color.Green);
AddCloud(OB, 1, Color.Red, Color.Red);
## ALERTS ( comment by jq)
Alert(RSI crosses below .9, "", Alert.BAR, Sound.Bell);
Alert(RSI crosses above .1, "", Alert.BAR, Sound.Bell);
# End Code RSI_Laguerre Self Adjusting with Fractal Energy
Last edited: