RSI in Laguerre Time Self Adjusting With Fractal Energy Usage Notes

markos

markos

Well-known member
VIP
This short tutorial is an example of how to use the indicator as shown near the bottom of the Trend Reversals Indicator with Signals Thread.
The RSI Laguerre and FE (called CHOP in the example) are separated so that their action can be seen easier.

July, 2019 Version for TOS: RSI Laguerre Auto-Adjusted with Fractal Energy algorithm http://tos.mx/LldzdS Scan Code: http://tos.mx/bRLjdq

Code and Notes in next comment below .,..
Further toward the bottom are even more usage notes.




Further toward the bottom are usage notes from "Master Yoda" himself!
 
Last edited:
markos

markos

Well-known member
VIP
Chart: http://tos.mx/LldzdS

Usage Notes
Notes from zztop:

DISCLAIMER: Mobius mentioned that it was not his habit to give trading advice or even advice on how to use indicators. However, there's been such a proliferation of bad, inaccurate, false info regarding so many of them recently he felt compelled to give some accurate information.

Mobius©: I use a very simple method – RSI Laguerre and Fractal Energy on a list of very liquid stocks. I look for polarity change and trade when both RSI and FE are in “confluence”. If volatility is high enough I sell spreads if not I buy them. Other than hedging (which I do a lot of) that's it.
I like it simple.

The typical base setting I like to use for the FE is a length of 8. If I'm trading options I like to look at it about the length of time I'm buying or selling the option for. I want to know if it's reverting and where the energy is so I'll use a longer length for reversion and a shorter length to see if energy is building or waning.

If RSI Laguerre is descending and FE over .6, that tells me something is changing and I'm already looking at an equity I've determined is about to make a polarity change. So the worse case that happens is that the security grinds sideways for a few days.

A reading of the FE over .6 is an indication that energy has been built up. If the FE is high (over .6) and RSI LaGuerre is breaking lower FE will follow suit. If RSI reverses and goes above .8 I'm outa there, with the assumption I have a short position.

FE is a gauge of both mean reverting and linearity. Descending readings indicate a trend is on. A reading below .3 indicates exhaustion in trend or near exhaustion. A reading above .6 indicates moving sideways with rapid reversion and energy building for a move again.

Above .6 - Think price compression or squeeze
Below .3 - Think running out of gas

Here's an example:

FE at 60 periods is oscillating around .5 tightly while FE at 8 periods is over .6. Zscore is over 2 and is starting to roll over. That is a good short to the mean.

Short trade setup I look for with RSI Laguerre adjusted with FE:
1) Polarity Change - Equity has gone from making higher highs and higher lows to making a lower high and lower low and is now putting in another lower high
2) RSI Laguerre is above .8 and descending from 1
3) Fractal Energy is below .38 and nose down or above .6 and rolling over. In the first case, below .38, FE is indicating trend exahustion and RSI is likely showing as a peak and not running across pegged at 1. In the second case price has risen to a lower resistance and has been rolling slowly over building energy.

Mobius RSI LaGuerre with Fractal Energy Indicator:
Code:
# RSI-Laguerre Self Adjusting With Fractal Energy Gaussian Price Filter  # Mobius  # V01.12.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.
# Rename Study to RSILg_FE_Gssn1 for compatability with Scanning

declare lower;

#Inputs:
input nFE = 8;#hint nFE: length for Fractal Energy calculation.
input AlertOn = no;
input Glength  = 13;
input betaDev =  8;
input data = close;

def w = (2 * Double.Pi / Glength);
def beta = (1 - Cos(w)) / (Power(1.414, 2.0 / betaDev) - 1 );
def alpha = (-beta + Sqrt(beta * beta + 2 * beta));
def Go = Power(alpha, 4) * open +
             4 * (1 – alpha) * Go[1] – 6 * Power( 1 - alpha, 2 ) * Go[2] +
             4 * Power( 1 - alpha, 3 ) * Go[3] - Power( 1 - alpha, 4 ) * Go[4];
def Gh = Power(alpha, 4) * high +
             4 * (1 – alpha) * Gh[1] – 6 * Power( 1 - alpha, 2 ) * Gh[2] +
             4 * Power( 1 - alpha, 3 ) * Gh[3] - Power( 1 - alpha, 4 ) * Gh[4];
def Gl = Power(alpha, 4) * low +
             4 * (1 – alpha) * Gl[1] – 6 * Power( 1 - alpha, 2 ) * Gl[2] +
             4 * Power( 1 - alpha, 3 ) * Gl[3] - Power( 1 - alpha, 4 ) * Gl[4];
def Gc = Power(alpha, 4) * data +
             4 * (1 – alpha) * Gc[1] – 6 * Power( 1 - alpha, 2 ) * Gc[2] +
             4 * Power( 1 - alpha, 3 ) * Gc[3] - Power( 1 - alpha, 4 ) * Gc[4];
# Variables:
def o;
def h;
def l;
def c;
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;
plot M;

# Calculations
o = (Go + Gc[1]) / 2;
h = Max(Gh, Gc[1]);
l = Min(Gl, Gc[1]);
c = (o + h + l + Gc) / 4;
plot gamma = Log(Sum((Max(Gh, Gc[1]) - Min(Gl, Gc[1])), nFE) /
        (Highest(gh, nFE) - Lowest(Gl, nFE)))
            / Log(nFE);
gamma.SetDefaultColor(Color.Yellow);
L0 = (1 – gamma) * Gc + 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];
if L0 >= L1
then {
    CU1 = L0 - L1;
    CD1 = 0;
} else {
    CD1 = L1 - L0;
    CU1 = 0;
}
if L1 >= L2
then {
    CU2 = CU1 + L1 - L2;
    CD2 = CD1;
} else {
    CD2 = CD1 + L2 - L1;
    CU2 = CU1;
}
if L2 >= L3
then {
    CU = CU2 + L2 - L3;
    CD = CD2;
} else {
    CU = CU2;
    CD = CD2 + L3 - L2;
}

RSI = if CU + CD <> 0 then CU / (CU + CD) else 0;
RSI.SetDefaultColor(Color.Cyan);
OS = if IsNaN(c) then Double.NaN else 0.2;
OS.SetDefaultColor(Color.RED);
OS.HideBubble();
OS.HideTitle();
OB = if IsNaN(c) then Double.NaN else 0.8;
OB.SetDefaultColor(Color.GREEN);
OB.HideBubble();
OB.HideTitle();
M = if IsNaN(c) then Double.NaN else 0.5;
M.SetStyle(Curve.long_dash);
M.SetDefaultColor(Color.Gray);
M.HideBubble();
M.HideTitle();
plot FEh = if isNaN(c) then double.nan else .618;
FEh.SetStyle(Curve.short_DASH);
FEh.HideBubble();
FEh.SetDefaultColor(Color.GRAY);
FEh.HideTitle();
plot FEl = if isNaN(c) then double.nan else .382;
FEl.SetStyle(Curve.short_DASH);
FEl.SetDefaultColor(Color.GRAY);
FEl.HideBubble();
FEl.HideTitle();
AddCloud(0, OS, Color.RED, Color.RED);
AddCloud(OB, 1, Color.Green, Color.Green);
Alert(AlertOn and RSI crosses below .8, "", Alert.BAR, Sound.Bell);
Alert(AlertOn and RSI crosses above .2, "", Alert.BAR, Sound.Bell);

# End Code RSI_Laguerre Self Adjusting with Fractal Energy
Scan Code: http://tos.mx/bRLjdq
 
Last edited:
S

skynetgen

Active member
Warehouse
I must add FractalEnergy is amazing concept. Its great third addition to Volatility and Momentum( RSI/MACD) Based indicators
 
T

tomsk

Well-known member
VIP
@markos Several years ago I recall someone wrote up a RSI in Laguerre Time MTF
 
markos

markos

Well-known member
VIP
@markos Several years ago I recall someone wrote up a RSI in Laguerre Time MTF
I thought I saw Nube or JQ do one in the TSL. Either way, there should be one in the Onenote if it's been done. There are over 25 iterations of RSILg to be reviewed there.
Thanks @tomsk
 
markos

markos

Well-known member
VIP
@tomsk Here is the location of an RSI Laguerre MTF in the Onenote. There may be others scattered about but this is the only one in the RSILg area.
 
T

tomsk

Well-known member
VIP
I thought I saw Nube or JQ do one in the TSL. Either way, there should be one in the Onenote if it's been done. There are over 25 iterations of RSILg to be reviewed there.
Thanks @tomsk
@markos There are various variants of the RSI in laguerre time study with different extensions
My original comment was regarding RSI in Laguerre Time MTF, there are only 8 versions
I happen to have a change log of all 8 of them if this is the sort of thing you'd like to see
 
markos

markos

Well-known member
VIP
@tomsk Thanks for the reply. I was just referring to what JQ had in the ON.
Someone else may ask, however, as it seems a few of the newer day traders often ask about MTF studies.
If you're so inclined, go ahead and post on a new thread. I appreciate all the assistance you've given to this community!
 
T

tomsk

Well-known member
VIP
@tomsk Thanks for the reply. I was just referring to what JQ had in the ON.
Someone else may ask, however, as it seems a few of the newer day traders often ask about MTF studies.
If you're so inclined, go ahead and post on a new thread. I appreciate all the assistance you've given to this community!
@markos Ah yes indeed, I have been providing many of the scripts to JQ. Here's the link to the new thread I just started
Hope this helps

 
H

HighBredCloud

Active member
@markos Interesting... I will have to check this out...I know you wrote about the RSI LaGuerre and TMO...I've read most of what you had to say...I still need to fully understand how that particular indicator is designed to work. I have seen several versions of it over here and each looks a bit different than its previous version. Is there a best timeframe to use the RSI LaGuerre? Because on a 5 min or 15 min chart the signals seem to come in much later than other indicators making me think its more of a daily or weekly swing trade indicator vs intraday...I could be wrong tho.

EDIT: I just pulled up a few versions of the RSI...what is the proper settings for the indicator? I have one that only has an NFE option and that is set at 13 while another version has NFE is set at 8 glength set to 13 and beta dev to 8...both give different readings...

What is the best most up to date version of the RSI LaGuerre? I have like 5 of them and they are all different.

BTW...this is the most accurate version that I have seen of the RSI LaGuerre...what are your thoughts on this version? I think JQ enhanced it...


Code:
## PLEASE READ ALL NOTES.
## OneNote Archive Name: RSI in Laguerre Time Self Adjusting With Fractal Energy _Mobius_JQ
## Archive Section: Momentum
## Suggested Tos Name: RSI_LaguerreTime_v20180919_Mobius_JQvisuals
## Archive Date: 5.15.2018
## Archive Notes:
## "##" indicates an addition or adjustment by the OneNote Archivist
## Modified Code Follows:
## 5.15.2018  JQ added code to permit user to disable bull and or bear alerts
## 5.19.2018  JQ added AddChartBubbble code on FE plot
## 9.19.2018  JQ added color to RSI Line
## 8.26.2019  JQ Added Gamma.Hide at row 97 or 98.  Please Comment Out (#) if you want gamma back

# TheoTrade RSI in Laguerre Time Self Adjusting With Fractal Energy
# Mobius
# V03.06.15.2016
#combine with:
# RSI in Laguerre Time Self Adjusting With Fractal Energy
# Mobius
# V02.07.2014
# 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.

# Lounge Notes

#15:51 Mobius©: Short trade setup I look for with RSI Laguerre adjusted with FE.
#1) Polarity Change - Equity has gone from making higher highs and higher lows to making a lower high and lower low and is now putting in another lower high
#2) RSI Laguerre is above .8 and descending from 1
#3) Fractal Energy is below .38 and nose down or above .6 and rolling over. In the first case, below .38, FE is indicating trend exahustion and RSI is likely showing as a peak and not running across pegged at 1. In the second case Price has risen to a lower resistance and has been rolling slowly over building energy.

#Mobius©: I use a very simple method – RSI Laguerre and Fractal Energy on a list of very liquid stocks. I look for polarity change and trade when both RSI and FE are in “confluence”. If volatility is high enough I sell spreads if not I buy them. Other than hedging (which I do a lot of) that's it. I like it simple.

#The typical base setting I like to use for the FE is a length of 8. If I'm trading options I like to look at it about the length of time I'm buying or selling the option for. I want to know if it's reverting and where the energy is so I'll use a longer length for reversion and a shorter length to see if energy is building or waning.

#If RSI Laguerre is descending and FE over .6, that tells me something is changing and I'm already looking at an equity I've determined is about to make a polarity change. So the worse case that happens is that the security grinds sideways for a few days.

#A reading of the FE over .6 is an indication that energy has been built up. If the FE is high (over .6) and RSI LaGuerre is breaking lower FE will follow suit. If RSI reverses and goes above .8 I'm outa there, with the assumption I have a short position.

#FE is a gauge of both mean reverting and linearity. Descending readings indicate a trend is on.
#A reading below .3 indicates exhaustion in trend or near exhaustion.
#A reading above .6 indicates moving sideways with rapid reversion and energy building for a move again.
#Example:
#Above .6 - Think price compression or squeeze
#Below .3 - Think running out of gas

#Here's an example:

#FE at 60 periods is oscillating around .5 tightly while FE at 8 periods is over .6. Zscore is over 2 and is starting to roll over. That is a good short to the mean.
#Short trade setup I look for with RSI Laguerre adjusted with FE.

#1) Polarity Change - Equity has gone from making higher highs and higher lows to making a lower high and lower low and is now putting in another lower high
#2) RSI Laguerre is above .8 and descending from 1
#3) Fractal Energy is below .38 and nose down or above .6 and rolling over. In the first case, below .38, FE is indicating trend exhustion and RSI is likely showing as a peak and not running across pegged at 1. In the second case price has risen to a lower resistance and has been rolling slowly over building energy.

#Code Start

declare lower;

#Inputs:
input RSI_BullishTrigger = .2;
input RSI_BearishTrigger = .8;
input soundBullAlerts = no; ## 5.15.2018 new code
input soundBearAlerts = no; ## 5.15.2018 new code
input nFE = 13;#hint nFE: length for Fractal Energy calculation.

# Variables:
def o;
def h;
def l;
def c;
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 + close[1]) / 2;
h = Max(high, close[1]);
l = Min(low, close[1]);
c = (o + h + l + close) / 4;

plot gamma = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE) /

        (Highest(high, nFE) - Lowest(low, nFE)))

            / Log(nFE);
gamma.SetDefaultColor(Color.Yellow);
gamma.hide(); #Comment out Gamma.Hide it you want it to show.#

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];
if L0 >= L1

then {

    CU1 = L0 - L1;

    CD1 = 0;

} else {

    CD1 = L1 - L0;

    CU1 = 0;

}

if L1 >= L2

then {

    CU2 = CU1 + L1 - L2;

    CD2 = CD1;

} else {

    CD2 = CD1 + L2 - L1;

    CU2 = CU1;

}

if L2 >= L3

then {

    CU = CU2 + L2 - L3;

    CD = CD2;

} else {

    CU = CU2;

    CD = CD2 + L3 - L2;

}

RSI = if CU + CD <> 0 then CU / (CU + CD) else 0;

# RSI.SetDefaultColor(Color.Cyan);  #JQ Mobius original code
# RSI Painting code by JQ 2018.07.30

RSI.AssignValueColor(

        if (RSI > RSI_BearishTrigger) or ((RSI >= RSI[1]) and (RSI > RSI_BullishTrigger))

            then Color.GREEN

        else if (RSI < RSI_BUllishTrigger) or ((RSI < RSI[1]) and (RSI < RSI_BearishTrigger))

            then Color.RED

        else Color.white);

RSI.setlineWeight(2);


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();

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();

AddCloud(0, OS, Color.Red, Color.Red);
AddCloud(OB, 1, Color.Green, Color.Green);

Alert(soundBearAlerts and RSI crosses below .8, "", Alert.BAR, Sound.Ding); ## 5.15.2018 JQ added Boolean
Alert(soundBullAlerts and RSI crosses above .2, "", Alert.BAR, Sound.Ding) ;## 5.15.2018 JQ added Boolean

#  Labels below added by Johnny Quotron based on zztop notes above  2018-04-11

def FE = gamma;

#addlabel (FE < .382, " FE is Linear (Price Trending) = " + FE, Color.light_GREEN);
#addlabel (FE > .618, " FE is Non-Linear/Random (Trendless) = " + FE, Color.Light_GRAY);
#addlabel (FE <= .618 and FE >= .382, " FE is transitioning = " + FE, Color.Light_orange);

#AddChartBubble(!IsNaN(close) and IsNaN(close[-1]), FE, if FE < .382 then "Trending" else "Not Trending", Color.WHITE, yes);

#AddChartBubble(!IsNaN(close) and IsNaN(close[-1]), FE, if FE < .382 then "Trending" else if FE < .618 then "Transitioning" else "Building Energy", gamma.#takeValueColor(), yes); ## 5.19.2018 JQ

# End Code RSI_LaguerreTime_v20180919_Mobius_JQvisuals
 
Last edited:
markos

markos

Well-known member
VIP
@markos Interesting... I will have to check this out...I know you wrote about the RSI LaGuerre and TMO...I've read most of what you had to say...I still need to fully understand how that particular indicator is designed to work. I have seen several versions of it over here and each looks a bit different than its previous version. Is there a best timeframe to use the RSI LaGuerre? Because on a 5 min or 15 min chart the signals seem to come in much later than other indicators making me think its more of a daily or weekly swing trade indicator vs intraday...I could be wrong tho.

EDIT: I just pulled up a few versions of the RSI...what is the proper settings for the indicator? I have one that only has an NFE option and that is set at 13 while another version has NFE is set at 8 glength set to 13 and beta dev to 8...both give different readings...

What is the best most up to date version of the RSI LaGuerre? I have like 5 of them and they are all different.

BTW...this is the most accurate version that I have seen of the RSI LaGuerre...what are your thoughts on this version? I think JQ enhanced it...


Code:
## PLEASE READ ALL NOTES.
## OneNote Archive Name: RSI in Laguerre Time Self Adjusting With Fractal Energy _Mobius_JQ
## Archive Section: Momentum
## Suggested Tos Name: RSI_LaguerreTime_v20180919_Mobius_JQvisuals
## Archive Date: 5.15.2018
## Archive Notes:
## "##" indicates an addition or adjustment by the OneNote Archivist
## Modified Code Follows:
## 5.15.2018  JQ added code to permit user to disable bull and or bear alerts
## 5.19.2018  JQ added AddChartBubbble code on FE plot
## 9.19.2018  JQ added color to RSI Line
## 8.26.2019  JQ Added Gamma.Hide at row 97 or 98.  Please Comment Out (#) if you want gamma back

# TheoTrade RSI in Laguerre Time Self Adjusting With Fractal Energy
# Mobius
# V03.06.15.2016
#combine with:
# RSI in Laguerre Time Self Adjusting With Fractal Energy
# Mobius
# V02.07.2014
# 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.

# Lounge Notes

#15:51 Mobius©: Short trade setup I look for with RSI Laguerre adjusted with FE.
#1) Polarity Change - Equity has gone from making higher highs and higher lows to making a lower high and lower low and is now putting in another lower high
#2) RSI Laguerre is above .8 and descending from 1
#3) Fractal Energy is below .38 and nose down or above .6 and rolling over. In the first case, below .38, FE is indicating trend exahustion and RSI is likely showing as a peak and not running across pegged at 1. In the second case Price has risen to a lower resistance and has been rolling slowly over building energy.

#Mobius©: I use a very simple method – RSI Laguerre and Fractal Energy on a list of very liquid stocks. I look for polarity change and trade when both RSI and FE are in “confluence”. If volatility is high enough I sell spreads if not I buy them. Other than hedging (which I do a lot of) that's it. I like it simple.

#The typical base setting I like to use for the FE is a length of 8. If I'm trading options I like to look at it about the length of time I'm buying or selling the option for. I want to know if it's reverting and where the energy is so I'll use a longer length for reversion and a shorter length to see if energy is building or waning.

#If RSI Laguerre is descending and FE over .6, that tells me something is changing and I'm already looking at an equity I've determined is about to make a polarity change. So the worse case that happens is that the security grinds sideways for a few days.

#A reading of the FE over .6 is an indication that energy has been built up. If the FE is high (over .6) and RSI LaGuerre is breaking lower FE will follow suit. If RSI reverses and goes above .8 I'm outa there, with the assumption I have a short position.

#FE is a gauge of both mean reverting and linearity. Descending readings indicate a trend is on.
#A reading below .3 indicates exhaustion in trend or near exhaustion.
#A reading above .6 indicates moving sideways with rapid reversion and energy building for a move again.
#Example:
#Above .6 - Think price compression or squeeze
#Below .3 - Think running out of gas

#Here's an example:

#FE at 60 periods is oscillating around .5 tightly while FE at 8 periods is over .6. Zscore is over 2 and is starting to roll over. That is a good short to the mean.
#Short trade setup I look for with RSI Laguerre adjusted with FE.

#1) Polarity Change - Equity has gone from making higher highs and higher lows to making a lower high and lower low and is now putting in another lower high
#2) RSI Laguerre is above .8 and descending from 1
#3) Fractal Energy is below .38 and nose down or above .6 and rolling over. In the first case, below .38, FE is indicating trend exhustion and RSI is likely showing as a peak and not running across pegged at 1. In the second case price has risen to a lower resistance and has been rolling slowly over building energy.

#Code Start

declare lower;

#Inputs:
input RSI_BullishTrigger = .2;
input RSI_BearishTrigger = .8;
input soundBullAlerts = no; ## 5.15.2018 new code
input soundBearAlerts = no; ## 5.15.2018 new code
input nFE = 13;#hint nFE: length for Fractal Energy calculation.

# Variables:
def o;
def h;
def l;
def c;
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 + close[1]) / 2;
h = Max(high, close[1]);
l = Min(low, close[1]);
c = (o + h + l + close) / 4;

plot gamma = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE) /

        (Highest(high, nFE) - Lowest(low, nFE)))

            / Log(nFE);
gamma.SetDefaultColor(Color.Yellow);
gamma.hide(); #Comment out Gamma.Hide it you want it to show.#

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];
if L0 >= L1

then {

    CU1 = L0 - L1;

    CD1 = 0;

} else {

    CD1 = L1 - L0;

    CU1 = 0;

}

if L1 >= L2

then {

    CU2 = CU1 + L1 - L2;

    CD2 = CD1;

} else {

    CD2 = CD1 + L2 - L1;

    CU2 = CU1;

}

if L2 >= L3

then {

    CU = CU2 + L2 - L3;

    CD = CD2;

} else {

    CU = CU2;

    CD = CD2 + L3 - L2;

}

RSI = if CU + CD <> 0 then CU / (CU + CD) else 0;

# RSI.SetDefaultColor(Color.Cyan);  #JQ Mobius original code
# RSI Painting code by JQ 2018.07.30

RSI.AssignValueColor(

        if (RSI > RSI_BearishTrigger) or ((RSI >= RSI[1]) and (RSI > RSI_BullishTrigger))

            then Color.GREEN

        else if (RSI < RSI_BUllishTrigger) or ((RSI < RSI[1]) and (RSI < RSI_BearishTrigger))

            then Color.RED

        else Color.white);

RSI.setlineWeight(2);


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();

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();

AddCloud(0, OS, Color.Red, Color.Red);
AddCloud(OB, 1, Color.Green, Color.Green);

Alert(soundBearAlerts and RSI crosses below .8, "", Alert.BAR, Sound.Ding); ## 5.15.2018 JQ added Boolean
Alert(soundBullAlerts and RSI crosses above .2, "", Alert.BAR, Sound.Ding) ;## 5.15.2018 JQ added Boolean

#  Labels below added by Johnny Quotron based on zztop notes above  2018-04-11

def FE = gamma;

#addlabel (FE < .382, " FE is Linear (Price Trending) = " + FE, Color.light_GREEN);
#addlabel (FE > .618, " FE is Non-Linear/Random (Trendless) = " + FE, Color.Light_GRAY);
#addlabel (FE <= .618 and FE >= .382, " FE is transitioning = " + FE, Color.Light_orange);

#AddChartBubble(!IsNaN(close) and IsNaN(close[-1]), FE, if FE < .382 then "Trending" else "Not Trending", Color.WHITE, yes);

#AddChartBubble(!IsNaN(close) and IsNaN(close[-1]), FE, if FE < .382 then "Trending" else if FE < .618 then "Transitioning" else "Building Energy", gamma.#takeValueColor(), yes); ## 5.19.2018 JQ

# End Code RSI_LaguerreTime_v20180919_Mobius_JQvisuals
@HighBredCloud The notes are just above. A good part if not all of the notes are from the original author, Mobius.
This particular indicator Mobius made for Don Kaufman of Theotrade, for his group. You can view a youtube video at Theotrade with the "pitch" that says "Indicator finds tops or bottoms"
This indicator should be good on any time frame. The key is in the name, time adjusting. The Laguerre Polynomial changes the time based on the "speed" of the equity.
Caveat: I could be wrong on some of the above. I run this at 8-13-8, I have seen numbers changed to different settings. The indicator above is run at 13 because that's how Mobius shared it, i believe.
When this first came out, I put 4 lower's in so that I could compare them. Different settings give different results, I wouldn't expect anything different.
Put a bunch on and find what works for you at your time frame... @tomsk anything to add is welcome. Thanks!
 
Last edited:
A

Antares66

New member
What do the percentage lines in the upper window mean? What ist ATH? Can they be used as resistance zones?
 
markos

markos

Well-known member
VIP
What do the percentage lines in the upper window mean? What ist ATH? Can they be used as resistance zones?
@Antares66 It seems you're new to investing. That's ok. Welcome to uTS. Have you had the free tour yet? Write 10 questions and call TOS for a walk through. You'll find it very worthwhile. There are also TD Ameritrade Education videos on YouTube. ATH means All Time High.
 
madeinnyc

madeinnyc

New member
@markos Thank you advance for sharing this code! Just have a couple questions, hope u don't mind:


  1. This is the current version of the indicator, correct?
  2. What is the meaning of the white bubbles with letters? (C & E?)
  3. What's the function of the line with small dots?
  4. Is it assumed that long/shorts are taken upon crosses (see image with red circles)
I read through the tutorial u have posted, but I believe that's for the older version of the indicator. Any guidance is most appreciated. Thanks!!
 
J007RMC

J007RMC

Active member
2019 Donor
Warehouse
@markos Thank you advance for sharing this code! Just have a couple questions, hope u don't mind:


  1. This is the current version of the indicator, correct?
  2. What is the meaning of the white bubbles with letters? (C & E?)
  3. What's the function of the line with small dots?
  4. Is it assumed that long/shorts are taken upon crosses (see image with red circles)
I read through the tutorial u have posted, but I believe that's for the older version of the indicator. Any guidance is most appreciated. Thanks!!
Im sorry I have no guidance for this indicator.
 
T

tomsk

Well-known member
VIP
@madeinnyc Several studies have been posted above, in order for anyone to help you effectively, either post the entire code, or provide a link to the code. That will in turn enable readers to address the specific queries you have asked about. Personally I have seen over 40 different variations of the RSI in Laguerre study so it is best to be real specific in your query
 
markos

markos

Well-known member
VIP
@madeinnyc Welcome to useThinkscript. As @tomsk has noted, there are a plethora of variations of the RSI in the Laguerre time out in the wild. The version that you have was created by @mc01439 , I do not know what the letters C and E stand for exactly.

In a way, there is no "latest" version of this study. It has been around for quite a few years and the one you posted is just as valid as the ones that I posted in 1 & 2 at the top of this page.

Please re-read thread number one and two at the beginning of this post. That should answer practically all of your questions.
Please fill out the signature box where you put your name in so that we know how best to help you.
In the tutorial section there are more posts about the study. Once again, welcome.
 
madeinnyc

madeinnyc

New member
@madeinnyc Several studies have been posted above, in order for anyone to help you effectively, either post the entire code, or provide a link to the code. That will in turn enable readers to address the specific queries you have asked about. Personally I have seen over 40 different variations of the RSI in Laguerre study so it is best to be real specific in your query
Ahh yes....ok, makes sense....here's the code:
Code:
# RSI-Laguerre Self Adjusting With Fractal Energy Gaussian Price Filter
# Mobius
# V01.12.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.

declare lower;

#Inputs:
input nFE = 8;#hint nFE: length for Fractal Energy calculation.
input AlertOn = yes;
input Glength  = 13;
input betaDev =  8;
input data = close;

def w = (2 * Double.Pi / Glength);
def beta = (1 - Cos(w)) / (Power(1.414, 2.0 / betaDev) - 1 );
def alpha = (-beta + Sqrt(beta * beta + 2 * beta));
def Go = Power(alpha, 4) * open +
             4 * (1 – alpha) * Go[1] – 6 * Power( 1 - alpha, 2 ) * Go[2] +
             4 * Power( 1 - alpha, 3 ) * Go[3] - Power( 1 - alpha, 4 ) * Go[4];
def Gh = Power(alpha, 4) * high +
             4 * (1 – alpha) * Gh[1] – 6 * Power( 1 - alpha, 2 ) * Gh[2] +
             4 * Power( 1 - alpha, 3 ) * Gh[3] - Power( 1 - alpha, 4 ) * Gh[4];
def Gl = Power(alpha, 4) * low +
             4 * (1 – alpha) * Gl[1] – 6 * Power( 1 - alpha, 2 ) * Gl[2] +
             4 * Power( 1 - alpha, 3 ) * Gl[3] - Power( 1 - alpha, 4 ) * Gl[4];
def Gc = Power(alpha, 4) * data +
             4 * (1 – alpha) * Gc[1] – 6 * Power( 1 - alpha, 2 ) * Gc[2] +
             4 * Power( 1 - alpha, 3 ) * Gc[3] - Power( 1 - alpha, 4 ) * Gc[4];
# Variables:
def o;
def h;
def l;
def c;
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;
#plot M;

# Calculations
o = (Go + Gc[1]) / 2;
h = Max(Gh, Gc[1]);
l = Min(Gl, Gc[1]);
c = (o + h + l + Gc) / 4;
plot gamma = Log(Sum((Max(Gh, Gc[1]) - Min(Gl, Gc[1])), nFE) /
        (Highest(gh, nFE) - Lowest(Gl, nFE)))
            / Log(nFE);
gamma.SetDefaultColor(Color.BLUE);
gamma.SetLineWeight(1);
gamma.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);

L0 = (1 – gamma) * Gc + 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];
if L0 >= L1
then {
    CU1 = L0 - L1;
    CD1 = 0;
} else {
    CD1 = L1 - L0;
    CU1 = 0;
}
if L1 >= L2
then {
    CU2 = CU1 + L1 - L2;
    CD2 = CD1;
} else {
    CD2 = CD1 + L2 - L1;
    CU2 = CU1;
}
if L2 >= L3
then {
    CU = CU2 + L2 - L3;
    CD = CD2;
} else {
    CU = CU2;
    CD = CD2 + L3 - L2;
}

RSI = if CU + CD <> 0 then CU / (CU + CD) else 0;
RSI.SetDefaultColor(Color.Cyan);
OS = if IsNaN(c) then Double.NaN else 0.2;
OS.SetDefaultColor(Color.Gray);
OS.HideBubble();
OS.HideTitle();
OB = if IsNaN(c) then Double.NaN else 0.8;
OB.SetDefaultColor(Color.Gray);
OB.HideBubble();
OB.HideTitle();
#M = if IsNaN(c) then Double.NaN else 0.5;
#M.SetStyle(Curve.Points);
#M.SetDefaultColor(Color.Gray);
#M.HideBubble();
#M.HideTitle();
plot FEh = if isNaN(c) then double.nan else .618;
FEh.SetStyle(Curve.Long_Dash);
FEh.HideBubble();
FEh.SetDefaultColor(Color.Dark_Gray);
FEh.HideTitle();
plot FEl = if isNaN(c) then double.nan else .382;
FEl.SetStyle(Curve.Long_Dash);
FEl.SetDefaultColor(Color.Dark_Gray);
FEl.HideBubble();
FEl.HideTitle();
AddCloud(0, OS, Color.GRAY, Color.GRAY);
AddCloud(OB, 1, Color.GRAY, Color.GRAY);
#Alert(AlertOn and RSI crosses below .9, "", Alert.BAR, Sound.Bell);
#Alert(AlertOn and RSI crosses above .1, "", Alert.BAR, Sound.Bell);

# End Code RSI_Laguerre Self Adjusting with Fractal Energy

# Trade Management
def ATR = Average(TrueRange(h,c,l), 20);
def longCond = if RSI crosses above .2
               then c
               else if RSI < .8
                    then double.nan
                    else longCond[1];
def shortCond = if RSI crosses below .8
                then c
                else if RSI > .2
                     then double.nan
                     else shortCond[1];
def upperTarget = if !isNaN(longCond) and ((RSI > RSI[1]) or (RSI > .8))
                  then Round((longCond + (1.5 * ATR)) / TickSize(), 0) * TickSize()
                  else if !isNaN(shortCond) or ((RSI < RSI[1]) or (RSI crosses below .2))
                       then double.nan
                  else upperTarget[1];
def upperBreached = if close crosses above upperTarget
                    then 1
                    else if close crosses below .5
                         then 0
                         else upperBreached[1];
def lowerTarget = if !isNaN(shortCond)
                  then Round((shortCond - (1.5 * ATR)) / TickSize(), 0) * TickSize()
                  else if !isNaN(longCond)
                       then double.nan
                  else lowerTarget[1];
def LTbreach = if close crosses below lowerTarget
               then 1
               else if RSI crosses above .5
                    then 0
                    else LTbreach[1];
#addLabel(upperTarget, if upperBreached
                     #then "Target Breached  " + AsDollars(upperTarget)
                      #else "Target = " + AsDollars(Round(upperTarget, 2)), color.green);
#addLabel(lowerTarget, if LTbreach
                     #then "Target Breached  " + AsDollars(LowerTarget)
                    # else "Target = " + AsDollars(Round(lowerTarget, 2)), color.red);

def FE_Consolidation = gamma > .62 and gamma[1] < .62;
#AddLabel(FE_Consolidation, "          Fractal Energy Consolidation          ", Color.YELLOW);
def FE_Exhaustion = gamma < .38 and gamma[1] > .38;
#AddLabel(FE_Exhaustion, "          Fractal Energy Exhaustion          ", Color.YELLOW);

AddChartBubble(FE_Consolidation, gamma,  "C", COLOR.WHITE);
AddChartBubble(FE_Exhaustion, gamma,  "E", COLOR.WHITE);

#Vertical Lines
def short = RSI crosses below .80;
def long = RSI crosses above .20;

AddVerticalLine(short, close, Color.RED, Curve.SHORT_DASH);
AddVerticalLine(long, close, Color.GREEN, Curve.SHORT_DASH);

RSI.DefineColor("Up", CreateColor( 0,  220, 0));
RSI.DefineColor("Down",  Color.MAGENTA);
RSI.SetLineWeight(4);
RSI.AssignValueColor(if RSI > RSI[1] and RSI[1] > RSI [2] then RSI.Color("Up") else if RSI < RSI[1] and RSI[1] < RSI [2] then RSI.Color("Down") else color.YELLOW);

#Gamma Line Color
gamma.DefineColor("Con", CreateColor( 153,  153, 153));
gamma.DefineColor("EX",  CreateColor( 153,  153, 153));
gamma.AssignValueColor(if gamma > .62 then gamma.Color("Con") else if gamma < .38 then gamma.Color("EX") else color.LIME);

AddCloud(gamma, .62, Color.GRAY, Color.Current);
AddCloud(gamma, .38, Color.Current, Color.GRAY);
 

Top