Relative Volatility Index (RVI) custom watch list


Category:
0
0

Hello Hahn,

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

  • Relative Volatility Index (RVI)  above 55 then background color red
  • Relative Volatility Index (RVI) below 45 then background color green

Thanks,

 

j

Would you please copy/paste the entire code right here as I don’t know anything about coding?

I want to make a donation for the help.

RESOLVED
Marked as spam
Posted by (Questions: 22, Answers: 63)
Asked on March 13, 2018 10:28 pm
495 views
0
Private answer

Here you go:

input stDevLength = 10;
input averageLength = 14;
input averageType = AverageType.EXPONENTIAL;
def stDevHi = stDev(high, stDevLength);
def stDevLo = stDev(low, stDevLength);
def avgStDevHiUp = MovingAverage(averageType, if high > high[1] then stDevHi else 0, averageLength);
def avgStDevHiDown = MovingAverage(averageType, if high < high[1] then stDevHi else 0, averageLength);
def avgStDevLoUp = MovingAverage(averageType, if low > low[1] then stDevLo else 0, averageLength);
def avgStDevLoDown = MovingAverage(averageType, if low < low[1] then stDevLo else 0, averageLength);
def rviHi = if avgStDevHiUp + avgStDevHiDown == 0 then 50 else 100 * avgStDevHiUp / (avgStDevHiUp + avgStDevHiDown);
def rviLo = if avgStDevLoUp + avgStDevLoDown == 0 then 50 else 100 * avgStDevLoUp / (avgStDevLoUp + avgStDevLoDown);
plot RVI = (rviHi + rviLo) / 2;
AssignBackgroundColor(if RVI > 55 then Color.RED else if RVI < 45 then Color.GREEN else Color.BLACK);

Everything here is copied directly from the built in indicator that comes with thinkorswim. The only thing I added is the last statement, which assigns the background color of each cell in the watchlist column. Screenshot shows the result.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4117)
Answered on March 14, 2018 8:07 am
0
Private answer

You are the best, I will test this now. Be expecting a donation.

Marked as spam
Posted by (Questions: 22, Answers: 63)
Answered on March 14, 2018 9:41 am