Display RSI for different / secondary stock ticker


Category:
0
0

Want to add RSI for “SPY” as a lower study on stock charts.  Have searched the web and site for secondary or different stock ticker but nothing comes up.

Is there anyway to display a study for a stock ticker other than the one being shown on the chart?

Thank you.

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on March 20, 2021 7:32 am
79 views
0
Private answer

There is no way to do this through any user settings. The only way to accomplish this in the current version of Thinkorswim is to create a new custom chart study with modifications to read from an alternate ticker symbol.

Here is the code for RSI based on an alternate ticker symbol:

declare lower;
input alternateTicker = "SPY";
input rsiLength = 14;
input rsiAverageType = AverageType.WILDERS;
input oversold = 70;
input overbought = 30;
def netChangeAverage = MovingAverage(rsiAverageType, close(alternateTicker) - close(alternateTicker)[1], rsiLength);
def totalChangeAverage = MovingAverage(rsiAverageType, AbsValue(close(alternateTicker) - close(alternateTicker)[1]), rsiLength);
def changeRatio = if totalChangeAverage != 0 then netChangeAverage / totalChangeAverage else 0;
plot rsi = 50 * (changeRatio + 1);
plot os = oversold;
os.SetDefaultColor(GetColor(8));
plot ob = overbought;
ob.SetDefaultColor(GetColor(8));

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on March 20, 2021 8:49 am