RSI Laguerre with Fractal Energy for ThinkorSwim

@DDW, you are correct on all counts! And you have a great memory. At the beginning of this thread are the Code and Scan that I re-wrote so that they would play nice together. Please also read the thread in the tutorial section as there are good notes from Mobius & Crew. Good trading, Markos
 

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

@markos Have you played with the settings in the RSI Lagurre...Or are you using the default...
I use the default but have tried others. My settings are 8.13,8. A while back I put 3 RSILg's in lowers to compare them. That's the best way to see the diff on multiple time frames. The beta deviation can make good and bad changes as I understand it.

This is from JohnnyQuotron in TSL:
#Inputs:
input nFE = 8;#hint nFE: length for Fractal Energy calculation. Mobius default is 8. Alt. is 5.
input Glength = 13;#hint Glength: length for Gaussian Price Filter. Mobius default is 13
input betaDev = 4;#hint BetaDev: Mobius default is 4. Alt is 8.
 
@ markos

Reply to your second question from the DEMA thread.

RSILg​
def BuySignal = RSI crosses above .10 and gamma < .382;def BuySignal = RSI crosses above .10 and gamma > .60;
def SellSignal = RSI crosses below .90 and gamma < .382;def SellSignal = RSI crosses below .90 and gamma > .60;
3200 Tick
3200 Tick
Date
Profit/Loss
Date
Profit/Loss
4-Mar​
$20.00​
1 Hr 90 days
4-Mar​
$1,920.00​
1 Hr 90 days
11-Mar​
$2,000.00​
($10,460.00)​
11-Mar​
$2,350.00​
$5,690.00​
18-Mar​
$650.00​
18-Mar​
($990.00)​
25-Mar​
$850.00​
4 Hr 180 days
25-Mar​
($1,430.00)​
4 Hr 180 days
1-Apr​
$2,810.00​
$3,070.00​
1-Apr​
($2,500.00)​
($3,460.00)​
8-Apr​
$350.00​
8-Apr​
($1,770.00)​
15-Apr​
$360.00​
1 day 1yr
15-Apr​
$270.00​
1 day 1yr
22-Apr​
($2,810.00)​
$16,170.00​
22-Apr​
($1,780.00)​
($1,840.00)​
29-Apr​
$890.00​
29-Apr​
($1,020.00)​
6-May​
($1,860.00)​
1 day 5yr
6-May​
$920.00​
1 day 5yr
13-May​
$1,140.00​
$39,620.00​
13-May​
$1,580.00​
($37,450.00)​
22-May​
$1,680.00​
22-May​
($2,840.00)​
27-May​
($2,300.00)​
3 day 5yr
27-May​
$3,650.00​
3 day 5yr
3-Jun​
($3,210.00)​
($29,970.00)​
3-Jun​
$80.00​
($1,040.00)​
10-Jun​
($1,580.00)​
10-Jun​
$1,660.00​
17-Jun​
$610.00​
1 wk 10 yr
17-Jun​
$1,380.00​
1 wk 10 yr
24-Jun​
($3,530.00)​
($16,900.00)​
24-Jun​
($3,440.00)​
$17,880.00​
1-Jul​
$670.00​
1-Jul​
($730.00)​
8-Jul​
$750.00​
8-Jul​
$4,260.00​
15-Jul​
$0.00​
15-Jul​
$630.00​
($2,510.00)​
$2,200.00​
 
Hey @markos, was wondering if there were any updates to the script posted? The current RSI script I'm using looks a bit outdated and was curious to what the changes were made.

qSiC8EG.png


So far it looks like the overbought/sold boxes are flipped and the FE looks a bit different. I like how the new FE is moving so will be switching over to the updated code. I think the current code I'm using is from the Theo trades videos and that could be where the discrepancy in the codes are from.
 

Attachments

  • qSiC8EG.png
    qSiC8EG.png
    239.2 KB · Views: 259
Last edited by a moderator:
Hey @markos, was wondering if there were any updates to the script posted? The current RSI script I'm using looks a bit outdated and was curious to what the changes were made.

qSiC8EG.png


So far it looks like the overbought/sold boxes are flipped and the FE looks a bit different. I like how the new FE is moving so will be switching over to the updated code. I think the current code I'm using is from the Theo trades videos and that could be where the discrepancy in the codes are from.
Yes, the upper study is older. Archive it.
You might put several of the lower study in the bottom & experiment with the first two settings. From 8 to 5 on the first, 13 to 8 on the second setting. Don't mess with the 3rd one without unless you understand calculus. Find the settings that work best for you. You may find that the default works best but 5 as a 1st number vs 8 works for some day traders as I understand it. Good luck.
Not to be construed as investment advice.
 
Last edited by a moderator:
I am trying to make a strategy that uses the ttm_trend indicator, RSI Laguerre indicator, and True Momentum Oscillator on the 1h. As of now I am using the simple yet effective signal given by the line in the indicators as well as the color of ttm_trend. Using solely the conditions that all indicators show green or red is already accurate. I was wondering if anybody knows how to provide code that would signal when at least 2/3 of the indicators give a red or green signal not just all 3. As of now, Plot x and q at the bottom show for when all 3 conditions are met. Bullish for x, Bearish for q. I am looking for code that would change this to when 2-3 of any of the conditions are met. To my eye it looks to perform better.

For clarity here are the conditions for each separate indicator in plot x (bullish). Plot q not shown here is opposite.

Condition 1 (Main > Signal)
Condition 2 (RSI > RSI_BearishTrigger) or ((RSI >= RSI[1]) and (RSI > RSI_BullishTrigger))
Condition 3 (trendup is true)

I'm posting the conditions I used along with this including the butchered code I was working with (that was not written by me, RSI Laguerre by Mobius and JQ as well as True Momentum Indicator written by Mobius) and also would like to let anyone who sees this know I'm trying to find a way to effectively use overbought/oversold zones provided by the indicators to enhance the strategy. I'll provide updates as I progress.
Here is a chart example as of now. For any confusion it signals an arrow before the close of a bar so all three may not align. If for example, they were all green at somepoint within the bar but then one closed red it still gives a green arrow. Beware that arrows were aligned poorly and screen may have to be adjusted to separate the candles from signal arrows.

https://tos.mx/6iGf9ms

Code:
declare lower;
input compBars = 6;
input paintBars = no;

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.

input length = 14;
input calcLength = 5;
input smoothLength = 3;

def o = open;
def c = close;
def data = fold i = 0 to length
           with s
           do s + (if c > GetValue(o, i)
                   then 1
                   else if c < GetValue(o, i)
                        then - 1
                        else 0);
def EMA5 = ExpAverage(data, calcLength);
def Main = ExpAverage(EMA5, smoothLength);
def Signal = ExpAverage(Main, smoothLength);

# Variables:
def oh;
def h;
def l;
def ch;
def CU1;
def CU2;
def CU;
def CD1;
def CD2;
def CD;
def L0;
def L1;
def L2;
def L3;
def RSI;
def OS;
def OB;
def TrendUp = Double.NaN;
def TrendDown = Double.NaN;
# Calculations

oh = (open + close[1]) / 2;
h = Max(high, close[1]);
l = Min(low, close[1]);
ch = (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;

OS = if IsNaN(close) then Double.NaN else 0.2;

OB = if IsNaN(close) then Double.NaN else 0.8;
def data1 = (RSI > RSI_BearishTrigger) or ((RSI >= RSI[1]) and (RSI > RSI_BullishTrigger));
def data2 = (RSI < RSI_BullishTrigger) or ((RSI < RSI[1]) and (RSI < RSI_BearishTrigger));
def data3 = trenddown is true;
def data4 = trendup is true;

plot x = (Main > Signal) and (RSI > RSI_BearishTrigger) or ((RSI >= RSI[1]) and (RSI > RSI_BullishTrigger)) and (trendup is true);

plot q = (Main < Signal) and (RSI < RSI_BullishTrigger) or ((RSI < RSI[1]) and (RSI < RSI_BearishTrigger)) and (trenddown is true);
 
@markos For swing trading rather than intraday scalping, would you scan on the daily time frame for candidates and then look at a smaller time frame to pinpoint the entry? Thanks for these scripts.
 
@DDW I would think that would work. A daily and a 1 hour if you would like. There is no absolute number set, Try different settings until you find what works for you. Try this shorter timeframe chart for fun: https://tos.mx/A9Iq7wa
Just remember, an indicator only indicates. It does not TELL anything. Investing is a game of probabilities. These indicators give an edge by helping you define better probabilities, but they won't always help you if you're buying long in a downtrend. That's where chart reading comes in.
I hope that helps. You did go through a membership to watch Doc Severson, didn't you?
 
Last edited:
@veerasareddy Top right hand corner.

GoGLBwA.png
with the new update 1960 released this weekend they finally have figured out how to put the name of the grid on the chart similar to how it is in the style settings now, once you name your grid it will appear to the left of the grid box where the red circle (above) is showing the grid box. currently the name will be right next to it, this is one of the best additions added recently which I asked for at least 5 years ago and multiple times after that as well, at least we have it now.
 

Attachments

  • GoGLBwA.png
    GoGLBwA.png
    244.1 KB · Views: 204
with the new update 1960 released this weekend they finally have figured out how to put the name of the grid on the chart similar to how it is in the style settings now, once you name your grid it will appear to the left of the grid box where the red circle (above) is showing the grid box. currently the name will be right next to it, this is one of the best additions added recently which I asked for at least 5 years ago and multiple times after that as well, at least we have it now.
Thanks @BenTen
 
Hi everyone. I am trying to make a scan in TOS for Mobius's parameters for this;
RSI crosses above .2 and gamma > .6
RSI crosses below .8 and gamma > .6
I got the RSi part, I think, but the gamma is beyond me.
Is this even possible?
Thank you for any help.☺
 
1. Please post what you have so far.
2. Yes, it is possible. Look through my various notes via the search bar. I thought I put a scan on this site that will work with the study I posted. They should be located inside the same post.
3. Can't look for it now & the one I used to have won't work since they "fixed" the scanner. Quite a few RSILg scans broke down that Monday!
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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