The scanning script is the 2nd script in the 1st post of RSI Laguerre thread. The link is in the top post of this thread.
In order to troubleshoot the issues. We need to be able to see what you are seeing. So we need you to post the following:
- What code did you copy&paste? Even if you think it is the same as the one on the forum. We need to see yours. Maybe the issue is that you missed part of the code when you created the study. Copy&Paste YOUR code into your post.
- Provide a screen grab of the wonky results. Make sure to grab the whole chart or scan or watchlist code etc.. so we can see the aggregations, what stock, and all your settings so we can try to replicate your results and correct them.
After you post the above information, I am sure someone will be able to point you toward possible solutions.
Unsure of how to upload screenshots to the forum, Here are directions.
Hi @MerryDay ...I am currently using, and like, the exact setup that you shared in post #1 of this thread.
1. Below is a copy of the script that you shared for your chart setup in post #1 of this thread:
# TheoTrade 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.
declare lower;
#Inputs:
input nFE = 13;#hint nFE: length for Fractal Energy calculation.
# 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;
plot RSI;
plot OS;
plot OB;
# Calculations
o = (open + close[1]) / 2;
h = Max(high, close[1]);
l = Min(low, close[1]);
c = (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;
RSI.SetDefaultColor(Color.Cyan);
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();
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();
AddCloud(0, OS, Color.Green, Color.Green);
AddCloud(OB, 1, Color.Red, Color.Red);
#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
1. This is the 1st script from post #1 of the RSI Laguerre thread by @markos :
# 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.
# Rename Study to RSILg_FE_Gssn1 for compatability with Scanning
# Adjusted for compatability with scanner based on Mobius' notes. 7-14-19 Markos
declare lower;
#Inputs:
input nFE = 8;#hint nFE: length for Fractal Energy calculation.
input AlertOn = no;
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;
plot RSI;
plot OS;
plot 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;
plot gamma = Log(Sum((Max(Gh, Gc[1]) - Min(Gl, Gc[1])), nFE) /
(Highest(gh, nFE) - Lowest(Gl, nFE)))
/ Log(nFE);
gamma.SetDefaultColor(Color.Yellow);
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;
RSI.SetDefaultColor(Color.Cyan);
OS = if IsNaN(c) then Double.NaN else 0.2;
OS.SetDefaultColor(Color.RED);
OS.HideBubble();
OS.HideTitle();
OB = if IsNaN(c) then Double.NaN else 0.8;
OB.SetDefaultColor(Color.GREEN);
OB.HideBubble();
OB.HideTitle();
M = if IsNaN(c) then Double.NaN else 0.5;
M.SetStyle(Curve.long_dash);
M.SetDefaultColor(Color.Gray);
M.HideBubble();
M.HideTitle();
plot FEh = if isNaN(c) then double.nan else .618;
FEh.SetStyle(Curve.short_DASH);
FEh.HideBubble();
FEh.SetDefaultColor(Color.GRAY);
FEh.HideTitle();
plot FEl = if isNaN(c) then double.nan else .382;
FEl.SetStyle(Curve.short_DASH);
FEl.SetDefaultColor(Color.GRAY);
FEl.HideBubble();
FEl.HideTitle();
AddCloud(0, OS, Color.RED, Color.RED);
AddCloud(OB, 1, Color.Green, Color.Green);
Alert(AlertOn and RSI crosses below .8, "", Alert.BAR, Sound.Bell);
Alert(AlertOn and RSI crosses above .2, "", Alert.BAR, Sound.Bell);
# End Code RSI_Laguerre Self Adjusting with Fractal Energy
In previous post #36 of this thread I asked you how do I make a "SCAN" for "YOUR" RSI Laguerre script that came along with "YOUR" shared chart in post #1 of this thread.
You referred me to post #2 "SCAN" of the RSI Laguerre thread by @markos and here is that script:
# Scan for RSI in Laguerre Time With Fractal Energy
# Mobius
# V02.07.2014
# V03.06.15.2016
#Scan
#Inputs:
input nFE = 8;
# 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 > .6;
# Short Scan
#plot Short = RSI crosses below .8 and gamma > .6;
Please see below pictures of YOUR chart setup "shared_shared_LaguerreTime" along with @markos "RSILg_FE_Gssn1: indicator on the bottom of the chart picture.
I want to use your RSI Laguerre script that came with the chart that your shared on post #1 of this thread.
Your RSI Laguerre and Markos's RSI Laguerre are different and that is why I am getting different results.
When I use Marko's scan with your LaguerreTime indicator that your shared in post #1 the RSI CYAN BLUE line is off. If you look at the pictures above Markos RSILg_FE_Gssn1 RSI CYAN BLUE line is crossing within 2 bars whereas your shared_shared_rsiLaguerreTime is about 4 bars behind.
How do I use your shared_shared_rsiLaguerreTime in a scan??
Thanks and sorry for the wasted real estate.