RSI custom watch list


Category:
0
0

Hello Hahn,

I was wondering if you could help with the following custom column watch list:

  • RSI above 68 then background color red
  • RSI below 32 then background color green

Thanks,

Yinhosan

RESOLVED
Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on January 29, 2017 3:15 am
2464 views
0
Private answer

Sure thing. I’ll assume you are using the code from the RSI study that comes with Thinkorswim. I will also assume you have viewed our videos located in the “Thinkorswim Watchlist” category. I will just plot the single line needed to color the background.

Quick note, the RSI contains three plots and we only want to have a single plot. So you will need to comment out or delete the OverSold and OverBought plot statements. Then comment out or delete the style statements for those plots.

To the bottom of the existing code (after modifications listed above) you will add:

AssignBackgroundColor(if RSI > 68 then Color.RED else if RSI < 32 then Color.GREEN else Color.BLACK);

Final comment: There is a statement near the bottom of the existing study that colors the plot of the RSI. That statement begins with RSI.AssignValueColor and this will be changing the color of the values in your custom column. If it’s important for you to see the values, you can modify the colors to fit your preference.

You can read more about the GetColor() function here: http://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/GetColor.html

Be sure to up-vote any answers that best solve your question.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 29, 2017 9:41 am
0
Private answer

Hello

sorry i didn’t let you know that i don’t have the code RSI study that comes with Thinkorswim. Would you please copy/paste the entire code right here as I don’t know anything about coding?

Thank you

Marked as spam
Posted by (Questions: 1, Answers: 1)
Answered on January 29, 2017 10:02 am
0
Private answer

For those who don’t want to work with the code, there is a built in column you can add to a watchlist. It’s called “RSICrossover”. Screenshot below shows this column being added to the current set, and the parameters have been opened to display the inputs. You merely need to select your aggregation period, length, crossover type and threshold. You will need to add two columns to accomplish the specified goal. One will be a crossing type Above and the other will be a crossing type Below. The only thing lacking is it does not show a color change, it only shows a value of 1 or 0 depending on if the condition is present. But for those who don’t know anything about the code, this is the best option.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 29, 2017 11:19 am
0

Just adding full working piece of code.

#
# TD Ameritrade IP Company, Inc. (c) 2007-2017
#

declare lower;

input length = 14;
input over_Bought = 70;
input over_Sold = 34;
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);
AssignBackgroundColor(if RSI > 68 then Color.RED else if RSI < 32 then Color.BLUE else Color.BLACK);

( at August 25, 2017 1:04 pm)
0

Well done, thank you!

( at August 25, 2017 1:25 pm)
0
Hi Pete, Currently I have a 4hr, 1hr, and 15 min. RSI column in my watch list and I would like to have colored back round as posted here but for some reason I can only get one time frame to work and can't change the setting to reflect other time frames. I tried using new custom thinkscript and that would not work either. I'm hopeful you have a solution. Thanks, AJ
( at July 19, 2019 1:46 pm)
0
I think you just need to watch some of our videos on custom watchlist columns. We show how to adjust the time frame for each column in most of them. It's quite simple and has nothing to do with the code itself. From the main menu, select Free Tutorials --> Thinkorswim Tutorials. Then navigate using the left-hand side bar. We have an entire topic set aside for Watchlist.
( at July 19, 2019 3:28 pm)
0
Hello, this code works charging the color for signals on oversold and overbought. However, it changes the default color i have on my chart when theres is no signal. Is there anyway to fix this? thanks # # TD Ameritrade IP Company, Inc. (c) 2007-2017 # declare lower; input length = 14; input over_Bought = 70; input over_Sold = 34; 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); AssignBackgroundColor(if RSI > 68 then Color.RED else if RSI < 32 then Color.BLUE else Color.BLACK);
( at August 6, 2021 6:04 am)
0
The final color listed in the last line of code is "Color.BLACK". Change that to whatever color you want to use for the chart when the RSI is not overbought or oversold.
( at August 6, 2021 7:03 am)