Ultimate RSI Indicator for ThinkorSwim

C

chillc15

New member
@horserider I have tried several ways but keep getting errors by extracting just the midline and using in an upper study. Suggestions?

Thanks
 
horserider

horserider

Well-known member
VIP
@chillc15 Not sure what you are trying to accomplish making it an upper study. The midline is moving average of the RSI. The midline thus cannot be extracted as it requires the RSI for calculation of the midline values. I do not believe it can be done. Maybe someone has the solution. Sorry I do not.
 
C

chillc15

New member
@chillc15 Not sure what you are trying to accomplish making it an upper study. The midline is moving average of the RSI. The midline thus cannot be extracted as it requires the RSI for calculation of the midline values. I do not believe it can be done. Maybe someone has the solution. Sorry I do not.
@horserider I get that thank you.

One other question. I'am familiar with assign price color but is it possible to assign a price color based on a defined color of "Positive and Up"

RSI2.DefineColor("Positive and Up", Color.GREEN);
RSI2.DefineColor("Positive and Down", Color.DARK_GREEN);
RSI2.DefineColor("Negative and Down", Color.RED);
RSI2.DefineColor("Negative and Up", Color.DARK_RED);
RSI2.AssignValueColor(if RSI2 >= 50 then if RSI2 > RSI2[1] then RSI2.Color("Positive and Up") else RSI2.Color("Positive and Down") else if RSI2 < RSI2[1] then RSI2.Color("Negative and Down") else RSI2.Color("Negative and Up"));

example - I would like to assign the price color based on the following:

When the RSI2 is ("Positive and Up", Color.GREEN); and obviously the reverse price color with RSI2.DefineColor("Negative and Down", Color.RED);

So of course this does not work and looking for some help.
AssignPriceColor(if RSI2 is ("Positive and Up") then Color.GREEN else if RSI2 ("Negative and Down") then Color.RED else Color.YELLOW);

Thanks
 
horserider

horserider

Well-known member
VIP
@chillc15 Here is first request. Make sure left axis is checked. Guess it is possible.

Code:
# Ultimate RSI stripped down to plot the midline  of the average of the RSI.
# Make sure Left Axis is checked in study settings.
# Horserider 1/7/2019 On request from chillc15 after learning use of left axis.

#RSI
input length = 5;

input price = close;
input averageType = AverageType.WILDERS;

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 RSI avg;

input AverageTypeBB = {default SMA, EMA, HMA};
input displaceBB = 0;
input lengthBB = 5;
input Num_Dev_Dn = -2.0;
input Num_Dev_up = 2.0;

plot midline ;

switch (AverageTypeBB) {
case SMA:   
    midline   = reference BollingerBands(RSI, displaceBB, lengthBB, Num_Dev_Dn, Num_Dev_up).Midline;
case EMA:   
    midline   = reference BollingerBands(RSI, displaceBB, lengthBB, Num_Dev_Dn, Num_Dev_up, averageType = AverageType.EXPONENTIAL).Midline;
case HMA: 
    midline   = reference BollingerBands(RSI, displaceBB, lengthBB, Num_Dev_Dn, Num_Dev_up, averageType = AverageType.EXPONENTIAL).Midline;
}

midline.setdefaultColor(getColor(3));
 
D

danushman

New member
Hello Horserider, I have a question about this indicator and wanted to see if we could DM somehow so I could ask you privately. Can I message you somehow or DM you?
 
horserider

horserider

Well-known member
VIP
@danushman No idea if that is possible here. If it is I do not mind you doing it. Maybe ask BenTen if it is possible.
You cannot ask in this thread?
If you are in the discord I believe you can private message there.
 
D

danushman

New member
Would prefer to keep it private if that is OK. On Discord, username is 'dan#1279'. Can also drop me a email if you like - dan-at-nichetheory-dot-com.
 
horserider

horserider

Well-known member
VIP
Did not see that username in The Syndicate discord. Sorry. If you are in that discord message me.
 
D

danushman

New member
Oh i'm sorry i am not on that discord. Not sure how to find it.

I'll just ask here. Basically, I run a charting company and we are building a new charting platform. A customer of mine asked if we could implement your indicator in it and I wanted to ask your permission.
 
horserider

horserider

Well-known member
VIP
Which one? Just curious. I am fine with you using the indicator. My only hope is you are not charging people for the use of the indicator. If so I would frown a bit.
 
D

danushman

New member
Platform is called TrendSpider. We would not charge anyone to use your indicator and we would give credit if you like as well in platform and documentation.
 
horserider

horserider

Well-known member
VIP
Great. Hahaha make me famous.
Seems I looked at Trendspider at some point in the past. Maybe this evening I will look it up again.
 
D

danushman

New member
Awesome! We'll give it a whirl then - if you don't mind drop me a note with how you want attribution displayed if you like. Otherwise, we'll have to say 'by Horserider' which is fine but could look weird. dan-at-trendspider-dot-com works.
 
G

gilda

New member
@horserider @danushman TrendSpider cheapest plan is $14/month. Technically the indicator is only free if you're a paid member :unsure:
 
D

diazlaz

Well-known member
2019 Donor
VIP
@horserider @danushman TrendSpider cheapest plan is $14/month. Technically the indicator is only free if you're a paid member :unsure:
It's a good service, I been a member for over a year, have paid for a second and really haven't used it at all or as much, it has evolved quickly.

Dan I will be in touch 😊. I going to have to block sometime to it again soon.
 
D

danushman

New member
Thank you! Reach out anytime! dan-at-trendspider-dot-com.
 
V

Vosloo

New member
Hi there, new to the forum and have spent a chunk of time searching for a solution but haven't been able to find anything. —

I'm trying to add a 2 Standard deviation channel to an RSI indicator (or really any indicator) in Thinkorswim that has a 2 day look back period on a 5 min chart.

I also have a 5 period exponential moving average based on the RSI tool plotted. All I need now is to add a the linear regression channel with 1 and 2 standard deviations. Easy right? lol

any help will be greatly appreciated, thank you!
 
V

Vosloo

New member
Hi there, new to the forum and have spent a chunk of time searching for a solution but haven't been able to find anything. —

I'm trying to add a 2 Standard deviation channel to an RSI indicator (or really any indicator) in Thinkorswim that has a 2 day look back period on a 5 min chart.

I also have a 5 period exponential moving average based on the RSI tool plotted. All I need now is to add a the linear regression channel with 1 and 2 standard deviations. Easy right? lol

any help will be greatly appreciated, thank you!
Not sure why this got moved to the thread above? Any admin able to assist?
 
horserider

horserider

Well-known member
VIP
@Vosloo Check code here, may assist with what you want to do. Also here is an example of adding lrc to the RSI. Not sure it accomplishes anything beyond just doing overbought and oversold, but here you go.

Code:
declare lower;
#RSI
input length = 5;

input price = close;
input averageType = AverageType.WILDERS;

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;

plot RSI = 50 * (ChgRatio + 1);

#               
RSI.DefineColor("Positive and Up", Color.GREEN);
RSI.DefineColor("Positive and Down", Color.DARK_GREEN);
RSI.DefineColor("Negative and Down", Color.RED);
RSI.DefineColor("Negative and Up", Color.DARK_RED);
RSI.AssignValueColor(if RSI >= 50 then if RSI > RSI[1] then RSI.Color("Positive and Up") else RSI.Color("Positive and Down") else if RSI < RSI[1] then RSI.Color("Negative and Down") else RSI.Color("Negative and Up"));


#plot 5;

input AverageTypeBB = {default SMA};
input displaceBB = 0;
input lengthBB = 5;

plot midline ;
    midline   = reference BollingerBands(RSI, displaceBB, lengthBB, averageType = AverageType.SIMPLE).Midline;
midline.SetDefaultColor(GetColor(3));


plot MiddleLR = InertiaAll(midline );
def dist = HighestAll(AbsValue(MiddleLR - midline )) * 0.6;
plot UpperLR = MiddleLR + dist;
plot LowerLR = MiddleLR - dist;

MiddleLR.SetDefaultColor(GetColor(1));
UpperLR.SetDefaultColor(GetColor(1));
LowerLR.SetDefaultColor(GetColor(1));
 
Top