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

C

Craighaber71

Member
2019 Donor
Warehouse
How do you change the look back on the scan...l'm looking for the last 2 bars
 
BenTen

BenTen

Administrative
Staff
VIP
@Craighaber71 Use the within X bar option under your scanner.
 
H

HighBredCloud

Active member
@markos Just wanting to continue our convo from the last thread here as you suggest. Have you seen this version of the RSI LaGuerre? I think JQ had some enhancements done...And I agree with you that when you change settings you will get different outcomes...my issue with the previous statement was that I changed the settings to the same exact specs and the outcomes still come out noticeably different...hence why I really don't know what the "best" version of the RSI LaGuarre is...

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
 
horserider

horserider

Well-known member
VIP
Best version is the one that you understand and helps make you money. If that was not the case only one version would exist. You will be chasing your tail forever pursuing the "best" version.
 
T

tomsk

Well-known member
VIP
Best version is the one that you understand and helps make you money. If that was not the case only one version would exist. You will be chasing your tail forever pursuing the "best" version.
When in doubt, check the code logic and convince yourself, that's how I've always managed my set of indicators
 
markos

markos

Well-known member
VIP
@HighBredCloud Please re-read this thread. Use the two chart set-up in Post #2 I have also included a scan under the same name in there somewhere. Next >> https://usethinkscript.com/threads/rsi-laguerre-indicator-with-fractal-energy-usage-notes.219/#post-10021 << At the end of this thread I have some "advice", in post 12. Put 4 versions in the lower of each in post #2 and compare. (AT YOUR TIME FRAME)
@horserider is absolutely correct. What works for you? That is all that matters.
@Nick If you are awake in Singapore, please add to the conversation.
@tomsk has excellent advice. After you have put 3 or 4 different iterations on your lower chart, copy/paste each into notepad++ (free download). That will put the line number next to each line of code. Then print them out and compare. That is also an excellent way to learn code.
I have seen Doc Severson, formerly of Theotrade, run his FE, like the one you have above from between 8 and 13. It depends on what you want.
I run mine at 8-13-8. It works for me, might not for you.
Regardless, Put them on the 2 Grid flex chart I put in #2 above, print, review, watch for a while on a Future, a slow utility and something that has high IV. Please let everyone here know what you have learned. That will help the whole community. I guess that's your weekend homework.
No shortcuts.
 
H

HighBredCloud

Active member
@markos will do...I am not really familiar with code so that will not tell me much by checking code logic as suggest by @tomsk , however, I can compare them side by side to see which one works for my needs. BUT you know how checking goes in AH charts...and ON DEMAND works when it wants to.

With so many versions out there I don't know what the default settings are anymore...I will look at the settings you suggested first. As I mentioned before though...certain versions of the RSI LaGuerre that I found had different settings...but even when I changed them to the same settings I found them to be different...either the Gamma or RSI lines were different...Please see the pic below. So what is OFF when settings are the same? I should mention that the bottom pic only had option for NFE and it came with RSI Bullish trigger set to .2 and RSI Bearish trigger set to .8...while the top one had NFE set to 8 glength set to 13 and beta dev set to 8.


The one that I posted above...I think @horserider changed the lines to change from Greed to Red and vice versa...I like that and it seemed to be consistent with other versions that I have seen. Now few days back @tomsk posted all the updates to the RSI LaGuerre...and well that just confused me even further...Hybrid candles...price targets...? Leaves me scratching my head like huh?

I watched the YouTube video from TheoTrade about the RSI LaGuerre...I just can't help to wonder if there better indicators out there OR is the RSI LaGuerre just that accurate...? I guess I need to read more about the RSI LaGuerre combine with the TMO...
 
markos

markos

Well-known member
VIP
@HighBredCloud First, please slow down. Did you read this thread from the top again? Markets are fractal. You cannot tell the time frame of any chart without the price or time reference. A 1 week chart will have the same patterns as a 15 minute chart.
Please load the chart as I recommended. Turn off before/after hours. Load up 4 lower studies on a 1 day/ 1 year chart so you can properly compare the study iterations. Print them all out. You don't need to know about all that higher math. You just need to see and compare.
I would like to see what you find with 3 products; a Utility, Honeywell, and ROKU.

All that non-market hours stuff will confuse you until you learn the study. You can't trade SHOP after hours anyway.
Sloooow and steady this will come to you.
Yes. The RSI Laguerre is THAT fast and accurate.

Do you know how I know you are going to fast? You're not reading posts completely.
What @tomsk posted were created by an excellent coder named BLT. They are different and good in their own way. What I am looking at above is a similar study. One type is MTF, the Ones authored by Mobius are not. Whether the Green line is at the top or the Red doesn't matter; it's just lipstick, and a rabbit hole that you don't need to go down.
They're all RSI Laguerre. @tomsk please correct me if incorrect.

Please stick to one type at a time, just change the settings so that you can see the difference. 8-13-4, 5-8-8, etcetera. Type them out, number them. This is research. Your in school. Tuition can be a bitch if you're not careful.

The community is like no other. People here will help you but only if you help yourself. Please continue with your observations and let us know what you have found in a few days. We can move forward from there.

@MBF anything to add?
 
T

tomsk

Well-known member
VIP
@HighBredCloud First, please slow down. Did you read this thread from the top again? Markets are fractal. You cannot tell the time frame of any chart without the price or time reference. A 1 week chart will have the same patterns as a 15 minute chart.
Please load the chart as I recommended. Turn off before/after hours. Load up 4 lower studies on a 1 day/ 1 year chart so you can properly compare the study iterations. Print them all out. You don't need to know about all that higher math. You just need to see and compare.
I would like to see what you find with 3 products; a Utility, Honeywell, and ROKU.

All that non-market hours stuff will confuse you until you learn the study. You can't trade SHOP after hours anyway.
Sloooow and steady this will come to you.
Yes. The RSI Laguerre is THAT fast and accurate.

Do you know how I know you are going to fast? You're not reading posts completely.
What @tomsk posted were created by an excellent coder named BLT. They are different and good in their own way. What I am looking at above is a similar study. One type is MTF, the Ones authored by Mobius are not. Whether the Green line is at the top or the Red doesn't matter; it's just lipstick, and a rabbit hole that you don't need to go down.
They're all RSI Laguerre. @tomsk please correct me if incorrect.

Please stick to one type at a time, just change the settings so that you can see the difference. 8-13-4, 5-8-8, etcetera. Type them out, number them. This is research. Your in school. Tuition can be a bitch if you're not careful.

The community is like no other. People here will help you but only if you help yourself. Please continue with your observations and let us know what you have found in a few days. We can move forward from there.

@MBF anything to add?
@markos Absolutely spot on
 
horserider

horserider

Well-known member
VIP
Just to be clear. I only changed the RSI line colors because someone requested it. Not because I thought it was better. I do not even use the indicator,
 
H

HighBredCloud

Active member
@markos I will be the first to admit that I have not thoroughly read every single page of this thread. I have, however, downloaded several versions of the RSI LaGuerre and I actually did compare them all to each other...like 4 or 5 at a time...I've ONLY done that when the markets were closed and the charts weren't live. Perhaps I should do this when the market is live to see how this specific indicator works in a live market.

The ONLY reason why I didn't do that is because I did not know what the right settings for the indicator were as they all came with a bit different settings...I appreciate that you have explained and suggested the proper settings...With that in mind to do the test that you are asking...could you please kindly share a script of the RSI LaGuerre that you are using...? I probably have it already...I just don't know which one it is.

I just want to make sure that the calculations are not altered somewhere in the code...since I am not a coder reading the code is not my forte...I do just about as equivalent to one tying their own shoes when it comes to coding...

As shown by the picture I posted above...two versions of RSI LaGuerre with the same settings yield two different readings on the same chart. That's why I am confused.

@horserider I actually like the version you made...I guess the lipstick part is what caught my eye.

Looks like I have a lot of reading to catch up on. BUT I would LOVE to test this indicator out in the way that it is intended to...to see what they hype is about...seems like I am missing out big time!
 
horserider

horserider

Well-known member
VIP
@HighBredCloud If you like that colored version then use it. Over time learn how it reacts to the market. Time spent doing that is better than looking for what someone else may consider the best version. It is just a momentum indicator with its own way of displaying the data. I posted a comparison in a different topic but will show it here in case you did not see. I bet other studies would compare similarly.

 
F

flyer01

New member
Is there a version of the RSI Laguerre that allows for different aggregation periods? For example, add a 1 hour aggregation RSI Laguerre to a 15 minute chart.
 
T

tomsk

Well-known member
VIP
@flyer01 Yes, @tomsk recently shared it here.
BenTen, thank you. I am beyond appreciative of information shared on this forum.
@BenTen @flyer01 There's been a lot of interest in MTF type of studies discussed on the site recently.
Many people here are already familiar with John Carter's Squeeze MTF, 10X MTF and even DMI MTF studies
However note that the sort of MTF being implemented in the RSI in Laguerre Time MTF I posted is different
The only way to find out those differences is to examine the underlying code.

I have summarized those findings here, please do have a read through.

 
borntostun

borntostun

New member
VIP
I'm slightly confused with the use of the scanner. I am trading on the 4hr (thus will be comparing the scanner output to 4hr charts) . . . so I assume that I need to update the default settings in the scanner from Study, 'Custom' row to read (on the far right), '4HR'? This would then show me stocks that have crossed above 0.2 sometime in the prior 2 bars?

Also, chart settings to include after-hours will confuse this output, correct? Thanks!
 
T

tomsk

Well-known member
VIP
If you are looking at the 4 HR on the study, your scanner MUST reflect the same aggregation or you'll see very different results.
 

Top