RSI Laguerre with Fractal Energy for ThinkorSwim

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


1699328318218.png



# 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
 
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


View attachment 20107


# 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
Now that is fast! This is an adaptation of the ORIGINAL Mobius RSI that was introduced in Theotrade in 2016. Great for Day Traders. Thanks for finding this form the archive.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
573 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top