RSI Format, Label, Watchlist, Scan For ThinkOrSwim

Wrong -> remove " quote mark at beginning of statement
"RSI()."RSI" is less than 30 within 15 bars and RSI()."RSI" is greater than 32

Right:
RSI()."RSI" is less than 30 within 15 bars and RSI()."RSI" is greater than 32

Save scan and right click as shown below to create alert when scan results change
QfD92zn.png

@sanjeev_mail
 
Last edited:

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

I revised this from a previous post. It works if anyone is interested.

input VLow =30;
#input Low = 0;
#input High = 100;
#input VHigh = 100;

plot RSI = RSI()."RSI";

AssignBackgroundColor(if RSI is less than VLow then Color.DARK_RED
else Color.black);

RSI.assignValueColor (Color.BLACK);
 
Last edited:
Hi guys
I am zero coder, need to ask your help to create custom column in watchlist.
Goal is simple - to have RSI colored column for different TFs.
Below is working code I use, what I can't do is to have it showing exact RSI number instead of "RSI>50" or "RSI<50" like it does now and color it green if >50 and red if <50
Thanks a lot for your help!

input n = 14;
def RSI = RSI(14, 50, 50, close, AverageType.WILDERS);

def rsiUP = RSI > 50;
def rsiDN = RSI < 50;


AddLabel(rsiUP, " RSI > 50 ", Color.GREEN);
AddLabel(rsiDN, " RSI < 50 ", Color.RED);
 
Whipped one up real quick.. thank god for copy paste because I did not know the calculations for RSI off top haha
Code:
#RSILabel

input RSILength = 14;
input price = close;
input averageType = AverageType.WILDERS;
def NetChgAvg = MovingAverage(averageType, price - price[1], RSILength);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), RSILength);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = 50 * (ChgRatio + 1);

AddLabel(yes, Concat("RSI=", RSI), Color.YELLOW);

Right as I post @J007RMC beat me to it haha
Great label love how it displays the RSI number, tried adding greater than 50 green and less than 50 red; but having error messages. Can you help with that ?
 
Great label love how it displays the RSI number, tried adding greater than 50 green and less than 50 red; but having error messages. Can you help with that ?
Ruby:
#RSILabel

input RSILength = 14;
input price = close;
input averageType = AverageType.WILDERS;
def NetChgAvg = MovingAverage(averageType, price - price[1], RSILength);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), RSILength);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = 50 * (ChgRatio + 1);

AddLabel(yes, "RSI= " +RSI,
if RSI>to then color.green else color.red);
 
Hi guys
I am zero coder, need to ask your help to create custom column in watchlist.
Goal is simple - to have RSI colored column for different TFs.
Below is working code I use, what I can't do is to have it showing exact RSI number instead of "RSI>50" or "RSI<50" like it does now and color it green if >50 and red if <50
Thanks a lot for your help!
Ruby:
input n = 14;
def RSI = RSI(14, 50, 50, close, AverageType.WILDERS);

def rsiUP = RSI > 50;
def rsiDN = RSI < 50;


AddLabel(rsiUP, RSI, Color.GREEN);
AddLabel(rsiDN, RSI, Color.RED);
 
@horserider thanks for this ultimate RSI.
Using the simple version (no clouds or BB) with a length of 8 on a 5min timeframe with regular old MACD works well for me on the stocks of the day with lowish floats moving from news etc. Quick question:
I cant seem to figure out how to put code in that will cause an "up arrow" and "ding" when the RSI line crosses the moving-avg-of-the-RSI line (aka midline). Any chance you could help with that?
thansk!
 
Last edited by a moderator:
@horserider thanks for this ultimate RSI.
Using the simple version (no clouds or BB) with a length of 8 on a 5min timeframe with regular old MACD works well for me on the stocks of the day with lowish floats moving from news etc. Quick question:
I cant seem to figure out how to put code in that will cause an "up arrow" and "ding" when the RSI line crosses the moving-avg-of-the-RSI line (aka midline). Any chance you could help with that?
thansk!
Code:
declare lower;
#RSI
input length = 5;
input over_Bought = 80;
input over_Sold = 20;
input price = close;
input averageType = AverageType.WILDERS;
input line = 50;

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);
plot OverSold = over_Sold;
plot OverBought = over_Bought;
plot lline = 50;


#                ==== THE FIVE ====
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"));

OverSold.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(8));

#plot 5;

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));

plot uparrow = if RSI crosses above midline  then midline else double.NaN ;
uparrow.SetPaintingStrategy(PaintingStrategy.ARROW_up);
uparrow.SetDefaultColor(color.magenta) ;
uparrow.SetLineWeight(1);

plot dnarrow = if RSI crosses below midline  then midline else double.NaN ;
dnarrow.SetPaintingStrategy(PaintingStrategy.ARROW_down);
dnarrow.SetDefaultColor(color.blue) ;
dnarrow.SetLineWeight(1);

Alert(uparrow, "RSI cross above", Alert.Bar, Sound.ding);
Alert(dnarrow, "RSI cross below", Alert.Bar, Sound.bell);
 
@MerryDay @BenTen is this still available ?RSI watchlist column
There are at least a dozen watchlist scripts in this thread. Here are just three from the first page:
https://usethinkscript.com/threads/rsi-format-label-watchlist-scan-for-thinkorswim.798/#post-6215
https://usethinkscript.com/threads/rsi-format-label-watchlist-scan-for-thinkorswim.798/#post-6222
https://usethinkscript.com/threads/rsi-format-label-watchlist-scan-for-thinkorswim.798/#post-8612

Anything created for a label will also work for the watchlist. Plug&Play the various scripts and see what works for you.
 
How can you measure the distance between a 5 and 10 minute standard rsi?

Also how could you scan for it? Say if its over 10pts or -10pts.
 
Grand Father, Father and Son RSI Strategy

I read about this strategy that Called Grand Father, Father, and Son Strategy looks promising for Swing Trading.
Strategy is:
RSI Length 14
Upper Band 60
Lower Band 40

Grand Father:
Monthly Time Frame RSI Cross upper 60
Father:
Weekly Time Frame RSI Cross upper 60
and Son:
Daily Time Frame RSI moving upward from Lower Band 40

So How do I Scan using Conditional Wizard or does anyone code this please to find the stock in these conditions?
So basically need to scan stock in Monthly and Weely Time frame cross upper 60 and Daily Time frame Under RSI Lower Band 40?

Thank you
 
Last edited by a moderator:
Grand Father, Father and Son RSI Strategy

I read about this strategy that Called Grand Father, Father, and Son Strategy looks promising for Swing Trading.
Strategy is:
RSI Length 14
Upper Band 60
Lower Band 40

Grand Father:
Monthly Time Frame RSI Cross upper 60
Father:
Weekly Time Frame RSI Cross upper 60
and Son:
Daily Time Frame RSI moving upward from Lower Band 40

So How do I Scan using Conditional Wizard or does anyone code this please to find the stock in these conditions?
So basically need to scan stock in Monthly and Weely Time frame cross upper 60 and Daily Time frame Under RSI Lower Band 40?

Thank you
https://usethinkscript.com/threads/answers-to-commonly-asked-questions.6006/#post-72503
 
The following code is a TOS stock code for RSI. By default, an arrow is plotted when the rsi < over_bought and also when the rsi > over_sold. What I have been racking my brain to figure out how to plot an arrow, or point(doesnt matter) when rsi = rsi. In other word, when it is neither overbought nor oversold. In other words, the text that is bolded below. I've tried everything. Is there anyone that can help me with this?

declare lower;

input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
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;

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

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

RSI.DefineColor("OverBought", GetColor(5));
RSI.DefineColor("Normal", GetColor(7));
RSI.DefineColor("OverSold", GetColor(1));
RSI.AssignValueColor(if RSI > over_Bought then RSI.Color("OverBought") else if RSI < over_Sold then RSI.Color("OverSold")
else RSI.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)
 
It seems "Normal" wasn't being plotted

declare lower;

input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
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;

plot RSI = 50 * (ChgRatio + 1);
plot OverSold = over_Sold;
plot OverBought = over_Bought;
plot UpSignal = if RSI crosses above OverSold then OverSold else Double.NaN;
plot DownSignal = if RSI crosses below OverBought then OverBought else Double.NaN;
plot Normal = RSI > OverSold and RSI < OverBought;

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

RSI.DefineColor("OverBought", GetColor(5));
RSI.DefineColor("Normal", GetColor(7));
RSI.DefineColor("OverSold", GetColor(1));
RSI.AssignValueColor(if RSI > over_Bought then RSI.Color("OverBought") else if RSI < over_Sold then RSI.Color("OverSold") else RSI.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);

https://github.com/ConnorSmiley/UseThinkScript/blob/main/OverBought > RSI < OverSold
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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