Repaints RSI in Laguerre Time MTF for ThinkorSwim

Repaints
@Fernwook the TOS scanner does not support secondary aggregations (meaning you cannot use MTF studies in scans)
That makes sence and it was mentioned many times before throughout the forum, thanks for the reply I should know better. I was looking at the code with my novice knowledge and if I am not mistaken the price entry and targets are reared from atr & price relationship? Could you think of any other way to search for rsilg entries and this partocular mtf scanner. I tried all timeframes and can’t figure out a good scan setup to at least not miss the entries by multiple bars ☹️
 

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

I'm sure someone has already done it but I cannot find anywhere. Is it possible to build a RSI Laguerre watchlist with color coding when the indicator is OB/OS
Thanks
 
I'm sure someone has already done it but I cannot find anywhere. Is it possible to build a RSI Laguerre watchlist with color coding when the indicator is OB/OS
Thanks
WL for when in Consolidation/Exhaustion
Minimum 5 days

Moving out of Consolidation when gamma dips below .65 (Testing if that alerts to good entries)

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.



#Inputs:
input nFE = 8;#hint nFE: length for Fractal Energy calculation.
input AlertOn = yes;
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;
def RSI;
def OS;
def 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;
def gamma = Log(Sum((Max(Gh, Gc[1]) - Min(Gl, Gc[1])), nFE) /
        (Highest(gh, nFE) - Lowest(Gl, nFE)))
            / Log(nFE);

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;

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

OB = if IsNaN(c) then Double.NaN else 0.8;

#M = if IsNaN(c) then Double.NaN else 0.5;
#M.SetStyle(Curve.Points);
#M.SetDefaultColor(Color.Gray);
#M.HideBubble();
#M.HideTitle();
def FEh = if isNaN(c) then double.nan else .618;

def FEl = if isNaN(c) then double.nan else .382;


#Alert(AlertOn and RSI crosses below .9, "", Alert.BAR, Sound.Bell);
#Alert(AlertOn and RSI crosses above .1, "", Alert.BAR, Sound.Bell);

# End Code RSI_Laguerre Self Adjusting with Fractal Energy

# Trade Management
def ATR = Average(TrueRange(h,c,l), 20);
def longCond = if RSI crosses above .2
               then c
               else if RSI < .8
                    then double.nan
                    else longCond[1];
def shortCond = if RSI crosses below .8
                then c
                else if RSI > .2
                     then double.nan
                     else shortCond[1];
def upperTarget = if !isNaN(longCond) and ((RSI > RSI[1]) or (RSI > .8))
                  then Round((longCond + (1.5 * ATR)) / TickSize(), 0) * TickSize()
                  else if !isNaN(shortCond) or ((RSI < RSI[1]) or (RSI crosses below .2))
                       then double.nan
                  else upperTarget[1];
def upperBreached = if close crosses above upperTarget
                    then 1
                    else if close crosses below .5
                         then 0
                         else upperBreached[1];
def lowerTarget = if !isNaN(shortCond)
                  then Round((shortCond - (1.5 * ATR)) / TickSize(), 0) * TickSize()
                  else if !isNaN(longCond)
                       then double.nan
                  else lowerTarget[1];
def LTbreach = if close crosses below lowerTarget
               then 1
               else if RSI crosses above .5
                    then 0
                    else LTbreach[1];
#addLabel(upperTarget, if upperBreached
                     #then "Target Breached  " + AsDollars(upperTarget)
                      #else "Target = " + AsDollars(Round(upperTarget, 2)), color.green);
#addLabel(lowerTarget, if LTbreach
                     #then "Target Breached  " + AsDollars(LowerTarget)
                    # else "Target = " + AsDollars(Round(lowerTarget, 2)), color.red);

def FE_Consolidation = gamma > .62 and gamma[1] > .62 and gamma[2] > .62 and gamma[3] > .62 and gamma[4] > .62 and gamma[5] > .62;
#AddLabel(FE_Consolidation, "Cons", Color.YELLOW);

def FE_Exhaustion = gamma < .38 and gamma[1] < .38 and gamma[2] < .38 and gamma[3] < .38 and gamma[4] < .38 and gamma[5] < .38;
#AddLabel(FE_Exhaustion, "Exh", Color.YELLOW);

def MovOutConsol = gamma crosses below .65;

addlabel(yes, if FE_Consolidation then "Cons" else if FE_Exhaustion then "Exh" else if MovOutConsol within 1 bar then "Moving" else "" );

assignBackgroundColor(if Fe_Consolidation then createColor(112,104,95) else if Fe_Exhaustion then createColor(81,77,72) else if MovOutConsol within 1 bar then createColor(8,96,191) else color.DARK_GRAY);

Should add, this code is derived from this post and code Markos shared https://usethinkscript.com/threads/...djusting-with-fractal-energy-usage-notes.219/
 
Last edited:
Hi @BenTen or @Marcos , I'm using the latest version 20190911-v3b blt, 9.11.2019, https://tos.mx/bQOnkR. Is it possible to create a watchlist column of the latest color? Thank you for your help in advance.
I didn't look at what script you are attempting to turn into a watchlist. I am assuming that give you posted this in the RSI MTF thread that it is an MTF script. In which case, it is not possible to turn it into a watchlist as multiple time frames cannot be put into a watchlist column.

The single period RSI Laguerre watchlist can be found:
https://usethinkscript.com/threads/...list-column-for-rsi-laguerre.7337/#post-70884
 
@markos Yep, I specifically recall JQ asked the question to which Mobius said that the Gaussian version won't scan due to complexity issues. He had a scannable version on his MyTrade but last I looked it wasn't there. If you need it, let me know, I have my sources within the lounge all too eager to assist. Regarding the Quad momentum, I have a scaled down version which I absolutely must have whenever I trade, real helpful especially during ultra volatile days. Got to get back to those client submissions. Have a great weekend ahead
Can you share your quad momo? I use the base version but would love to see an upgraded more efficient version.
 
Can you share your quad momo? I use the base version but would love to see an upgraded more efficient version.
Did you know that clicking on a member's name will allow you to see when a member was last seen on the uTS forum? @tomsk has not been seen in a while. :(
 
When I downloaded # 20190911-v3b blt, 9.11.2019, https://tos.mx/bQOnkR it only says V3 not v3b. When I downloaded 20160822-v3a blt, 8.22.2016, https://tos.mx/AFPDeI it gave me a chart. Do you have that indicator marked as "new study on your pic?

@dolomick Since you want less binary take a look at MTF RSI.

View attachment 1576
The study 2nd from the bottom says New study. Do you have this?

When I downloaded # 20190911-v3b blt, 9.11.2019, https://tos.mx/bQOnkR it only says V3 not v3b. When I downloaded 20160822-v3a blt, 8.22.2016, https://tos.mx/AFPDeI it gave me a chart. Do you have these?
 
Last edited by a moderator:
When I downloaded # 20190911-v3b blt, 9.11.2019, https://tos.mx/bQOnkR it only says V3 not v3b. When I downloaded 20160822-v3a blt, 8.22.2016, https://tos.mx/AFPDeI it gave me a chart. Do you have that indicator marked as "new study on your pic?


The study 2nd from the bottom says New study. Do you have this?

When I downloaded # 20190911-v3b blt, 9.11.2019, https://tos.mx/bQOnkR it only says V3 not v3b. When I downloaded 20160822-v3a blt, 8.22.2016, https://tos.mx/AFPDeI it gave me a chart. Do you have these?
Did you know that by clicking on a member's name, you can easily check when they were last seen on the uTS forum? It's a great way to keep track of who's been around recently, and who hasn't. Speaking of which, it looks like @horserider is not currently active. :(

I was not able to find what you are looking for on this forum.
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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