Quant Journey

Quant Journey

Framework

Rogers-Satchell Volatility

Jakub's avatar
Jakub
Feb 29, 2024
∙ Paid
1
Share

Introduction:

The Rogers-Satchell volatility estimator extends the concept of volatility measurement by considering not only the high and low prices but also the opening and closing prices within the trading day. This approach allows for a more refined analysis of intraday price movements, accommodating the fact that volatility may arise from the direction of price movements within the day, rather than just the range between the high and low prices.

Applications of Rogers-Satchell Volatility:

  1. Intraday Trading Strategies: Traders focusing on intraday strategies can leverage Rogers-Satchell volatility to gauge the potential price movement range within a day. Understanding intraday volatility helps in setting more precise stop-loss orders and profit targets.

  2. Market Risk Analysis: For risk managers, Rogers-Satchell volatility offers a tool to assess the daily risk profile of assets more accurately. By considering the entire range of intraday prices, it provides a fuller picture of the potential volatility an asset may experience within a single trading session.

  3. Portfolio Management: Portfolio managers can use Rogers-Satchell volatility to better understand the intraday risks associated with different assets, aiding in the construction of portfolios that align with the risk tolerance and investment horizon of their clients.

  4. Volatility Forecasting: Researchers and analysts can incorporate Rogers-Satchell volatility into models that forecast future market volatility. This estimator's detailed approach can improve the accuracy of volatility predictions, benefiting various trading and investment strategies.

import numpy as np
import pandas as pd
import yfinance as yf

# Fetch data from Yahoo Finance
def fetch_data(ticker, start_date, end_date):
    data = yf.download(ticker, start=start_date, end=end_date)
    return data

# Calculate Rogers-Satchell Volatility
def rogers_satchell_volatility(data):
    rs = np.log(data['High'] / data['Close']) * np.log(data['High'] / data['Open']) + \
         np.log(data['Low'] / data['Close']) * np.log(data['Low'] / data['Open'])
    return np.sqrt(rs.mean())

# Enhanced Yang-Zhang Volatility Calculation
def enhanced_yang_zhang_volatility(data):
    log_hl = np.log(data['High'] / data['Low']) ** 2
    log_co = np.log(data['Close'] / data['Open']) ** 2
    log_oc = np.log(data['Open'] / data['Close'].shift(1)) ** 2
    log_cc = np.log(data['Close'] / data['Close'].shift(1)) ** 2
    k = 0.34 / (1.34 + (len(log_cc) + 1) / (len(log_cc) - 1))
    sigma = np.sqrt((log_hl.mean() - (2 * np.log(2) - 1) * log_cc.mean()) + k * log_co.mean() + (1 - k) * log_oc.mean())
    return sigma

# Example Usage
ticker = 'AAPL'  # Example ticker symbol
start_date = '2020-01-01'
end_date = '2021-01-01'

# Fetching the data
data = fetch_data(ticker, start_date, end_date)

# Calculating Volatilities
rs_volatility = rogers_satchell_volatility(data)
yz_volatility = enhanced_yang_zhang_volatility(data)

print(f"Rogers-Satchell Volatility for {ticker}: {rs_volatility}")
print(f"Yang-Zhang Volatility for {ticker}: {yz_volatility}")

Comparison of Volatility Models

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Quant Journey with Code
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture