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

H

hhjani

New member
VIP
Hey Mansor,
I personally use the RSI-L with FE that Mobius made for Theotrade. I use it to trade NQ and ES futures intraday on a 2min time frame to enter and exit trades. I also use an anchor chart of 5-10 times higher time frame so that I am trading with the trend. If the longer time frame is heading up then I only take long entries and vice versa for shorts. You can make small scalps trading against the trend using this indicator, but I dont like doing that unless price action tells me otherwise. Also, I dont find fractal energy of much use on the 2min time frame, its really only useful on longer time frames in my opinion.
Hello @BWiz Thank you for the information. It helps a newbie like me. You mentioned that you use this script only for higher time frames and not on 1m or 2m charts. May I please know what other indicator you use for higher time frame to trade futures? Thanks!
 
B

BWiz

New member
Hello @BWiz Thank you for the information. It helps a newbie like me. You mentioned that you use this script only for higher time frames and not on 1m or 2m charts. May I please know what other indicator you use for higher time frame to trade futures? Thanks!
Add the RSI-L in your lower study and set the aggregation period to two minutes. Next add the RSI-L to your lower study again, but make sure its in the same rectangle as your first RSI-L Study. Set the aggregation period to 15 minutes. When the 15m RSI-L is in an uptrend place entries using the 2m once the 2m has crossed above the OS line. Do the inverse for you short entries. That way when you enter a trade you will be following the same direction as the longer term trend to give you a better edge. I hope this helps.
 
H

hhjani

New member
VIP
@BWiz Thank you so much for your coaching! Truly appreciate it. I am using just downloaded script from the latest post I could find here. https://tos.mx/bQOnkR I'll give it a try later tonight along with Hull Moving Avg.
 
H

hhjani

New member
VIP
Add the RSI-L in your lower study and set the aggregation period to two minutes. Next add the RSI-L to your lower study again, but make sure its in the same rectangle as your first RSI-L Study. Set the aggregation period to 15 minutes. When the 15m RSI-L is in an uptrend place entries using the 2m once the 2m has crossed above the OS line. Do the inverse for you short entries. That way when you enter a trade you will be following the same direction as the longer term trend to give you a better edge. I hope this helps.
Hello @BWiz... Your approach is surely promising and I am seeing good results in paper trading. May I please ask how do you determine stop loss? Thanks again!
 
B

BWiz

New member
Hello @BWiz... Your approach is surely promising and I am seeing good results in paper trading. May I please ask how do you determine stop loss? Thanks again!
I can read price fairly well, so I don't use specific hard stops. Depending on multiple variables I will manage my trades in numerous ways. You said you were a newbie, so my best advice for you would be to use something like ATR indicator (average true range) to help you place a stop loss. Research the ATR and incorporate it into your trading strategy to help you place a hard stop.
 
T

Thomas

Active member
Here's a Laguerre that is customized,.....https://tos.mx/kyCs9yK
The settings originally are .08 and .13
 
H

henry1224

Member
VIP
Here is an indicator that plots labels for the RSI Laguerre , if you add several to the same chart area, you will find out how the higher time frames are doing, just adjust the agg period.

Code:
#########################################
declare lower;
input period = AggregationPeriod.DAY;
input nFE = 13;#hint nFE: length for Fractal Energy calculation. 
input RSI_BullishTrigger = .1;
input RSI_BearishTrigger = .9;
DefineGlobalColor("Long", Color.Green);
DefineGlobalColor("Short", Color.RED);
DefineGlobalColor("Neutral", Color.Yellow);
DefineGlobalColor("arrow Buy", Color.Cyan);
DefineGlobalColor("arrow Sell", Color.Orange);
Script SymbolHK_RSI_L{
input period = AggregationPeriod.DAY;
def OP = Open(period= period);
def CP = Close(Period= period);
def HP = High(period= period);
def LP = Low(Period= period);
input nFE = 13;#hint nFE: length for Fractal Energy calculation. 
input RSI_BullishTrigger = .1;
input RSI_BearishTrigger = .9;
    # 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;

    # Calculations
o = (OP + CP[1]) / 2;
h = Max(HP, CP[1]);
l = Min(LP, CP[1]);
c = (OP + HP + LP + CP) / 4;
    #Self adjusting Gamma code
Def gamma = Log(Sum((Max(HP, CP[1]) - Min(LP, CP[1])), nFE) / 
        (Highest(HP, nFE) - Lowest(LP, 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; }

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

Plot result =
        if (RSIL > RSI_BearishTrigger) or ((RSIL >= RSIL[1]) and (RSIL > RSI_BullishTrigger))
            then 1 
        else if (RSIL < RSI_BullishTrigger) or ((RSIL < RSIL[1]) and (RSIL < RSI_BearishTrigger))
            then -1          else 0;}


Script SymbolHK_RSI_LArrows{
input period = AggregationPeriod.DAY;
def OP = Open(period= period);
def CP = Close(Period= period);
def HP = High(period= period);
def LP = Low(Period= period);
input nFE = 13;#hint nFE: length for Fractal Energy calculation. 
input RSI_BullishTrigger = .1;
input RSI_BearishTrigger = .9;
    # 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;

    # Calculations
o = (OP + CP[1]) / 2;
h = Max(HP, CP[1]);
l = Min(LP, CP[1]);
c = (OP + HP + LP + CP) / 4;
    #Self adjusting Gamma code
Def gamma = Log(Sum((Max(HP, CP[1]) - Min(LP, CP[1])), nFE) / 
        (Highest(HP, nFE) - Lowest(LP, 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; }

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

Plot result =
        if (RSI Crosses Above RSI_BullishTrigger) or ((RSI[2] > RSI[1]) and (RSI[1] <= RSI))
            then 1 
        else if (RSI Crosses below RSI_BearishTrigger) or ((RSI[2] < RSI[1]) and (RSI[1] > RSI))
            then -1          else 0;}
def currentPeriod = GetAggregationPeriod();
def s1;
def h1;

if period >= currentPeriod {
    s1 = SymbolHK_RSI_L(period = period ,nFE = nFE, RSI_BullishTrigger = RSI_BullishTrigger, RSI_BearishTrigger = RSI_BearishTrigger);
    h1 = SymbolHK_RSI_LArrows(period = period, nFE = nFE, RSI_BullishTrigger = RSI_BullishTrigger, RSI_BearishTrigger = RSI_BearishTrigger);
} else {
    s1 = Double.NaN;
    h1 = DOuble.Nan;
}
AddLabel(!IsNaN(s1), "RSIL:" + (if period == AggregationPeriod.MONTH then "M"
else
if period == AggregationPeriod.WEEK then "W"
else
if period == AggregationPeriod.FOUR_DAYS then "4D"
else
if period == AggregationPeriod.THREE_DAYS then "3D"
else
if period == AggregationPeriod.TWO_DAYS then "2D"
else
if period  == AggregationPeriod.DAY then "D"
else
if period == AggregationPeriod.FOUR_HOURS then "4H"
else
if period == AggregationPeriod.TWO_HOURS then "2H"
else
if period == AggregationPeriod.HOUR then "60m"
else
if period == AggregationPeriod.THIRTY_MIN then "30m"
else
if period == AggregationPeriod.TWENTY_MIN then "20m"
else
if period  == AggregationPeriod.FIFTEEN_MIN then "15m"
else
if period == AggregationPeriod.TEN_MIN then "10m"
else
if period == AggregationPeriod.FIVE_MIN then "5m"
else
if period == AggregationPeriod.FOUR_MIN then "4m"
else
if period  == AggregationPeriod.THREE_MIN then "3m"
else
if period == AggregationPeriod.TWO_MIN then "2m"
else
if period  == AggregationPeriod.MIN then "1m"
else ""), if s1 == 1 then GlobalColor("Long") else if s1 == -1 then GlobalColor("Short") else GlobalColor("Neutral"));
AddLabel(!IsNaN(h1) and h1 != 0, If h1 == 1 then "B" else if h1 == -1 then "S" else "-", if h1 == 1 then GlobalColor("arrow Buy") else if h1 == -1 then GlobalColor("arrow Sell") else color.gray);
 
H

henry1224

Member
VIP
here is the code to add a cloud feature for the FE

Code:
# Cloud feature forceIndex FE by Henry Z Kaczmarczyk 2020-25-07
def FELin =  If FE < .382 then FE else Double.Nan;
def FENonLin = If FE > .618 then FE else Double.Nan;
AddCloud(FELin,.382,Color.Cyan,color.Cyan);
AddCloud(FENonLin ,.618,Color.Dark_Orange,Color.Dark_Orange);
##################################
Just add it to the script after GAMMA around line 180 in the original indicator
 
T

trouble56

New member
VIP
Add the RSI-L in your lower study and set the aggregation period to two minutes. Next add the RSI-L to your lower study again, but make sure its in the same rectangle as your first RSI-L Study. Set the aggregation period to 15 minutes. When the 15m RSI-L is in an uptrend place entries using the 2m once the 2m has crossed above the OS line. Do the inverse for you short entries. That way when you enter a trade you will be following the same direction as the longer term trend to give you a better edge. I hope this helps.
@BWiz I can't find an RSI-L which enables me to set the aggregate period. Would you be willing to share the study you are using? thank you
 
B

british43

New member
Hello, I would like have this study as a lower indicator. Whenever I add plot 0 to 100 the chart is off. Not sure what I'm doing wrong. Any assistance would be greatly appreciate.

Code:
# RSI in Laguerre Time Scaled to Price

# Mobius
# V01.08.2016

declare lower;
script Scale {
    input c = close;
    input Min = 0;
    input Max = 1;
    def hh = HighestAll(c);
    def ll = LowestAll(c);

    plot Range = (((Max - Min) * (c - ll)) /  (hh - ll)) + Min;

}

#Inputs:
input gamma = .5;

# Variables:
def c;
def CU1;
def CU2;
def CU;
def CD1;
def CD2;
def CD;
def L0;

def L1;

def L2;

def L3;

def RSI;
def min;
def max;

# Calculations

c = close;
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;
min = Lowest(c);
max = Highest(c);
plot RescaledRSI = Scale(c = RSI, min = min, max = max);
RescaledRSI.SetStyle(Curve.FIRM);
RescaledRSI.SetLineWeight(2);
RescaledRSI.AssignValueColor(if RescaledRSI > RescaledRSI[1]

                                  then Color.CYAN
                                  else Color.YELLOW);

plot line0 = 0;
plot line10 = 10;
plot line20 = 20;
plot line30 = 30;
plot line40 = 40;
plot line50 = 50;
plot line60 = 60;
plot line70 = 70;
plot line80 = 80;
plot line90 = 90;
plot line100 = 100;
 
Last edited:
R

RyanBGrindin

New member
VIP
@markos I am having issues with the scanner. I just have it set for crossing over 0.2 within the last bar (also tried setting it to crossing over OS which is also 0.2) combined with a market cap and volume filter. It sometimes has correct stocks listed but some have not crossed over 0.2 for over a week. For example on the 4 hour aggregation UPS shows up on the scanner as crossing within the last bar but it has not crossed since approximately 25 bars ago. I'll link the scanner and provide a screenshot. I'll also post a screenshot of UPS on the 4 hour aggregation chart showing it hasn't crossed recently. Here is the scanner link: http://tos.mx/7s3U2dP


 
BenTen

BenTen

Administrative
Staff
VIP
@RyanBGrindin There is a mismatch between your chart's setting and your scanner's setting. Your chart includes extended hours while your scanner does not. I would pick one option and make sure both are aligned with each other. If you prefer to keep the extended hours on, then I would check the box that says, "EXT" in your scanner.
 
R

RyanBGrindin

New member
VIP
I know we already discussed this but just do it doesn't look like this is solved, this wasn't the issue. Using extended hours on the scanner still doesn't always match with the chart. And taking extended hours off the charts doesn't fix the issue either.

Edit: On second consideration, I'm not sure. UPS still doesn't cross but it is around 0.1 but this could be due to the fact that there hasn't been a new bar since 1:30 EST when extended hours is off.
 
Last edited:

Similar threads

Top