RSI in Laguerre Time with Fractal Energy - Momentum/Trend Indicator

markos

markos

Active member
VIP
Please read notes located in Tutorial Section! :)



Grid Code: http://tos.mx/LldzdS

Scan Code: http://tos.mx/bRLjdq



Rich (BB 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
# Adjusted for compatability with scanner 7-14-19 Markos

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
 
Last edited:
markos

markos

Active member
VIP
RSI_Laguerre is one of the all time favorites in the opinion of many in The Thinkscript Lounge.

Alerts are baked into the new (7-14-19) version above!!
 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
@markos I just fixed the formatting for you.

When you insert a code use at the beginning and at the end of the code block.

 
Last edited:
markos

markos

Active member
VIP
TheoTrade has a YouTube video on this with "indicator finds tops and bottoms" in the description.

 
Last edited:
B

Brady0524

New member
Hey Guys,

I posted this under questions, but thought this may be better.

I had a question and I was wondering if anyone has found an answer. First thanks Ben and others(Markos) for all the great info on this site. My question is this, as the title states I'm looking to set up Conditional Study Alerts found under marketwatch tab. In particular I wish to use the Languerre RSI, along with a few other conditions, to trigger alert to phone. The problem is the Rec Coding. If you enter this L-RSI into the study alert tab you get the statement found in the title. I was wondering if there was a work around. Thanks.


Brady
 
markos

markos

Active member
VIP
@Brady0524 good idea, let's stay on this page.
I do not see any REC coding in the study above.
1. Is it that code or the one in post #2?
2. What other studies or conditions are you using that might be throwing the error?
please post a "share" of each.
We will get this fixed quickest if I have all the details upfront. What timeframes do you look at? What is your scanning criteria?
Did you try scanning with just the RSI Laguerre or were there other conditions in that scan?
Thanks, Markos
 
C

Craighaber71

New member
Does anyone have a scan for exhausted signals....Thanks
 
markos

markos

Active member
VIP
@Craighaber71 Edited by Markos.
The yellow Gamma line is not an indicator, it is only telling you to trade or not to trade, by probabilities.
Even though I said what I did in the line above, there is a scan for exhaustion. I have listed my study under "FractalEnergy"

What type of companies or lists have you scanned against?
 
Last edited:
B

Brady0524

New member
Im having a bit of trouble uploading a screenshot of the problems with the Study alerts. I can try using scans as well, but like the Study alerts as I set up push notifications to my mobile app.

In particular I'm looking to use the L-Rsi on a 15 min time frame. I like to think outside the box and am attempting to build a short term continuation strategy using the L-RSI while its above or below channels. I will be Using the L-RSI to view the overall trend and am looking to add a short term indicator (Such as Ehlers CyberCycles or an ema cross for example) to capture short term moves within the overall trend.

With all this being said. Just using the code you posted above http://tos.mx/A9GycW, and attempting to use any study related criteria under the marketwatch tab, using "study alerts" always states rec usage is not allowed in this context.

Thanks for your help.
 
markos

markos

Active member
VIP
Brady, you may not be using the RSI Laguerre study correctly. https://usethinkscript.com/threads/usage-notes-for-rsi-laguerre-indicator-with-fractal-energy.219/ Please read the attached link.
To attach a screenshot, go to IMGUR.com. You do not need to set up an account. In the upper left there will be a green box that says "new post". Upload the screenshot, at each screenshot, upper right hand corner of picture, it will say copy post. Click on "post to BB". Next, copy the URL and come back to this site. Then click on insert link above, not picture. Paste in the URL box and click insert. Hopefully those instructions will work, @BenTen had to pound that into my thick skull. :)
 
C

Craighaber71

New member
I'm looking to scan for exhaustion signals against my WL
 
markos

markos

Active member
VIP
@Brady0524 & @Craighaber71 I am updating the study and re-tooling the scans that I have to match it. I have already created a 2 Grid chart with a 15 minute and 1 hour time frame. I will share everything once it is working again. :(
 
B

Brady0524

New member
Thanks Markos for the help. I will be working on uploading those pics soon. I will wait to see what you come up with. Really do like the indicator.
 
markos

markos

Active member
VIP
Thank you @Brady0524 it is excellent across all time frames. Theotrade.com on YouTube has an hourlong class available. It's name is like " Amazing Indicator " when searching for the video.
 
markos

markos

Active member
VIP
@Craighaber71 that scan is one that I have seen from Doc at Theotrade. People will have a hard time getting that one to work until I can load Doc's proper FE (Chop) study. If it is one of Doc's, please give him credit.
 

Top