Cumulative RSI & Multiple Timeframe Cumulative RSI - Idea from Larry Connors book

theLEMband

New member
VIP
I was reading about Larry Connors 2 period Cumulative RSI and put together a script last night. Looked at Peloton this AM, running 4, 15, and 1 hour periods (I add them separately, rather than grouping them on the same lower frame). Waiting for 60 min and 15 minute to coincide and then entering on next 4 min trigger yielded signals below:



The code for the current timeframe is:

Code:
# 2-Period CumulativeRSI by theLEMband
# Modification of TOS RSI
# Idea from Larry Connors book

declare lower;

input length = 2;
input over_Bought = 170;
input over_Sold = 30;
input price = close;
input averageType = AverageType.WILDERS;
input showBreakoutSignals = yes;

def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = 50 * (ChgRatio + 1);
plot RSICumul = RSI + RSI[1];
plot OverSold = over_Sold;
plot OverBought = over_Bought;
plot UpSignal = if RSICumul crosses above OverSold then OverSold else Double.NaN;
plot DownSignal = if RSICumul crosses below OverBought then OverBought else Double.NaN;

UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);

RSICumul.DefineColor("OverBought", GetColor(5));
RSICumul.DefineColor("Normal", GetColor(7));
RSICumul.DefineColor("OverSold", GetColor(1));
RSICumul.AssignValueColor(if RSICumul > over_Bought then RSICumul.color("OverBought") else if RSICumul < over_Sold then RSICumul.color("OverSold") else RSICumul.color("Normal"));
OverSold.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(8));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

The code for the alternate timeframe:

Code:
# Alternate Timeframe 2-Period CumulativeRSI by theLEMband
# Modification of TOS RSI
# Idea from Larry Connors book
# add this study for each higher timeframe that you want to see

declare lower;

input timeframe = AggregationPeriod.FOUR_MIN;

input length = 2;
input over_Bought = 170;
input over_Sold = 30;
def price = close(period = timeframe);
input averageType = AverageType.WILDERS;
input showBreakoutSignals = no;

def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = 50 * (ChgRatio + 1);
plot RSICumul = RSI + RSI[1];
plot OverSold = over_Sold;
plot OverBought = over_Bought;
plot UpSignal = if RSICumul < OverSold then OverSold else Double.NaN;
plot DownSignal = if RSICumul > OverBought then OverBought else Double.NaN;

UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);

RSICumul.DefineColor("OverBought", GetColor(5));
RSICumul.DefineColor("Normal", GetColor(7));
RSICumul.DefineColor("OverSold", GetColor(1));
RSICumul.AssignValueColor(if RSICumul > over_Bought then RSICumul.color("OverBought") else if RSICumul < over_Sold then RSICumul.color("OverSold") else RSICumul.color("Normal"));
OverSold.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(8));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

Test it out and see if you find it helpful in conjunction with support/resistance or other signals. Let me know what results.
 

Similar threads

Top