Relative Volatility Index, refined high/low form (RVIR)
Summary
Relative Volatility Index, refined form: Donald Dorsey's 1995 revision of his own indicator, which runs the 1993 RVI over the daily highs and again over the daily lows and averages the two indices.
Output is bounded [0..100] and is interpreted like RVI: above 50 the highs and lows have been more volatile while rising than while falling, below 50 the reverse. Dorsey's stated reason for the revision is that a high and a low carry the day's range, so the pair answers the question the close alone can only approximate.
Chart
Chart metadata i
Outputs
outReal:line·zero·positive
Formula
RVIR[i] = 0.5 * ( RVI(high)[i] + RVI(low)[i] )
Both legs use the same optInTimePeriod and optInStdDevPeriod, so they warm on the same bar.
Notes
- RVIR is the 1995 revision;
RVIis the 1993 version.
Inputs
inHigh— High price of each barinLow— Low price of each bar
Outputs
outReal— The averaged index, in 0..100
Parameters
| Parameter | Type | Default | Accepted values | Description |
|---|---|---|---|---|
optInTimePeriod | integer | 14 | 1–100000 | Wilder smoothing period applied to both legs of both indices |
optInStdDevPeriod | integer | 10 | 2–100000 | Number of trailing values each standard deviation spans |
Properties
Numerical Stability: Initial Unstable Period — Inherited from RVI, which RVIR computes internally; tunable via RVI's unstable period.
| ☐ Overlap Input |
| ✅ Independent Y-Axis i |
| ☐ Candlestick |
| ☐ Display Shift |
| ☐ Can Output NaN or ±Inf |
| ☐ Identity at Period 1 |
| ☐ Uses Transcendental |
| ☐ Input Must Be Positive |
Example
#include <stdio.h>
#include <ta_libc.h>
int n = 252;
double high[252]; /* your data, oldest first */
double low[252]; /* your data, oldest first */
double out[252];
int outBegIdx, outNBElement;
TA_Initialize();
TA_RVIR( 0, n - 1, high, low, 14, 10, &outBegIdx, &outNBElement, out );
printf( "%d values from bar %d; last out = %f\n", outNBElement, outBegIdx, out[outNBElement - 1] );use ta_lib::Core;
let high = vec![0.0; 252]; // your data, oldest first
let low = vec![0.0; 252]; // your data, oldest first
let mut out = vec![0.0; 252];
let core = Core::new();
let range = core.rvir(0, high.len() - 1, &high, &low, 14, 10, &mut out)?;
println!("{} values from bar {}; last out = {}", range.count, range.beg_idx, out[range.count - 1]);import io.github.talib.Core;
import io.github.talib.OutRange;
double[] high = new double[252]; // your data, oldest first
double[] low = new double[252]; // your data, oldest first
double[] out = new double[252];
Core core = Core.DEFAULT;
OutRange r = core.rvir(0, high.length - 1, high, low, 14, 10, out);
System.out.println(r.count() + " values from bar " + r.begIdx() + "; last out = " + out[r.count() - 1]);using System;
using TALib;
var high = new double[252]; // your data, oldest first
var low = new double[252]; // your data, oldest first
var outReal = new double[252];
var core = Core.Default;
OutRange r = core.Rvir(0, high.Length - 1, high, low, 14, 10, outReal);
Console.WriteLine($"{r.Count} values from bar {r.BegIdx}; last outReal = {outReal[r.Count - 1]}");import { rvir } from 'ta-lib';
const high = new Float64Array(252); // your data, oldest first
const low = new Float64Array(252); // your data, oldest first
const { begIdx, values } = rvir({ high, low }, {
timePeriod: 14,
stdDevPeriod: 10,
});
console.log(values.length + ' values from bar ' + begIdx + '; last values = ' + values[values.length - 1]);Implementation
Added in 0.8.3 (ta-lib-python 0.8.3).
TA-Lib Definition: rvir.c · rvir.yaml
| Native | File |
|---|---|
| C | ta_RVIR.c |
| Rust | rvir.rs |
| Java | Core_RVIR.java |
| C# | Core_RVIR.cs |
| TypeScript | rvir.ts |
Python: talib.RVIR (ta-lib-python 0.8.3 or later), see ta-lib-python.
TA-Lib is also available for R and more using a wrapper.
Aliases
Relative Volatility Index (1995 revision), RVIr
See Also
References
- Dorsey, Donald. "Refining the Relative Volatility Index." Technical Analysis of Stocks & Commodities, V.13:9 (September 1995), 388-391.
- Dorsey, Donald. "The Relative Volatility Index." Technical Analysis of Stocks & Commodities, V.11:6 (June 1993), 253-256.