RSI Laguerre with Fractal Energy for ThinkorSwim

@BenTen I would like an audible alert when an arrow displays either up or down for this indicator. Thank you!

Rich (BB code):
declare upper;                                       

def na = Double.NaN;
script R {
    input gamma              = .2;
    input usecandletype      = {candle_hybrid, default candle};
    input usehigheraggperiod = {default "Current", "Higher"};
    input outputformat       = {default Rounded, "Not Rounded"};
    ;#Hint outputformat: 'Not Rounded' is used for notes, bonds (eg: 109'110), forex, etc type format.
    input atrlength          = 21;
    input agg                = AggregationPeriod.TWO_MIN;
    input overbought         = .8;
    input oversold           = .2;
    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;
    def error = usehigheraggperiod == usehigheraggperiod."Higher" and GetAggregationPeriod() > agg;
    switch (usehigheraggperiod) {
    case Current:
        if usecandletype == usecandletype.candle_hybrid {
            o = (open + close[1]) / 2;
            h = Max(high, close[1]);
            l = Min(low, close[1]);
            c = (o + h + l + close) / 4;
        } else {
            o = open;
            h = high;
            l = low;
            c = close;
        }
    case Higher:
        if error {
            o = Double.NaN;
            h = Double.NaN;
            l = Double.NaN;
            c = Double.NaN;
        } else {
            if usecandletype == usecandletype.candle_hybrid {
                o = (open(period = agg)     + close(period = agg)[1]) / 2;
                h = Max(high(period = agg)  , close(period = agg)[1]);
                l = Min(low(period = agg)   , close(period = agg)[1]);
                c = ((open(period = agg)    + close(period = agg)[1]) / 2
            + Max(high(period = agg), close(period = agg)[1])
            + Min(low(period = agg) , close(period = agg)[1])
            + close(period = agg)) / 4;
            } else {
                o = open(period = agg);
                h = high(period = agg);
                l = low(period = agg);
                c = close(period = agg);
            }
        }
}
    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 IsNaN(close) then Double.NaN
      else if CU + CD <> 0
      then    CU / (CU + CD) else 0;
    OS  = if IsNaN(close)
      then Double.NaN else oversold;
    OB  = if IsNaN(close)
      then Double.NaN
      else overbought;
    def mid = if IsNaN(close) then Double.NaN else 0.5;
    def lineh = 1.2;
    def linel = -.2;
    
# End Code Basic RSI Laguerre - Author: Mobius

}

def Up = if R() crosses above R().OS then 1 else 0;
def u = if R() crosses above R().OB then 1 else 0;

def Dn = if R() crosses below R().OB then 1 else 0;
def d = if R() crosses below R().OS then 1 else 0;

def Green = if Up
#or u
then low else 0;
def Red = if Dn
#or d
then high else 0;

def showLines = 1;


def trendchange = if Green then low else if Red then high else trendchange[1];

def PL = if !IsNaN(trendchange)
             then trendchange
             else PL[1];

plot pivotLine = if PL > 0
                       then PL
                       else Double.NaN;
pivotLine.SetPaintingStrategy(PaintingStrategy.LINE);
pivotLine.SetHiding(!showLines);

input showArrows = yes;
plot ArrUp = if showArrows and Green then low else 0;
ArrUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrUp.SetDefaultColor(Color.GREEN);

plot ArrDn = if showArrows and Red then high else 0;
ArrDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ArrDn.SetDefaultColor(Color.RED);

pivotLine.AssignValueColor(if R() < R().OB then Color.RED else if R() > R().OS then Color.GREEN else Color.BLACK);

input ShowLabels = yes;
#Multipliers for ATR targets
input firsttgt = 1.618;
input secondtgt = 3.447;
input thirdtgt = 4.25;
input ATRLength = 8;#default is 14

def agg = if GetAggregationPeriod() > AggregationPeriod.FIFTEEN_MIN then GetAggregationPeriod() else AggregationPeriod.FIFTEEN_MIN;#You can edit this to just (GetAggregationPeriod())
def ATR = Average(TrueRange(High(period = agg),Close(period = agg),Low(period = agg)),ATRLength);
addlabel(ShowLabels, "ATR = " + Round((ATR) / TickSize(),0)*TickSize(), Color.GRAY);

input showStrategy = yes;
def co = if PL[1] and R()[1] > R().OS[1] then 1 else 0;
def firstlongtarget = if co then (PivotLine + ATR*firsttgt) else 0;
def secondlongtarget = if co then (PivotLine + ATR*secondtgt) else 0;
def thirdlongtarget = if co then (PivotLine + ATR*thirdtgt) else 0;

def sto = if PL and R() < R().OB then 1 else 0;
def firstshorttarget = if sto then (PivotLine - ATR*firsttgt) else 0;
def secondshorttarget = if sto then (PivotLine - ATR*secondtgt) else 0;
def thirdshorttarget = if sto then (PivotLine - ATR*thirdtgt) else 0;


#    Internal Script Reference
#    Author: Mobius

    def LineLimit = 30;
    def Detrend = 0;
    def OnExpansion = yes;
    def data = firstlongtarget;
    def bar = 0;
    def ShowAllPlots = 0;
    def ThisBar = HighestAll(bar) - Detrend;
    def cLine   = if ShowAllPlots == 0
            then if bar == ThisBar
                 then data
                 else Double.NaN
            else data;
    def cond1 = CompoundValue(1, if IsNaN(data)
                                then cond1[1]
                                else data, data);
    def P = if ShowAllPlots == 0
            then if ThisBar - LineLimit <= bar
            then HighestAll(cLine)
            else Double.NaN
            else cLine;
    plot firstLTarget = if OnExpansion and
                     IsNaN(data[-1])
                  then cond1
                  else Double.NaN;
firstLTarget.SetDefaultColor(Color.GREEN);
addlabel(ShowLabels, if R() > R().OS then "Long Target = " + Round((firstLTarget) / TickSize(),0)*TickSize() else "", Color.GREEN);
AddChartBubble(IsNaN(close) and !isNaN(close[1]),
               firstLTarget,
              "First Target = " + Round((firstLTarget) / TickSize(),0)*TickSize(),
               Color.GREEN,
               yes);

def difflongtarget = if close < firstlongtarget then (firstlongtarget - close) else (close - firstlongtarget);
addLabel(ShowLabels, if R() > R().OS then "Diff 1st L tgt = " + (Round((difflongtarget) / TickSize(),0)*TickSize()) else "", Color.LIGHT_GREEN);


    def LineLimit3 = 30;
    def Detrend3 = 0;
    def OnExpansion3 = yes;
    def data3 = secondlongtarget;
    def bar3 = 0;
    def ShowAllPlots3 = 0;
    def ThisBar3 = HighestAll(bar) - Detrend;
    def cLine3   = if ShowAllPlots3 == 0
            then if bar3 == ThisBar3
                 then data3
                 else Double.NaN
            else data3;
    def cond3 = CompoundValue(1, if IsNaN(data3)
                                then cond3[1]
                                else data3, data3);
    def P3 = if ShowAllPlots3 == 0
            then if ThisBar3 - LineLimit3 <= bar3
            then HighestAll(cLine3)
            else Double.NaN
            else cLine3;
    plot secondLTarget = if OnExpansion3 and
                     IsNaN(data3[-1])
                  then cond3
                  else Double.NaN;
secondLTarget.SetDefaultColor(Color.GREEN);
addlabel(ShowLabels, if R() > R().OS then "2nd Long Target = " + Round((secondLTarget) / TickSize(),0)*TickSize() else "", Color.GREEN);
AddChartBubble(IsNaN(close) and !isNaN(close[1]),
               secondLTarget,
              "2nd Long Target = " + Round((secondLTarget) / TickSize(),0)*TickSize(),
               Color.GREEN,
               yes);

def difflongtarget2 = if close < secondlongtarget then (secondlongtarget - close) else (close - secondlongtarget);
addLabel(ShowLabels, if R() > R().OS then "Diff 2nd L tgt = " + Round((difflongtarget2) / TickSize(),0)*TickSize() else "", Color.LIGHT_GREEN);


    def LineLimit9 = 30;
    def Detrend9 = 0;
    def OnExpansion9 = yes;
    def data9 = thirdlongtarget;
    def bar9 = 0;
    def ShowAllPlots9 = 0;
    def ThisBar9 = HighestAll(bar9) - Detrend9;
    def cLine9   = if ShowAllPlots9 == 0
            then if bar9 == ThisBar9
                 then data9
                 else Double.NaN
            else data9;
    def cond9 = CompoundValue(1, if IsNaN(data9)
                                then cond9[1]
                                else data9, data9);
    def P9 = if ShowAllPlots9 == 0
            then if ThisBar9 - LineLimit9 <= bar9
            then HighestAll(cLine9)
            else Double.NaN
            else cLine9;
    plot thirdLTarget = if OnExpansion9 and
                     IsNaN(data9[-1])
                  then cond9
                  else Double.NaN;
thirdLTarget.SetDefaultColor(Color.GREEN);
addlabel(ShowLabels, if R() > R().OS then "3rd Long Target = " + Round((thirdLTarget) / TickSize(),0)*TickSize() else "", Color.GREEN);
AddChartBubble(IsNaN(close) and !isNaN(close[1]),
              thirdLTarget,
            "3rd Long Target = " + Round((thirdLTarget) / TickSize(),0)*TickSize(),
               Color.GREEN,
               yes);

def difflongtarget9 = if close < thirdlongtarget then (thirdlongtarget - close) else (close - thirdlongtarget);
addLabel(ShowLabels, if R() > R().OS then "Diff 3rd L tgt = " + Round((difflongtarget9) / TickSize(),0)*TickSize() else "", Color.LIGHT_GREEN);


    def LineLimit2 = 30;
    def Detrend2 = 0;
    def OnExpansion2 = yes;
    def data2 = firstshorttarget;
    def bar2 = 0;
    def ShowAllPlots2 = 0;
    def ThisBar2 = HighestAll(bar2) - Detrend2;
    def cLine2   = if ShowAllPlots2 == 0
            then if bar2 == ThisBar2
                 then data2
                 else Double.NaN
           else data2;
    def cond2 = CompoundValue(1, if IsNaN(data2)
                                then cond2[1]
                                else data2, data2);
    def P2 = if ShowAllPlots2 == 0
            then if ThisBar2 - LineLimit2 <= bar2
            then HighestAll(cLine2)
            else Double.NaN
            else cLine2;
    plot firstSTarget = if OnExpansion2 and
                     IsNaN(data2[-1])
                  then cond2
                  else Double.NaN;
firstSTarget.SetDefaultColor(Color.RED);
addlabel(ShowLabels, if R() < R().OB then "1st Short Target = " + Round((firstSTarget) / TickSize(),0)*TickSize() else "", Color.RED);
AddChartBubble(IsNaN(close) and !IsNaN(Close[1]),
                firstSTarget,
                "Short Target = " + Round((firstSTarget) / TickSize(),0)*TickSize(),
                Color.RED,
                no);

def diffshorttarget = if close < data2 then (data2 - close) else (close - data2);
addLabel(ShowLabels, if R() < R().OB then "Diff 1st S tgt = " + Round((diffshorttarget) / TickSize(),0)*TickSize() else "", Color.LIGHT_RED);
#

    def LineLimit4 = 30;
    def Detrend4 = 0;
    def OnExpansion4 = yes;
    def data4 = secondshorttarget;
    def bar4 = 0;
    def ShowAllPlots4 = 0;
    def ThisBar4 = HighestAll(bar4) - Detrend4;
    def cLine4   = if ShowAllPlots4 == 0
            then if bar4 == ThisBar4
                 then data4
                 else Double.NaN
           else data4;
    def cond4 = CompoundValue(1, if IsNaN(data4)
                                then cond4[1]
                                else data4, data4);
    def P4 = if ShowAllPlots4 == 0
            then if ThisBar4 - LineLimit4 <= bar4
            then HighestAll(cLine4)
            else Double.NaN
            else cLine4;
    plot secondSTarget = if OnExpansion4 and
                  IsNaN(data4[-1])
                  then cond4 #
                  else Double.NaN;
secondSTarget.SetDefaultColor(Color.RED);
#Round((close + (atr)) / TickSize(), 0) * TickSize()
addlabel(ShowLabels, if R() < R().OB then "2nd Short Target = " + Round((secondSTarget) / TickSize(),0)*TickSize() else "", Color.RED);
AddChartBubble(IsNaN(close) and !IsNaN(Close[1]),
                secondSTarget,
                "2nd Short Target = " + Round((secondSTarget) / TickSize(),0)*TickSize(),
                Color.RED,
                no);

def diffshorttgt2 = if close < secondshorttarget then (secondshorttarget - close) else (close - secondshorttarget);
addLabel(ShowLabels, if R() < R().OB then "Diff 2nd S tgt = " + Round((diffshorttgt2) / TickSize(),0)*TickSize() else "", Color.LIGHT_RED);

    def LineLimit8 = 30;
    def Detrend8 = 0;
    def OnExpansion8 = yes;
    def data8 = thirdshorttarget;
    def bar8 = 0;
    def ShowAllPlots8 = 0;
    def ThisBar8 = HighestAll(bar8) - Detrend8;
    def cLine8  = if ShowAllPlots8 == 0
            then if bar8 == ThisBar8
                 then data8
                 else Double.NaN
            else data8;
    def cond8 = CompoundValue(1, if IsNaN(data8)
                                then cond8[1]
                                else data8, data8);
    def P8 = if ShowAllPlots8 == 0
            then if ThisBar8 - LineLimit8 <= bar8
            then HighestAll(cLine8)
            else Double.NaN
            else cLine8;
    plot thirdSTarget = if OnExpansion8 and
                     IsNaN(data8[-1])
                  then cond8
                  else Double.NaN;
thirdSTarget.SetDefaultColor(Color.RED);
addlabel(ShowLabels, if R() < R().OB then "3rd Short Target = " + Round((thirdSTarget) / TickSize(),0)*TickSize() else "", Color.RED);
AddChartBubble(IsNaN(close) and !isNaN(close[1]),
               thirdSTarget,
              "3rd Short Target = " + Round((thirdSTarget) / TickSize(),0)*TickSize(),
               Color.RED,
               no);

def diffshorttarget3 = if close < thirdshorttarget then (thirdshorttarget - close) else (close - thirdshorttarget);
addLabel(ShowLabels, if R() < R().OB then "Diff 3rd S tgt = " + Round((diffshorttarget3) / TickSize(),0)*TickSize() else "", Color.LIGHT_RED);

#Inputs:
input nFE = 34;#hint nFE: length for Fractal Energy calculation.
input PriceColor = yes;
plot gamma1 = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE) /
        (Highest(high, nFE) - Lowest(low, nFE))) / Log(nFE);
gamma1.AssignNormGradientColor(nFE, Color.GREEN, Color.RED);
gamma1.SetLineWeight(2);

addLabel(showlabels, if showlabels and gamma1 < 0.382 then "Trending =" + gamma1 else if gamma1 > 0.618 then "Non-Trending =" + gamma1 else "FE = " + gamma1, if gamma1 < 0.382 then Color.WHITE else if gamma1 > 0.618 then Color.CYAN else Color.GRAY);

AssignPriceColor(if PriceColor and gamma1
#crosses below
<
.382 then Color.WHITE else if PriceColor and  gamma1
#crosses above
>
.618 then Color.CYAN else Color.CURRENT);

#                                        End Code
 

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

@Gvaro Add the following code to the bottom of your script:

Code:
# Alerts
Alert(ArrDn, " ", Alert.Bar, Sound.Chimes);
Alert(ArrUp, " ", Alert.Bar, Sound.Bell);
 
Hi Can anyone tell me the difference between this RSILg_FE_Gssn1 vs the TheoTrade version. The RSILg_FE_Gssn1 seems to lag a little behind. Not sure which is the most current or correct version to use and scan from.

Can't seem to post a pic, but here is the pic from imgr.

qExmzhz.png
 
@BenTen @markos How do i add scan plots to this version of the RSIL?

Code:
# TheoTrade 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.

declare lower;

#Inputs:
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);
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);
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.Green, Color.Green);
AddCloud(OB, 1, Color.Red, Color.Red);
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
 
@novadolla in this picture from page one, build out your scan with parameters you would like.
The last entry would use the name of the TheoTrade scan that you have saved it under.
There is a boat load of research available on this site starting with the Tutorials.
imVZmVc.png
 
After watching numerous versions of this indicator for a while now, I'm happy to say.... I think it's pretty much worthless. Way better choices out there imo
@wtf_dude why would you be happy to say that?
I have used the indicator to a > 80% return on our investments this year. Not as great a return as some but better than a sharp stick in the eye.
It all depends on your time frame and knowledge of when NOT to use it.

@NickC @novadolla @malone1020 There are many versions of this indicator in different threads. Read the write-up in the different Tutorial threads. Even if you don't code, look at the differences in the codes. As you'll learn, The Theotrade indicator was made by a retired Math Professor named Mobius. The Laguerre polynomials used in this excellent indicator were written about in a book by John Ehlers, who has created many studies that professionals use today..
Also, at the bottom of this page are links to other RSI Laguerre Threads.
 
@NickC I would go with Theo's version. I've backtested and its more accurate on the daily time frame.
Thank you @novadolla do you have any scans for Theotrade version. I have one but i don't believe it's accurate. I like this one as I can specify the cross over 0.2 within x bars. This is the current code Ihave for long scans. I would like to be able to input the cross of the 0.20 line within x bars.

Code:
# Scan for RSI in Laguerre Time With Fractal Energy
# Mobius
# V02.07.2014
# V03.06.15.2016
#Scan
#Inputs:
input nFE = 8;
# 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;
def RSI;
# Calculations
o = (open + close[1]) / 2;
h = Max(high, close[1]);
l = Min(low, close[1]);
c = (o + h + l + close) / 4;
def gamma = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE) /
        (Highest(high, nFE) - Lowest(low, nFE)))
            / Log(nFE);
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;
# Note Comment-Out (#) whichever scan not being used.
# Long Scan
 plot Long = RSI crosses above .2 and gamma > .6;
# Short Scan
#plot Short = RSI crosses below .8 and gamma > .6;
 
Thank you @novadolla do you have any scans for Theotrade version. I have one but i don't believe it's accurate. I like this one as I can specify the cross over 0.2 within x bars. This is the current code Ihave for long scans. I would like to be able to input the cross of the 0.20 line within x bars.

Code:
# Scan for RSI in Laguerre Time With Fractal Energy
# Mobius
# V02.07.2014
# V03.06.15.2016
#Scan
#Inputs:
input nFE = 8;
# 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;
def RSI;
# Calculations
o = (open + close[1]) / 2;
h = Max(high, close[1]);
l = Min(low, close[1]);
c = (o + h + l + close) / 4;
def gamma = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE) /
        (Highest(high, nFE) - Lowest(low, nFE)))
            / Log(nFE);
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;
# Note Comment-Out (#) whichever scan not being used.
# Long Scan
plot Long = RSI crosses above .2 and gamma > .6;
# Short Scan
#plot Short = RSI crosses below .8 and gamma > .6;
just replace "plot Long = RSI crosses above .2 and gamma > .6;". then change the look back period to your desired number of bars, i have it at 2 for now, however just change it.

plot Long = RSI crosses above 0.2 within 2 bars;

or plot Long = RSI crosses above 0.2 within 2 bars and gamma > .6;
 
Last edited:
This indicator has been great! I use ninjatrader along with TOS, two different brokers. I was wonder if anybody had a ninjatrader 8 version of the Mobius RSI Laguerre? I have seen some on the internet but they are behind paywalls.

@markos Big thanks for the usage notes.

Thanks a bunch!
 
just replace "plot Long = RSI crosses above .2 and gamma > .6;". then change the look back period to your desired number of bars, i have it at 2 for now, however just change it.

plot Long = RSI crosses above 0.2 within 2 bars;

or plot Long = RSI crosses above 0.2 within 2 bars and gamma > .6;
Thank you very much for the response!
 
just replace "plot Long = RSI crosses above .2 and gamma > .6;". then change the look back period to your desired number of bars, i have it at 2 for now, however just change it.

plot Long = RSI crosses above 0.2 within 2 bars;

or plot Long = RSI crosses above 0.2 within 2 bars and gamma > .6;
Is the lookback period nFE?
Thanks
 
Can anyone tell me how to setup the script to scan for stocks where the FE(gamma) is at or above 0.6 for x number of bars. Right now I have the following in the script and need to change the 'within x bars' to 'for x bars'

Code:
# Note Comment-Out (#) whichever scan not being used.
# Long Scan
 plot Long = RSI crosses above .1 within 1 bars and 
 gamma >= 0.6 within 6 bars  << Need to change this to be for 6 bars
 
@abhibach I realize that these threads can be rather long. Please do not scan for Gamma. It is only a signal of when not to trade per it's author, Mobius. In other words, it will lead you down a rabbit hole and take you away from trading a plan.
 
Hi. I know this is a Thinkscript forum for TOS, but does anyone know if there is a Mobius version of RSI Laguerre with Fractal energy for Trading View?
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
382 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