RSI Laguerre with Fractal Energy for ThinkorSwim

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

RSI-Laguerre using an exponent of price (found in the thinkscript lounge archive)

15:40 Mobius: Frank... This is RSI-Laguerre using an exponent of price. It's several bars faster at the same lengths.
15:40 Mobius: And, It will still positive signals at lengths as low as 4.
15:41 Mobius: still make positive signals .......
15:42 Mobius: Nothing particulalry smooth about it though. That was just a by-product of TOS normalizing the MA line when you stuck it in RSIL and not a real picture of what it was doing
15:44 AlphaInvestor: Thanks Mobius - another toy for the toolbox
15:45 UpTheCreek: ^^^ ditto


View attachment 20107


# RSIL_ExponentOfPrice_V09_2022_10_20_Mobius
#
# RSI in Laguerre Time Self Adjusting With Fractal Energy
# Mobius
# 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.
# V09.10.20.2022
# Altered iData to Exponent of price.
# Faster at the same length settings and able to produce absolute signals at lengths as short as 4.

declare lower;

#Inputs:
input nFE = 13;#hint nFE: length for Fractal Energy calculation.

# Variables:
def o;
def h;
def l;
def c;
def cl;
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 / (open[2] / open[1]);
H = high / (high[2] / high[1]);
L = low / (low[2] / low[1]);
Cl = close / (close[2] / close[1]);
c = (h+l+Cl)/3;

## GAMMA CALC & PLOT (comment by jq)
plot gamma = Log(Sum((Max(H, C[1]) - Min(L, C[1])), nFE) /
(Highest(H, nFE) - Lowest(L, 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];


## DEFINES CU1 & CD2 FOR CU2 & CD2 (comment by jq)
if L0 >= L1
then {
CU1 = L0 - L1;
CD1 = 0;
} else {
CD1 = L1 - L0;
CU1 = 0;
}

## DEFINES CU2 & CD2 FOR CU & CD (comment by jq)
if L1 >= L2
then {
CU2 = CU1 + L1 - L2;
CD2 = CD1;
} else {
CD2 = CD1 + L2 - L1;
CU2 = CU1;
}

## DEFINES CU & CD FOR S (comment by jq)
if L2 >= L3
then {
CU = CU2 + L2 - L3;
CD = CD2;
} else {
CU = CU2;
CD = CD2 + L3 - L2;
}

def s = CU / (CU + CD);

## RSI PLOT (comment by jq)
RSI = if CU + CD <> 0 then s else 0;
RSI.SetDefaultColor(Color.Cyan);

## RSI BANDS (comment by jq)
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();

## FRACTAL ENERGY BANDS (comment by jq)
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();

## CLOUDS (comment by jq)
AddCloud(0, OS, Color.Green, Color.Green);
AddCloud(OB, 1, Color.Red, Color.Red);

## ALERTS ( comment by jq)
Alert(RSI crosses below .9, "", Alert.BAR, Sound.Bell);
Alert(RSI crosses above .1, "", Alert.BAR, Sound.Bell);

# End Code RSI_Laguerre Self Adjusting with Fractal Energy
Now that is fast! This is an adaptation of the ORIGINAL Mobius RSI that was introduced in Theotrade in 2016. Great for Day Traders. Thanks for finding this form the archive.
 
Is there a way to put a 10EMA in the Fractal Energy script? I was able to convert FE to TC2000 and develop scan where the the FE drops below the 10 EMA which gave me good results for when we get expansion. TC2000 doesnt require TOS but I would like to do the same thing in Think or Swim. As of now my only option is above/below values (ex 20,60)
 
Now that is fast! This is an adaptation of the ORIGINAL Mobius RSI that was introduced in Theotrade in 2016. Great for Day Traders. Thanks for finding this form the archive.
@markos as a long term investor are you using this particular RSI indicator: version RSIL_ExponentOfPriceV09_2022_10_20? Which other indicators do you personally use to help improve your timing entry/exits, trend & momentum analysis, risk management etc..? Do you use MACD and/or PPO? ATR? I would greatly appreciate if you could share your feedback on any particular technical indicators that you recommend for someone that is generally long term investing and/or longer term trading. I am looking to improve my timing (entry/exits), have better means of analyzing trends, momentum, and overall improve risk management. In addition if there are any other unique scripts/tools which have helped you with fundamental analysis would love to hear your take. Thank you in advance.
 
Last edited:
I am just beginning some due diligence research into Laguerre RSI. I am partial to the standard RSI but wouldn’t mind some smoothing. First thing I did was Google “laguerre rsi repaint”.



I’ll put the Google AI’s full response below, if interested, but the summary was:



If you're using the Laguerre RSI for trading signals, be aware of potential repainting issues, especially with versions that use the "gamma" parameter. Consider using a non-repainting version of the indicator (such as one using a calculation period).



My question: Can I trust what this particular AI is telling me about this and, if so, can anyone point me toward a version of Laguerre RSI that is “using a calculation period” ?

Also, any guidance that might save me some pitfalls and time wasted would be seriously appreciated.



AI Overview:

The user is asking about the "Laguerre RSI" indicator and whether it "repaints". Here's a breakdown of what that means:

1. What is the Laguerre RSI?

  • It's a momentum indicator used to measure the speed and strength of price changes.
  • It's based on the Laguerre filter and is known to be more responsive to price changes compared to the traditional RSI.
2. What is "Repainting" in the context of Trading Indicators?

  • Repainting refers to an indicator changing its past values or signals as new price data becomes available.
  • Indicators that repaint often use future or ongoing bar data to recalculate and adjust their historical readings, which can be misleading for traders.
  • Non-repainting indicators, on the other hand, do not change their past values or signals once a bar is closed.
3. Does the Laguerre RSI Repaint?

  • Yes, the traditional Laguerre RSI, particularly versions that use the "gamma" parameter, can repaint.
  • This repainting behavior is due to how the indicator's calculations use current price data to adjust historical values, especially when the "gamma" parameter is involved.
4. How to Avoid Repainting in the Laguerre RSI (or other indicators)?

  • Use Calculation Period instead of "Gamma": One way to create a non-repainting Laguerre RSI is to use a calculation period instead of the "gamma" parameter in the indicator's formula.
  • Wait for Bar Closure: A general practice to minimize repainting effects, especially for indicators that use current bar data, is to wait for the candle to close before acting on the indicator's signals.
5. Why Avoid Repainting Indicators (for Trading Signals)?

  • False Sense of Accuracy: Repainting indicators can make past signals appear more accurate than they were in real-time, potentially leading traders to believe they have a more profitable strategy than they actually do.
  • Misleading Entry and Exit Points: Repainting can change historical entry and exit points, making it difficult to backtest a strategy effectively.
In Conclusion:

If you're using the Laguerre RSI for trading signals, be aware of potential repainting issues, especially with versions that use the "gamma" parameter. Consider using a non-repainting version of the indicator (such as one using a calculation period) or focusing on using the Laguerre RSI for identifying trends or confirming signals from other non-repainting indicators.
 
I am just beginning some due diligence research into Laguerre RSI. I am partial to the standard RSI but wouldn’t mind some smoothing. First thing I did was Google “laguerre rsi repaint”.

Good news; this version of RSI Laguerre does not repaint
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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