Bentrix Docs
HomePricingDashboard

Relative Volatility Index, high-low form (RVI (HL))

Volatilityoscillatorone linein every package

Dorsey's refined RVI: an RSI built from the standard deviation of the highs and of the lows rather than from price changes, between 0 and 100.

It measures the direction of volatility.

01The study, live

Live figureScroll to zoom, drag the bars to pan.
50
bar —O — H — L — C —main line —first value at —
Show where:

Computed by Bentrix’s own code over the same synthetic bars on every page — an illustration of how the study behaves, not a market.

What this figure shows

The figure is computed over 300 sample bars. RVI (HL) has no value on the first 22 — the bars it needs before it can answer — and its first value stands on bar 23. Its line runs between 15.88 and 77.85 on these bars, and the last value is 64.21. The pane's scale is fixed at 0 to 100, the range the study can take. Counting the conditions the study declares on these bars: crosses above 50 6 times; crosses below 50 6 times. Press a condition under the figure to see each place marked. As states rather than moments: is above 50 on 142 bars; is below 50 on 136 bars.

02Its parts, named

The bars it readseach bar's open, high, low and closeWarm-upno value on the first 22 bars: thestudy needs them before it cananswerThe main linethe study's own value on each barLevel 50a fixed reference the study is readagainst
Computed by Bentrix’s own code over the sample bars. It is drawn on once, as you reach the figure.

03What you see

The Relative Volatility Index on highs and lows: an RSI-like ratio of upward to total standard deviation, computed separately on highs and lows and averaged.

A line between 0 and 100 in its own pane. It looks like an RSI but is built from volatility: it is high when the standard deviation has been counted mostly on rising bars and low when mostly on falling ones.

04Where it comes from

Donald Dorsey introduced the Relative Volatility Index in 1993 and refined it in 1995. His idea was to measure the direction of volatility — whether the standard deviation has been growing on rising or on falling days — as a confirming study to set beside momentum indicators, which measure the direction of price.

05The formula

RVI(x)=100·σ↑~σ↑~+σ↓~,RVI (HL)=RVI(H)+RVI(L)2
H, Lthe highs and the lows, each worked separately
σ↑~, σ↓~the standard deviation on bars where the series rose, and where it fell, each smoothed

For the highs and for the lows separately: take the standard deviation of the last StdDev Period values; on a bar where the series rose, count that deviation as up, where it fell as down; smooth both with Wilder's average over the Time Period; and form 100 × up / (up + down). The index is the mean of the two results, one from the highs and one from the lows.

06A worked example

Follow the highs alone, with a time period of 3. Suppose that on three successive bars the 10-bar standard deviation of the highs was 0.80, 0.90 and 1.10, and the highs rose, fell and rose.

The up figures are 0.80, 0, 1.10 and the down figures 0, 0.90, 0. Their averages are 0.633 and 0.300.

RVI of the highs = 100 × 0.633 / (0.633 + 0.300) = 67.9

The same steps on the lows might give 55.3. The index is their mean: (67.9 + 55.3) / 2 = 61.6.

On real bars: take ten bars with highs 21, 23, 22, 24, 23, 22, 24, 25, 23, 24, lows 19, 20, 20, 21, 21, 20, 21, 22, 21, 21 and closes 20, 22, 21, 23, 22, 21, 23, 24, 22, 23, with the standard deviation over 2 bars and a time period of 2. The index reads 37.3 on the ninth bar, where highs and lows both fell, and 49.9 on the last.

07Built in Assay

The same study written in Assay, Bentrix’s script language, and drawn by Bentrix itself as the script’s graph: each block is one step of the formula. On the ladder the steps stand in the script’s order, one a row; on the board each wire carries a value from the block that gives it to the block that reads it, left to right. The script computes exactly what the study computes — Bentrix checks the two against each other, candle by candle.

THE SCRIPT’S GRAPH
//@version=6
indicator("Relative Volatility Index, high-low form")
length = input.int(14, "Time Period")
stddevPeriod = input.int(10, "StdDev Period")
value = talib.RVIR(length, stddevPeriod)
// An RSI of volatility: the standard deviation counted on rising and on falling bars, from highs and lows.
plot(value, "RVI")
hline(50)

Paste it into the Assay IDE to put it on a chart, or to change it. Looking at the graph is free in every package; editing it as blocks is Plus.

08Readings — what traders look for

Above 50 is read as volatility having arrived mostly on bars whose highs and lows rose; below 50, on bars where they fell.

As a confirmation, and how that fails. Donald Dorsey designed it to confirm other indicators, not to stand alone: above 50, volatility has been arriving with rises. It fails when volatility arrives equally on both sides, where it hovers at 50 and says nothing.

09In different markets and timeframes

The Relative Volatility Index says on which kind of bar volatility has been arriving. Dorsey meant it as a confirming study: it hovers near 50 when volatility is even-handed.

It stays above 50 through an advance in which the highs keep extending and below it through a decline; in a range it crosses 50 repeatedly. Dorsey read it on daily bars beside other studies and not alone. Its inner deviation uses 10 bars and its smoothing 14, so it turns after the move has shown itself. It reads highs and lows, so on markets that gap a gap enters as a jump in both series on the same bar.

10With other studies

Read beside the RSI, as Dorsey intended — the two measure direction of volatility and direction of price.

11What it does not tell you

!

It does not measure how large volatility is — only on which kind of bar it has been counted. A reading of 70 can come from a calm market or a violent one.

12Inputs and defaults

RVI (HL) (14, 10)settings card
1Time Period14
2StdDev Period10
3TimeframeChart
4Wait for the candle to closeOn
  1. 1
    Time Period — 14Time period of the Wilder smoothing applied to both indices
  2. 2
    StdDev Period — 10Time period of the standard deviation
  3. 3
    Timeframe — ChartThe chart's own by default; any higher one, read on the last closed candle. A finer one is never offered.
  4. 4
    Wait for the candle to close — OnThe value of a higher timeframe is taken only from a candle that has finished.

What each input changes

  • Time PeriodThe number of bars looked back over. Longer: steadier and later. Shorter: quicker and noisier.
  • StdDev PeriodThe window of the standard deviation that is counted as up or down. Dorsey used 10.
  • In use14 for the smoothing, 10 for the standard deviation.

13Limits and common misreadings

Not the Relative Vigor Index, which shares the abbreviation and is unrelated.

Two periods, and a warm-up that needs both.

The 1995 revision. This is Dorsey's later form, the mean of a highs version and a lows version; his 1993 original used closes.

14Conditions an alert or a strategy can watch

crosses above 50 eventcrosses below 50 eventis above 50 stateis below 50 state

Event: the bar it happens on an event happens on one barState: every bar while it holds a state holds on every bar while it lasts

These are the conditions the study itself declares — the same rules the alert editor and the strategy engine read, and the ones the figure's chips show.

15Practise it in the laboratory

Put RVI (HL) 14 and RSI 14 in two panes; find a stretch where they disagree and look at how the size of the bars differed between the rising and the falling days.

Open the laboratory

17In Bentrix

  • From the menu: a chart's Indicators button › Volatility › RVI (HL), or type RVI (HL) in its search.
  • Its settings: the settings card opens when it is added; its legend's name opens it again.

18From an agent or a program

Two tools reach it. study_values computes it over a workbench’s candles up to the clock — no chart needed — and study_attach puts it on a chart, where it is drawn and saved with the chart ({"chart": "<chart uri>", "kind": "rvi_hl"}).

The study, as a chart files it

This is a new RVI (HL)’s entry — its kind, its calculation, the price it reads and its settings. Change a setting here to read it with other inputs.

{
  "applied": "close",
  "convention": "talib",
  "kind": "rvi_hl",
  "settings": {
    "shape": "ta",
    "values": {
      "optInStdDevPeriod": 10.0,
      "optInTimePeriod": 14.0
    }
  }
}

An agent

An agent calls the MCP tool with it:

{
  "name": "study_values",
  "arguments": {
    "bench": "bentrix://lab/\u2026/bench/\u2026",
    "symbol": "EURUSD",
    "timeframe": "H1",
    "limit": 5,
    "study": {
      "applied": "close",
      "convention": "talib",
      "kind": "rvi_hl",
      "settings": {
        "shape": "ta",
        "values": {
          "optInStdDevPeriod": 10.0,
          "optInTimePeriod": 14.0
        }
      }
    }
  }
}

A program

A program does the same in its language — bench and market as in the built-in indicators guide:

Python

values = client.study.values(bench, market, "H1", {"applied": "close", "convention": "talib", "kind": "rvi_hl", "settings": {"shape": "ta", "values": {"optInStdDevPeriod": 10.0, "optInTimePeriod": 14.0}}}, limit=5)
print("times:", values["times"])
for line in values["lines"]:
    print("line:", line["line"])
    print("  newest values:", line["values"])

JSJavaScript

const values = await client.study.values({ bench, symbol: market, timeframe: "H1", study: { "applied": "close", "convention": "talib", "kind": "rvi_hl", "settings": { "shape": "ta", "values": { "optInStdDevPeriod": 10.0, "optInTimePeriod": 14.0 } } }, limit: 5 });
console.log("times:", values.times);
for (const line of values.lines) {
  console.log("line:", line.line);
  console.log("  newest values:", line.values);
}

C#C#

var values = await client.Study.Values(bench, market, "H1", new Dictionary<string, object?> { ["applied"] = "close", ["convention"] = "talib", ["kind"] = "rvi_hl", ["settings"] = new Dictionary<string, object?> { ["shape"] = "ta", ["values"] = new Dictionary<string, object?> { ["optInStdDevPeriod"] = 10.0, ["optInTimePeriod"] = 14.0 } } }, limit: 5);
Console.WriteLine($"times: {values!["times"]!}");
foreach (var line in values!["lines"]!.AsArray())
{
    Console.WriteLine($"line: {line!["line"]!}");
    Console.WriteLine($"  newest values: {line!["values"]!}");
}

GOGo

values := must(client.Study.Values(ctx, mcp.StudyValuesArgs{Bench: bench, Symbol: market, Timeframe: "H1", Study: map[string]any{"applied": "close", "convention": "talib", "kind": "rvi_hl", "settings": map[string]any{"shape": "ta", "values": map[string]any{"optInStdDevPeriod": 10.0, "optInTimePeriod": 14.0}}}, Limit: mcp.Ptr[int64](5)}))
fmt.Println("times:", at(values, "times"))
for _, line := range at(values, "lines").([]any) {
	fmt.Println("line:", at(line, "line"))
	fmt.Println("  newest values:", at(line, "values"))
}

Java

Object values = client.study.values(new Bentrix.StudyApi.ValuesArgs(bench, market, "H1", obj("applied", "close", "convention", "talib", "kind", "rvi_hl", "settings", obj("shape", "ta", "values", obj("optInStdDevPeriod", 10.0, "optInTimePeriod", 14.0)))).limit(5L));
System.out.println("times:" + " " + at(values, "times"));
for (Object line : (List<Object>) at(values, "lines")) {
    System.out.println("line:" + " " + at(line, "line"));
    System.out.println("  newest values:" + " " + at(line, "values"));
}

C++C++

auto values = client.study.values_(StudyApi::ValuesArgs(bench, market, "H1", Json::Object{{"applied", "close"}, {"convention", "talib"}, {"kind", "rvi_hl"}, {"settings", Json::Object{{"shape", "ta"}, {"values", Json::Object{{"optInStdDevPeriod", 10.0}, {"optInTimePeriod", 14.0}}}}}}).limit(5));
std::cout << "times:" << " " << values["times"].dump() << std::endl;
for (const Json &line : values["lines"].arr()) {
    std::cout << "line:" << " " << line["line"].dump() << std::endl;
    std::cout << "  newest values:" << " " << line["values"].dump() << std::endl;
}

Julia

values = client.study.values(bench, market, "H1", Dict{String,Any}("applied" => "close", "convention" => "talib", "kind" => "rvi_hl", "settings" => Dict{String,Any}("shape" => "ta", "values" => Dict{String,Any}("optInStdDevPeriod" => 10.0, "optInTimePeriod" => 14.0))); limit = 5)
println("times:", " ", values["times"])
for line in values["lines"]
    println("line:", " ", line["line"])
    println("  newest values:", " ", line["values"])
end

RR

values <- client$study$values(bench, market, "H1", list(applied = "close", convention = "talib", kind = "rvi_hl", settings = list(shape = "ta", values = list(optInStdDevPeriod = 10.0, optInTimePeriod = 14.0))), limit = 5)
cat("times:", format(values$times), "\n")
for (line in values$lines) {
  cat("line:", format(line$line), "\n")
  cat("  newest values:", format(line$values), "\n")
}

RRust

let values = client.study().values(mcp::StudyValuesArgs::new(bench.clone(), market.clone(), "H1", serde_json::json!({"applied": "close", "convention": "talib", "kind": "rvi_hl", "settings": {"shape": "ta", "values": {"optInStdDevPeriod": 10.0, "optInTimePeriod": 14.0}}})).limit(5))?;
println!("times: {}", values["times"]);
for line in values["lines"].as_array().into_iter().flatten() {
    println!("line: {}", line["line"]);
    println!("  newest values: {}", line["values"]);
}

Reading the answer

  • times — the candles’ open times, in milliseconds since 1970 (UTC), oldest first.
  • lines — one entry per line, in this order, each with its line name and its values; values[i] belongs to the candle at times[i].
  • The last value is the candle at the clock’s, which may still be forming: it changes until that candle closes, as on the chart. Nothing after the clock is ever computed.
  • null is a candle with no value yet — the warm-up, about 1 × the period at the start of the history.
  • Its fixed levels, drawn on the chart: [50.0].
lineWhat it is
Mainthe indicator's own value

In a strategy

Filed under a key of your choice in a strategy document’s studies — here rvi_hl: {"rvi_hl": {"applied": "close", "convention": "talib", "kind": "rvi_hl", "settings": {"shape": "ta", "values": {"optInStdDevPeriod": 10.0, "optInTimePeriod": 14.0}}}} — its rules can name:

WriteWhat it is
rvi_hlits main line, as a value in a compare
{"cond": "rvi_hl:level.cross_up:50"}a condition it declares itself
{"cond": "rvi_hl:level.cross_down:50"}a condition it declares itself
{"cond": "rvi_hl:level.above:50"}a condition it declares itself
{"cond": "rvi_hl:level.below:50"}a condition it declares itself

19Sources

  1. Rogers, L. C. G. & Satchell, S. E. "Estimating Variance from High, Low and Closing Prices." Annals of Applied Probability, vol. 1, no. 4, 1991.
  2. Dorsey, Donald. "The Relative Volatility Index." Technical Analysis of Stocks & Commodities, June 1993.
  3. Dorsey, Donald. "Refining the Relative Volatility Index." Technical Analysis of Stocks & Commodities, September 1995.

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed