Rogers-Satchell Volatility (ROGERSSATCHELL)
Summary
Rogers-Satchell volatility: a range-based estimator that reads one bar's open, high, low and close as a single unbiased estimate of that bar's variance, then reports the root of the mean over the last n bars, scaled to periods per year.
What separates it from the other range estimators is that it is unbiased whatever the drift. A bar that opens at its low and closes at its high has travelled in one direction and dispersed nothing around that path, and this estimator reads it as exactly zero, where Parkinson and Garman-Klass read a wide range as volatility. The price of that is a blind spot of its own: the estimator has no close-to-open term, so overnight gaps are invisible to it.
Read the output as a fraction in log-return units, not price units and not percent. At an optInAnnualization of 252 it is an annualised figure for daily bars; pass 1 to leave the per-bar figure, 52 for weekly bars, 12 for monthly.
Chart
Chart metadata i
Outputs
outReal:line·zero·positive
Formula
S1[i] = ln(High[i]/Open[i]) I1[i] = ln(Low[i]/Open[i]) X1[i] = ln(Close[i]/Open[i])
term[i] = S1[i] * (S1[i] - X1[i]) + I1[i] * (I1[i] - X1[i])
= ln(High[i]/Close[i]) * ln(High[i]/Open[i])
+ ln(Low[i]/Close[i]) * ln(Low[i]/Open[i])
S[i] = term[i-n+1] + ... + term[i]
out[i] = sqrt(A) * sqrt(S[i] / n) when S[i] > 0
= 0 otherwisewith n = optInTimePeriod and A = optInAnnualization.
Notes
The estimator is defined on a consistent bar, one whose low is at or below both the open and the close and whose high is at or above both. Such a bar always gives a term at or above zero. A bar whose high or low sits strictly between its open and close can give a negative term; the window sum is then floored at zero rather than rooted, as VAR floors its variance so STDDEV can root it unconditionally.
A bar carrying a price at or below zero contributes a zero term and still counts toward the window's n. The test is exact rather than against a fixed band, so an instrument quoted in small units is not zeroed out by the threshold.
The window sum is carried from bar to bar and rebuilt as a fresh sum whenever it collapses relative to the largest it has held, and periodically otherwise. A window of flat bars therefore reads exactly zero; a sum that is only ever added to and subtracted from would leave the rounding of earlier bars behind instead.
optInAnnualization is applied as sqrt(A) computed once and multiplied in at the end, so the annualised output is exactly sqrt(A) times the per-bar one, and A = 1 is an identity rather than a rounding.
Every term reads only its own bar, so the lookback is n - 1: the first output lands on bar n - 1. An estimator that measures the bar against the previous close consumes one more bar and starts at n.
Inputs
inOpen— Open price of each barinHigh— High price of each barinLow— Low price of each barinClose— Close price of each bar
Outputs
outReal— Estimated volatility, in log-return units
Parameters
| Parameter | Type | Default | Accepted values | Description |
|---|---|---|---|---|
optInTimePeriod | integer | 10 | 1–100000 | Number of bars in the window. n = 1 is the paper's own single-bar estimator. |
optInAnnualization | real | 252 | ≥ 0 | Periods per year. Pass 1 for the per-bar figure. |
Properties
Numerical Stability: Start-Independent
| ☐ Overlap Input |
| ✅ Independent Y-Axis i |
| ☐ Candlestick |
| ☐ Display Shift |
| ☐ Can Output NaN or ±Inf |
| ☐ Identity at Period 1 |
| ✅ Uses Transcendental i |
| ✅ Input Must Be Positive i |
Example
#include <stdio.h>
#include <ta_libc.h>
int n = 252;
double open[252]; /* your data, oldest first */
double high[252]; /* your data, oldest first */
double low[252]; /* your data, oldest first */
double close[252]; /* your data, oldest first */
double out[252];
int outBegIdx, outNBElement;
TA_Initialize();
TA_ROGERSSATCHELL( 0, n - 1, open, high, low, close, 10, 252.0, &outBegIdx, &outNBElement, out );
printf( "%d values from bar %d: [%.4f, ..., %.4f]\n", outNBElement, outBegIdx, out[0], out[outNBElement - 1] );use ta_lib::Core;
let open = vec![0.0; 252]; // your data, oldest first
let high = vec![0.0; 252]; // your data, oldest first
let low = vec![0.0; 252]; // your data, oldest first
let close = vec![0.0; 252]; // your data, oldest first
let mut out = vec![0.0; 252];
let core = Core::new();
let range = core.rogerssatchell(0, open.len() - 1, &open, &high, &low, &close, 10, 252.0,
&mut out)?;
println!("{} values from bar {}: [{:.4}, ..., {:.4}]", range.count, range.beg_idx, out[0], out[range.count - 1]);import io.github.talib.Core;
import io.github.talib.OutRange;
import java.util.Locale;
double[] open = new double[252]; // your data, oldest first
double[] high = new double[252]; // your data, oldest first
double[] low = new double[252]; // your data, oldest first
double[] close = new double[252]; // your data, oldest first
double[] out = new double[252];
Core core = Core.DEFAULT;
OutRange r = core.rogerssatchell(0, open.length - 1, open, high, low, close, 10, 252.0, out);
System.out.printf(Locale.ROOT, "%d values from bar %d: [%.4f, ..., %.4f]%n", r.count(), r.begIdx(), out[0], out[r.count() - 1]);using System;
using TALib;
var open = new double[252]; // your data, oldest first
var high = new double[252]; // your data, oldest first
var low = new double[252]; // your data, oldest first
var close = new double[252]; // your data, oldest first
var outReal = new double[252];
var core = Core.Default;
OutRange r = core.Rogerssatchell(0, open.Length - 1, open, high, low, close, 10, 252.0, outReal);
Console.WriteLine(FormattableString.Invariant($"{r.Count} values from bar {r.BegIdx}: [{outReal[0]:F4}, ..., {outReal[r.Count - 1]:F4}]"));import { rogerssatchell } from 'ta-lib';
const open = new Float64Array(252); // your data, oldest first
const high = new Float64Array(252); // your data, oldest first
const low = new Float64Array(252); // your data, oldest first
const close = new Float64Array(252); // your data, oldest first
const { begIdx, values } = rogerssatchell({ open, high, low, close }, {
timePeriod: 10,
annualization: 252,
});
console.log(values.length + ' values from bar ' + begIdx + ': [' + values[0].toFixed(4) + ', ..., ' + values[values.length - 1].toFixed(4) + ']');import (
"fmt"
"log"
talib "ta-lib.github.io/go"
)
open := make([]float64, 252) // your data, oldest first
high := make([]float64, 252) // your data, oldest first
low := make([]float64, 252) // your data, oldest first
close := make([]float64, 252) // your data, oldest first
out := make([]float64, 252)
core := talib.NewCore()
r, err := core.ROGERSSATCHELL(0, len(open)-1, open, high, low, close, 10, 252, out)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%d values from bar %d: [%.4f, ..., %.4f]\n", r.NBElement, r.BegIdx, out[0], out[r.NBElement-1])Implementation
Added in 0.8.3 (ta-lib-python 0.8.3).
TA-Lib Definition: rogerssatchell.c · rogerssatchell.yaml
| Native | File |
|---|---|
| C | ta_ROGERSSATCHELL.c |
| Rust | rogerssatchell.rs |
| Java | Core_ROGERSSATCHELL.java |
| C# | Core_ROGERSSATCHELL.cs |
| TypeScript | rogerssatchell.ts |
| Go | rogerssatchell.go |
Python: talib.ROGERSSATCHELL (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
Rogers-Satchell Volatility, Rogers Satchell, RSV
See Also
References
- Rogers, L. C. G. and Satchell, S. E. "Estimating Variance From High, Low and Closing Prices." The Annals of Applied Probability 1(4):504-512, November 1991. doi:10.1214/aoap/1177005835