PocketsofTime
New member
I converted the RVSI Trading View script to Think Script and since I am not proficient, just wanted to check it to see if this was good or a better way. They are close but not an exact match, maybe just the difference in platforms but just wanting someone more experienced to take a look.
Trading View
This is mine for TOS
Anyone like to review?
Trading View
Code:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// @fract
//@version=4
// Title
study("Relative Volume Strength Index", "RVSI")
// inputs
avl = input(5, "Volume Length")
l1 = input(10, "RVSI")
ma = input(10, "EMA")
// colors
col_grow_above = color.green
col_grow_below = color.blue
col_fall_above = color.orange
col_fall_below = color.red
// function
nv = cum((change(close)) * volume)
av = ema(nv, avl)
RVSI = rsi(av, l1)
x = ema(RVSI, ma)
//plot
band1 = hline(100, "Overbought", color.red, linestyle=hline.style_dotted, linewidth=2)
band2 = hline(0, "Oversold", color.green, linestyle=hline.style_dotted, linewidth=2)
plot(RVSI, title="RVSI", style=plot.style_line, color=(RVSI>=x? (RVSI[1] < RVSI ? col_grow_above : col_fall_above) : (RVSI[1] < RVSI ? col_grow_below : col_fall_below)), transp=0, linewidth=2)
plot(x, color=#000000)
band3 = hline(50, "half", color=color.gray, linestyle=hline.style_dotted)
This is mine for TOS
Code:
declare lower ;
input avl = 5;
input l1 = 10;
input ma = 9;
def change = close - close[1]; #fixed
def nv = totalSum(change * volume);
def av = ExpAverage(nv, avl);
plot RVSI = reference RSI("price" = av, "length" = l1);
plot x = ExpAverage(RVSI, ma);
plot overbought = 100;
overbought.AssignValueColor(Color.RED);
plot oversold = 0;
oversold.AssignValueColor(Color.GREEN);
rvsi.AssignValueColor(color = if rvsi >= x then
if RVSI[1] < RVSI then color.green else color.ORANGE else
if RVSI[1] < RVSI then color.red else color.RED);
x.AssignValueColor(Color.WHITE);
Anyone like to review?
Last edited by a moderator: