RSI Laguerre with Fractal Energy for ThinkorSwim

@MBF You need to use the study and the scan in the first post of this thread. Putting the Gamma into that study will be several days due to time. You don't actually need it but it might give you an edge....
 

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

MBF, try this:
Code:
# Scan for RSI in Laguerre Time With Fractal Energy
# Mobius
# V02.07.2014
# V03.06.15.2016
#Scan
#Inputs:
input nFE = 13;
# 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 < .58;
# Short Scan
plot Short = RSI crosses below .8 and gamma > .6;

Please note how Mobius set it up in the bottom 5 lines. That controls the scan. You will need to change the FE, which is the Gamma, to 8 to match the study.
Try it with different variations, over and over, scan the same 25 or 50 stocks and see how your results are... flip the < and > signs and learn.
Have a great day, Grasshopper!
 
@Brady0524 The RSI Laguerre Study and Scan are complete and can be found at this thread's start. Please load them up and try them out. In the tutorial section there is something called how to drive the scanner, inside that post you will find two videos on working with the scanner and turning a dynamic scan into a watchlist.
Please review those, they should help explain any problems you may have.

Please consider loading the Slim Ribbon study located here in the forum. It's scheme is based on 8-13-21EMA cross for signals. I also got that from Slim at TheoTrade. Once that is loaded, you will find that it matches up very nicely with the RSI Laguerre. Slim Ribbon has alerts baked in.
Cu1BFEWl.jpg
@markos hey hey, where'd you get those fancy blue labels there?
 

Attachments

  • Cu1BFEWl.jpg
    Cu1BFEWl.jpg
    58.9 KB · Views: 122
Like this @markos ?

# Long Scan
# plot Long = RSI crosses above .2 and gamma < .8;

I thought they said above or below .3 and gamma .6? Why you no like dis one?
 
@markos hey hey, where'd you get those fancy blue labels there?
Those fancy blue labels don't work properly at all. Someone with serious programming chops might be able to make it work, but with the advent of the /ES or SPX now having a Wednesday Expiration, they've messed up the calculation. I won't share a broken indicator that it's creator won't use anymore.
 
  • Like
Reactions: MBF
no no I got it, here

input nFE = 13;
instead 8 ;)
Yes, you got it! About the post above this one. Try different things and look at the resulting scan on 10-20 stocks and see what they have in common.
Pay close attention to the time frame you scan in and the chart you look at. That's why I shared the 2 chart grid.
The larger time frame helps you see the set-up and the smaller time frame shows you the signal. Now, go forth, run scans and take notes.
One last thing, stick with a larger, liquid list so that patterns and s/r show up better. Don't test with penny stocks or small cap stocks, they can be moved to easily if just one institution sells / buys shares too quickly.
 
Last edited:
Like this @markos ?
# Long Scan
# plot Long = RSI crosses above .2 and gamma < .8;
I thought they said above or below .3 and gamma .6? Why you no like dis one?
All variations of the same theme. That is why testing and observing the scan results is the best way to learn. Don't dismiss the other results however. One day, the other scans will work better than the current one you deem best. Sometimes it depends on the companies that you are scanning, etc.
I must have a dozen, now broken (thanks tos), scans for different conditions.
 
  • Like
Reactions: MBF
@MBF Oops, just to be sure you aren't going down a rabbit hole 🐇🐰 , read what I wrote at the bottom of post #67. Put that concept, if not the actual code, into the bottom of the code I shared in post #1. And keep all of your code in Notepad++. It's free.
 
Last edited:
@markos I see a lot of people are either premarket or not premarket. Why is this? I ask because while studying I have my premarket on with this indicator. I am noticing a lot of contradictions and no confluence. Can you explain why one way is better than the other and/or if this is even worth worrying about? This is also a non LaGuerre query.
 
@markos I see a lot of people are either premarket or not premarket. Why is this? I ask because while studying I have my premarket on with this indicator. I am noticing a lot of contradictions and no confluence. Can you explain why one way is better than the other and/or if this is even worth worrying about? This is also a non LaGuerre query.
It's midnight here and what am I doing vs sleeping? Helping a seriously motivated person with their queries. That's ok, I know your thirst for knowledge. And you help the community by taking care of softball questions like a person asking how to import a study. We all appreciate your enthusiasm.

With the LaGuerre RSI or the Slim Ribbon, it's important to have pre & post market turned off because of something called pre-fetch. I am told that an EMA uses 7 times more bars in the past than it does going forward. A 10 period EMA will not give a true 10 period reading if pre-post hours are counted. You have 6 1/2 hours each day with RHT. Then theres 17 1/2 hours calculated between Real Time Hours. If you use a 1 hour chart, 70 periods + 10 for the EMA = 80 hours calculated. That's 3.333 days of computation for that EMA. Oh forget it... o_O I'm exhausted. Ignore that babble!

The real answer is to ask a Day Trader like @mc01439 , or a CMT (we have at least one here but it's not my place to say who).
........It depends on your time frame and the market you trade in.......
Good evening, Sir.
 
It's midnight here and what am I doing vs sleeping? Helping a seriously motivated person with their queries. That's ok, I know your thirst for knowledge. And you help the community by taking care of softball questions like a person asking how to import a study. We all appreciate your enthusiasm.

With the LaGuerre RSI or the Slim Ribbon, it's important to have pre & post market turned off because of something called pre-fetch. I am told that an EMA uses 7 times more bars in the past than it does going forward. A 10 period EMA will not give a true 10 period reading if pre-post hours are counted. You have 6 1/2 hours each day with RHT. Then theres 17 1/2 hours calculated between Real Time Hours. If you use a 1 hour chart, 70 periods + 10 for the EMA = 80 hours calculated. That's 3.333 days of computation for that EMA. Oh forget it... o_O I'm exhausted. Ignore that babble!

The real answer is to ask a Day Trader like @mc01439 , or a CMT (we have at least one here but it's not my place to say who).
........It depends on your time frame and the market you trade in.......
Good evening, Sir.
Now, WHAT is THIS shenanigans! Lawd, lawd. Well, thank you ma'am for explaining, what? Well, I have no idea but certainly, I am going to further research this. As Rossana Rossana Danna used to say, "Well Markos it just goes to show you, If its not one thing it's another."
 
Now, WHAT is THIS shenanigans! Lawd, lawd. Well, thank you ma'am for explaining, what? Well, I have no idea but certainly, I am going to further research this. As Rossana Rossana Danna used to say, "Well Markos it just goes to show you, If its not one thing it's another."
I miss Roseann Roasana Danna! Classic TV. ...and Who you callin' ma'am? 🧐 🧐 Look for a new thread on Investment Books to Recommend.
Silly questions like the one you had last night can be answered via Investopedia and school.stockcharts.com and certain wise people like @P/L on Twitter.
 
I miss Roseann Roasana Danna! Classic TV. ...and Who you callin' ma'am? 🧐 🧐 Look for a new thread on Investment Books to Recommend.
Silly questions like the one you had last night can be answered via Investopedia and school.stockcharts.com and certain wise people like @P/L on Twitter.
Hmm:unsure: youve called me boy and sir, ma'am.😁

Will do, looking now. Thank you!
Okay also heading to twit!
 
@J007RMC please post the scan you are using. I'm curious as to where you put the HullMA. btw. congratulations on the trades! 🆒 🥳
 
Ahh, here installed from Bens posting,,,,,,
https://tos.mx/x3Rk12Z

#Follow @Krose_TDA on twitter for updates to this and other custom columns
#TD Ameritrade IP Company, Inc. (c) 2008-2019
#Follow @Krose_TDA on twitter for updates to this and other custom columns
#Input desired parameters using the input statements below

input price = close;
input length = 20;
input WithinBars = 1;

def hma = HullMovingAvg(price,length);

def TriglableBull = hma[1]<hma[2] and hma>hma[1];
def TriglableBear = hma[1]>hma[2]and hma < hma[1];
def trigger = TriglableBear or TriglableBull;

addlabel(yes,if triglableBear then "bear" else if TriglableBull then "Bull" else " ");
 
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!!
Marcos, can you be more specific where are the alerts? I downloaded it , but do not see alerts! Thanks for replying!
 
Marcos, can you be more specific where are the alerts? I downloaded it , but do not see alerts! Thanks for replying!
@Talochka click on the beaker at the top of the chart. Click on the little gear to the right of the study. If you don't see alerts at the bottom, close the input panel. When that moves up, you should be able to see the alerts.
 
Ahh, here installed from Bens posting,,,,,,
https://tos.mx/x3Rk12Z

#Follow @Krose_TDA on twitter for updates to this and other custom columns
#TD Ameritrade IP Company, Inc. (c) 2008-2019
#Follow @Krose_TDA on twitter for updates to this and other custom columns
#Input desired parameters using the input statements below

input price = close;
input length = 20;
input WithinBars = 1;

def hma = HullMovingAvg(price,length);

def TriglableBull = hma[1]<hma[2] and hma>hma[1];
def TriglableBear = hma[1]>hma[2]and hma < hma[1];
def trigger = TriglableBear or TriglableBull;

addlabel(yes,if triglableBear then "bear" else if TriglableBull then "Bull" else " ");
Not quite it, please post a share of your chart where the signals came through. I am curious. Thanks.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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