mfox
Member
Author states:
The cyclic smoothed RSI indicator is an enhancement of the classic RSI , adding
I originally found this little beauty on TradingView, written by WhenToTrade. It combines the dominant cycle length to create adaptive RSI overbought/oversold bands for more responsive signals.
I've found it works perfectly fine on any time frame, for general stocks as well as crypto. I have been combining it with the Volatility Box and a simple MACD. Today I used this combination and pulled a 20 minute, 80% profit from EGOC.
Enjoy.
The cyclic smoothed RSI indicator is an enhancement of the classic RSI , adding
- additional smoothing according to the market vibration,
- adaptive upper and lower bands according to the cyclic memory and
- using the current dominant cycle length as input for the indicator.
I originally found this little beauty on TradingView, written by WhenToTrade. It combines the dominant cycle length to create adaptive RSI overbought/oversold bands for more responsive signals.
I've found it works perfectly fine on any time frame, for general stocks as well as crypto. I have been combining it with the Volatility Box and a simple MACD. Today I used this combination and pulled a 20 minute, 80% profit from EGOC.
mod note: This script is too complicated to scan the Universe of stocks.
Some members have had some success when limiting scans to a small subset such as the S&P100
Code:
# Cyclic RSI
# Origanlly found on Tradingview: https://www.tradingview.com/v/TmqiR1jp/
# Shout out to WentToTrade for the amazing indicator.
# Written in ThinkScript by mfox
# The cyclic smoothed RSI indicator is an enhancement of the classic RSI , adding
# additional smoothing according to the market vibration,
# adaptive upper and lower bands according to the cyclic memory and
# using the current dominant cycle length as input for the indicator.
# The cRSI is used like a standard indicator. The chart highlights trading signals where the signal line # crosses above or below the adaptive lower/upper bands. It is much more responsive to market moves than the basic RSI.
# The indicator uses the dominant cycle as input to optimize signal, smoothing and cyclic memory. To get more in-depth information on the cyclic-smoothed RSI indicator, please read Chapter 4 "Fine tuning technical indicators" of the book "Decoding the Hidden Market Rhythm, Part 1" available at your favorite book store.
declare lower;
def src = close;
input domcycle = 20;
def cyclelen = domcycle / 2;
def vibration = 10;
def leveling = 10.0;
def cyclicmemory = domcycle * 2;
input RSIOversold = 30;
input RSIOverbought = 70;
plot h1 = RSIOversold;
h1.SetDefaultColor(Color.WHITE);
h1.SetPaintingStrategy(PaintingStrategy.DASHES);
h1.SetLineWeight(1);
plot h2 = RSIOverbought;
h2.SetDefaultColor(Color.WHITE);
h2.SetPaintingStrategy(PaintingStrategy.DASHES);
h2.SetLineWeight(1);
def torque = 2.0 / (vibration + 1.0);
def phasingLag = (vibration - 1.0) / 2.0;
script nz {
input data = 0;
def ret_val = if IsNaN(data) then 0 else data;
plot return = ret_val;
}
script rma {
input src = 0;
input length = 0;
def alpha = 1 / length;
def sum = alpha * src + ( 1 - alpha) * nz(sum[1]);
plot return = sum;
}
script change {
input data = 0;
plot return = data - GetValue(data, 1);
}
def up = rma(Max(change(src), 0), cyclelen);
def down = rma(-Min(change(src), 0), cyclelen);
def rsi = if down == 0 then 100 else if up == 0 then 0 else 100 - 100 / (1 + up / down);
def crsi = torque * (2 * rsi - rsi[phasingLag]) + (1 - torque) * nz(crsi[1]);
def lm_hist = if crsi > Highest(crsi, cyclicmemory - 1) and !IsNaN(lm_hist[1])
then crsi
else if -crsi < Lowest(crsi, cyclicmemory - 1) and !IsNaN(lm_hist[1])
then -crsi
else 0;
def lmax = -Highest(lm_hist, cyclicmemory - 1);
def lmin = -Lowest(lm_hist, cyclicmemory - 1);
def mstep = (lmax - lmin) / 100;
def aperc = leveling / 100;
def db = fold dbx = 0 to 100
while (fold blx = 0 to cyclicmemory - 1
with b
do b + if crsi[blx] < lmin + mstep * dbx
then 1
else 0) / cyclicmemory >= aperc
do lmin + mstep * dbx;
def ub = fold ubx = 0 to 100
while (fold ulx = 0 to cyclicmemory - 1
with a
do a + if crsi[ulx] >= lmax - mstep * ubx
then 1
else 0) / cyclicmemory >= aperc
do lmax - mstep * ubx;
plot lowband = db;
lowband.SetDefaultColor(Color.GREEN);
plot highband = ub;
highband.SetDefaultColor(Color.RED);
plot C = crsi;
C.SetDefaultColor(Color.PLUM);
plot Oversold = C < lowband;
Oversold.Hide();
plot Overbought = C > highband;
Overbought.Hide();
plot SuperOversold = lowband < RSIOversold and Oversold;
SuperOversold.Hide();
plot SuperOverbought = highband > RSIOverbought and Overbought;
SuperOverbought.Hide();
AddCloud(db, ub, Color.DARK_GRAY, Color.DARK_GRAY);
AddCloud(0, if SuperOversold then 100 else Double.NaN, Color.GREEN, Color.GREEN);
AddCloud(0, if SuperOverbought then 100 else Double.NaN, Color.RED, Color.RED);
Enjoy.
Last edited by a moderator: