//@Name:RVI //@Description:Relative Volatility Index // Author: ShareScript Support // The RVI uses the same formula as the RSI, but uses the standard // deviation of the high and the low prices instead of the average // upward and downward daily movement. // Care has been taken in preparing this code but it is provided without guarantee. // You are welcome to modify and extend it. Please add your name as a modifier if you distribute it. function init() { this.periods = 10; //RVI periods setTitle(periods+" RVI"); setHorizontalLine(60); setHorizontalLine(50); setHorizontalLine(40); setSeriesLineStyle(1,Pen.Dot); } function getGraph(share, data) { var rvi = new Array(); //relative volatility index var ma1 = new MA(periods); //high MA settings var ma2 = new MA(periods); //low MA settings var h1 = 0; var l1 = 0; var h2 = new Array(); var l2 = new Array(); var avHigh = new Array(); //high MA var avLow = new Array(); //low MA for (var j=0;j