Firedrops

Parkinson's Volatility Estimator

The Parkinson's Volatility Estimator (PVE) provides an alternative method for assessing market volatility using the highest and lowest prices within a given period. Unlike traditional models that predominantly rely on closing prices, the PVE considers the full range of intra-candle price movements, thereby potentially offering a more comprehensive gauge of market volatility. The estimator is derived from the logarithm of the ratio of the high to low prices, squared and then averaged over the period of interest. This calculation is rooted in the assumption that the logarithmic high-to-low ratio represents a normalized measure of price movements, capturing both upward and downward volatility in a symmetric manner (Parkinson, 1980).

In this specific implementation, the estimator is calculated as follows:

Parkinson’s Volatility = (1/4 log(2)) * (1/n) * Σ from i=1 to n of (log(High_i/Low_i))^2

where n is the lookback period defined by the user, and High_i and Low_i are the highest and lowest prices at each interval i within that period. This formulation takes advantage of the logarithmic properties to scale the volatility measure appropriately, utilizing a factor of 1/4 log(2) to normalize the variance estimate (Parkinson, 1980).

This implementation includes options for output normalization between 0 and 1 and for plotting horizontal lines at specified levels, allowing the estimator to function like an oscillator to evaluate volatility relative to recent market regimes. Users can customize these features through script inputs, enhancing flexibility for various trading scenarios and improving its utility for real-time volatility assessments on the TradingView platform.

Reference:

Parkinson, M. (1980). The extreme value method for estimating the variance of the rate of return. The Journal of Business, 53(1), 61-65.
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?