doc headers

This commit is contained in:
Miha Kralj
2026-02-27 07:48:12 -08:00
parent 8a1ba95173
commit 4ab3a7fb53
389 changed files with 6682 additions and 468 deletions
+18 -1
View File
@@ -1,5 +1,22 @@
# ADR: Average Daily Range
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period`, `method` (default AdrMethod.Sma) |
| **Outputs** | Single series (Adr) |
| **Output range** | $\geq 0$ |
| **Warmup** | `ma.WarmupPeriod` bars |
### TL;DR
- The Average Daily Range (ADR) measures the average distance between High and Low prices over a specified period.
- Parameterized by `period`, `method` (default adrmethod.sma).
- Output range: $\geq 0$.
- Requires `ma.WarmupPeriod` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The simplest measure is often the most useful. Why complicate what doesn't need complicating?"
The Average Daily Range (ADR) measures the average distance between High and Low prices over a specified period. Unlike its cousin ATR, ADR ignores gaps entirely. It answers a straightforward question: "How much does this asset typically move within a single bar?"
@@ -132,4 +149,4 @@ O(1) sliding mean of daily ranges. Same running-sum pattern as SMA but applied t
- **Confusing ADR with ATR**: They measure different things. ADR ignores gaps; ATR accounts for them. Know which you need.
- **Wrong smoothing method**: SMA is stable but can jump when old values exit the window. EMA is smoother for trending volatility. Match the method to your use case.
- **Scale dependence**: Like ATR, ADR is absolute. An ADR of 5 on a \$100 stock is 5% volatility; on a \$10 stock, it's 50% volatility. Normalize if comparing across assets.
- **Assuming direction**: High ADR means wide bars, not up or down. Crashes and rallies both produce high ADR.
- **Assuming direction**: High ADR means wide bars, not up or down. Crashes and rallies both produce high ADR.
+18 -1
View File
@@ -1,5 +1,22 @@
# ATR: Average True Range
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` |
| **Outputs** | Single series (Atr) |
| **Output range** | $\geq 0$ |
| **Warmup** | `rma.WarmupPeriod` bars |
### TL;DR
- The Average True Range measures market "heat" with complete disregard for direction.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires `rma.WarmupPeriod` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Volatility is the price of admission. The question is whether the ride is worth it."
The Average True Range measures market "heat" with complete disregard for direction. It ignores whether the market is screaming upward or crashing downward. ATR cares only about magnitude. When ATR is high, expect wide swings. When ATR is low, expect narrow consolidation. Most traders mistakenly use ATR to find entries. Its true power lies in exits and position sizing. ATR answers the critical question: "How far can this asset move against me in a single day?"
@@ -276,4 +293,4 @@ private static TSeries CalculateTrueRange(TBarSeries source)
- Wilder, J. W. (1978). *New Concepts in Technical Trading Systems*. Trend Research. Chapter: Average True Range.
- Kaufman, P. (2013). *Trading Systems and Methods*. Wiley. (ATR-based position sizing)
- Kase, C. (1996). "Trading with the True Range." *Technical Analysis of Stocks & Commodities*. (TR variations)
- Kase, C. (1996). "Trading with the True Range." *Technical Analysis of Stocks & Commodities*. (TR variations)
+18 -1
View File
@@ -1,5 +1,22 @@
# ATRN: Average True Range Normalized
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` |
| **Outputs** | Single series (Atrn) |
| **Output range** | $\geq 0$ |
| **Warmup** | 1 bar |
### TL;DR
- ATRN transforms the absolute ATR into a relative measure by normalizing it to a [0,1] scale using min-max scaling over a lookback window.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Context is everything. A \$5 ATR means nothing until you know the \$5 ATR from last month was \$2."
ATRN transforms the absolute ATR into a relative measure by normalizing it to a [0,1] scale using min-max scaling over a lookback window. This answers the question: "Is current volatility high or low *compared to recent history*?"
@@ -135,4 +152,4 @@ ATRN is a QuanTAlib-specific indicator. Validation confirms:
3. **Regime Detection**: Use ATRN thresholds to switch between mean-reversion (low ATRN) and trend-following (high ATRN) strategies.
4. **Volatility Breakout**: Look for moves from ATRN < 0.2 to ATRN > 0.5 as potential breakout confirmation.
4. **Volatility Breakout**: Look for moves from ATRN < 0.2 to ATRN > 0.5 as potential breakout confirmation.
+18 -1
View File
@@ -1,5 +1,22 @@
# BBW: Bollinger Band Width
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | Source (close) |
| **Parameters** | `period`, `multiplier` (default 2.0) |
| **Outputs** | Single series (Bbw) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period` bars |
### TL;DR
- Bollinger Band Width measures the distance between upper and lower Bollinger Bands, normalized by the middle band.
- Parameterized by `period`, `multiplier` (default 2.0).
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Volatility breeds opportunity. The squeeze precedes the explosion."
Bollinger Band Width measures the distance between upper and lower Bollinger Bands, normalized by the middle band. When BBW is low, the bands are squeezing together, signaling compressed volatility and impending breakout. When BBW is high, the market is in an expanded volatility state. BBW transforms Bollinger Bands from a visual channel indicator into a quantifiable volatility oscillator, enabling algorithmic detection of "squeeze" conditions that often precede significant price moves.
@@ -251,4 +268,4 @@ For default N=20: approximately 424 bytes per instance.
- Bollinger, J. (2001). *Bollinger on Bollinger Bands*. McGraw-Hill. (Original Bollinger Band methodology)
- Bollinger, J. "Bollinger Band Width." BollingerBands.com. (BBW definition and squeeze strategy)
- Connors, L., & Raschke, L. (1995). *Street Smarts*. M. Gordon Publishing. (Squeeze trading strategies)
- Connors, L., & Raschke, L. (1995). *Street Smarts*. M. Gordon Publishing. (Squeeze trading strategies)
+17
View File
@@ -1,5 +1,22 @@
# BBWN: Bollinger Band Width Normalized
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | Source (close) |
| **Parameters** | `period`, `multiplier` (default 2.0), `lookback` (default 252) |
| **Outputs** | Single series (Bbwn) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period + lookback` bars |
### TL;DR
- Bollinger Band Width Normalized (BBWN) extends the standard BBW by normalizing it to a [0,1] range based on historical minimum and maximum values o...
- Parameterized by `period`, `multiplier` (default 2.0), `lookback` (default 252).
- Output range: $\geq 0$.
- Requires `period + lookback` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Normalization transforms volatility chaos into comparable signals."
Bollinger Band Width Normalized (BBWN) extends the standard BBW by normalizing it to a [0,1] range based on historical minimum and maximum values over a lookback period. This normalization enables better comparison across different timeframes, instruments, and market conditions, making it easier to identify relative volatility levels consistently.
+18 -1
View File
@@ -1,5 +1,22 @@
# BBWP: Bollinger Band Width Percentile
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | Source (close) |
| **Parameters** | `period`, `multiplier` (default 2.0), `lookback` (default 252) |
| **Outputs** | Single series (Bbwp) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period + lookback` bars |
### TL;DR
- BBWP (Bollinger Band Width Percentile) measures where the current Bollinger Band Width falls within its historical distribution, expressing the res...
- Parameterized by `period`, `multiplier` (default 2.0), `lookback` (default 252).
- Output range: $\geq 0$.
- Requires `period + lookback` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Where does current volatility rank in the historical distribution? BBWP answers with a percentile."
BBWP (Bollinger Band Width Percentile) measures where the current Bollinger Band Width falls within its historical distribution, expressing the result as a percentile rank between 0 and 1. Unlike BBWN which normalizes using min/max values, BBWP uses percentile ranking which is more robust to outliers.
@@ -113,4 +130,4 @@ where L = lookback period (default 252)
## References
- Bollinger, J. (2001). "Bollinger on Bollinger Bands." McGraw-Hill.
- QuanTAlib PineScript reference implementation (bbwp.pine)
- QuanTAlib PineScript reference implementation (bbwp.pine)
+18 -1
View File
@@ -1,5 +1,22 @@
# CCV: Close-to-Close Volatility
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | Source (close) |
| **Parameters** | `period`, `method` (default 1) |
| **Outputs** | Single series (Ccv) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period + 1` bars |
### TL;DR
- Close-to-Close Volatility (CCV) calculates the annualized standard deviation of logarithmic returns using only closing prices.
- Parameterized by `period`, `method` (default 1).
- Output range: $\geq 0$.
- Requires `period + 1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The simplest volatility measure is often the most robust—when all you have is closing prices, make the most of them."
Close-to-Close Volatility (CCV) calculates the annualized standard deviation of logarithmic returns using only closing prices. This is the foundational volatility measure in quantitative finance, serving as a benchmark against which more sophisticated estimators are compared. The implementation supports three smoothing methods (SMA, EMA, WMA) and annualizes using the standard √252 factor for daily data.
@@ -196,4 +213,4 @@ CCV is a standard volatility measure implemented consistently across platforms:
- Black, F., & Scholes, M. (1973). "The Pricing of Options and Corporate Liabilities." *Journal of Political Economy*.
- Parkinson, M. (1980). "The Extreme Value Method for Estimating the Variance of the Rate of Return." *Journal of Business*.
- Garman, M., & Klass, M. (1980). "On the Estimation of Security Price Volatilities from Historical Data." *Journal of Business*.
- Yang, D., & Zhang, Q. (2000). "Drift-Independent Volatility Estimation Based on High, Low, Open, and Close Prices." *Journal of Business*.
- Yang, D., & Zhang, Q. (2000). "Drift-Independent Volatility Estimation Based on High, Low, Open, and Close Prices." *Journal of Business*.
+18 -1
View File
@@ -1,5 +1,22 @@
# CV: Conditional Volatility (GARCH(1,1))
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | Source (close) |
| **Parameters** | `period` (default 20), `alpha` (default 0.2), `beta` (default 0.7) |
| **Outputs** | Single series (Cv) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period + 1` bars |
### TL;DR
- Conditional Volatility (CV) implements the GARCH(1,1) model for volatility forecasting, the most widely used time-varying volatility model in finan...
- Parameterized by `period` (default 20), `alpha` (default 0.2), `beta` (default 0.7).
- Output range: $\geq 0$.
- Requires `period + 1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Volatility begets volatility—the GARCH model captures what traders have always known: calm markets stay calm, turbulent markets stay turbulent."
Conditional Volatility (CV) implements the GARCH(1,1) model for volatility forecasting, the most widely used time-varying volatility model in financial econometrics. Unlike simple historical volatility measures, GARCH captures two key empirical features of financial returns: volatility clustering (large moves tend to follow large moves) and mean reversion (volatility eventually returns to a long-run average). The output is annualized volatility expressed as a percentage.
@@ -197,4 +214,4 @@ CV/GARCH is proprietary with no direct open-source equivalents using the same ap
- Engle, R. F. (1982). "Autoregressive Conditional Heteroscedasticity with Estimates of the Variance of United Kingdom Inflation." *Econometrica*, 50(4), 987-1007.
- Bollerslev, T. (1986). "Generalized Autoregressive Conditional Heteroskedasticity." *Journal of Econometrics*, 31(3), 307-327.
- Engle, R. F. (2001). "GARCH 101: The Use of ARCH/GARCH Models in Applied Econometrics." *Journal of Economic Perspectives*, 15(4), 157-168.
- Hansen, P. R., & Lunde, A. (2005). "A Forecast Comparison of Volatility Models: Does Anything Beat a GARCH(1,1)?" *Journal of Applied Econometrics*, 20(7), 873-889.
- Hansen, P. R., & Lunde, A. (2005). "A Forecast Comparison of Volatility Models: Does Anything Beat a GARCH(1,1)?" *Journal of Applied Econometrics*, 20(7), 873-889.
+18 -1
View File
@@ -1,5 +1,22 @@
# CVI: Chaikin's Volatility
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `rocLength` (default 10), `smoothLength` (default 10) |
| **Outputs** | Single series (Cvi) |
| **Output range** | $\geq 0$ |
| **Warmup** | 1 bar |
### TL;DR
- Chaikin's Volatility (CVI) measures the rate of change of the EMA-smoothed high-low trading range.
- Parameterized by `roclength` (default 10), `smoothlength` (default 10).
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Volatility expansion precedes major moves—when the trading range starts widening, pay attention."
Chaikin's Volatility (CVI) measures the rate of change of the EMA-smoothed high-low trading range. Unlike traditional volatility measures that focus on returns, CVI directly tracks the expansion and contraction of price ranges over time. A positive CVI indicates expanding volatility (wider trading ranges), while a negative CVI signals contracting volatility (narrower ranges). This makes CVI particularly useful for identifying breakout conditions and market transitions.
@@ -228,4 +245,4 @@ Avoid range trades when: CVI rising sharply
- Chaikin, M. (1966). "Stock Market Trading Systems." Various publications and interviews.
- Achelis, S. B. (2000). "Technical Analysis from A to Z." McGraw-Hill. Chapter on Chaikin Volatility.
- Murphy, J. J. (1999). "Technical Analysis of the Financial Markets." New York Institute of Finance.
- Murphy, J. J. (1999). "Technical Analysis of the Financial Markets." New York Institute of Finance.
+17
View File
@@ -1,5 +1,22 @@
# ETHERM: Elder's Thermometer
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` (default 22) |
| **Outputs** | Single series (Etherm) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period` bars |
### TL;DR
- Elder's Thermometer (ETHERM) measures how far today's price bar extends beyond yesterday's range, capturing the maximum absolute expansion in eithe...
- Parameterized by `period` (default 22).
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Markets run a fever before they crash. The thermometer tells you when to reach for the aspirin."
Elder's Thermometer (ETHERM) measures how far today's price bar extends beyond yesterday's range, capturing the maximum absolute expansion in either direction. Developed by Dr. Alexander Elder and described in *Come Into My Trading Room* (2002, p.162), the indicator distinguishes between sleepy, quiet periods and hot episodes when market crowds become excited. The raw thermometer reading is smoothed with an EMA to produce a signal line; when temperature spikes to triple the signal, it flags an explosive move worth fading. At 5 operations per bar for the raw value and O(1) EMA update, ETHERM is among the cheapest volatility measures to compute.
+18 -1
View File
@@ -1,5 +1,22 @@
# EWMA: Exponentially Weighted Moving Average Volatility
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | Source (close) |
| **Parameters** | `period` (default 20), `annualize` (default true), `annualPeriods` (default 252) |
| **Outputs** | Single series (EWMA) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period` bars |
### TL;DR
- EWMA Volatility calculates market volatility using an exponentially weighted moving average of squared log returns with bias correction.
- Parameterized by `period` (default 20), `annualize` (default true), `annualperiods` (default 252).
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The past doesn't repeat itself, but it does rhyme—and EWMA captures the rhythm of volatility with exponential memory."
EWMA Volatility calculates market volatility using an exponentially weighted moving average of squared log returns with bias correction. Unlike simple historical volatility that weights all observations equally, EWMA gives more weight to recent observations while still considering historical data, making it more responsive to current market conditions.
@@ -165,4 +182,4 @@ Note: This implementation is based on the PineScript reference at `ewma.pine`. T
- J.P. Morgan/Reuters. (1996). "RiskMetrics Technical Document." Fourth Edition.
- Bollerslev, T. (1986). "Generalized Autoregressive Conditional Heteroskedasticity." Journal of Econometrics.
- Hull, J. (2018). "Options, Futures, and Other Derivatives." Chapter on Volatility Estimation.
- Hull, J. (2018). "Options, Futures, and Other Derivatives." Chapter on Volatility Estimation.
+18 -1
View File
@@ -1,5 +1,22 @@
# GKV: Garman-Klass Volatility
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` (default 20), `annualize` (default true), `annualPeriods` (default 252) |
| **Outputs** | Single series (Gkv) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period` bars |
### TL;DR
- Garman-Klass Volatility (GKV) is a range-based volatility estimator that uses all four OHLC prices to provide more efficient volatility estimates t...
- Parameterized by `period` (default 20), `annualize` (default true), `annualperiods` (default 252).
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Why settle for closing prices when you have the full trading range? It's like judging a book by its last page."
Garman-Klass Volatility (GKV) is a range-based volatility estimator that uses all four OHLC prices to provide more efficient volatility estimates than traditional close-to-close methods. Developed by Mark Garman and Michael Klass in 1980, this estimator achieves theoretical efficiency gains of 7-8x over simple close-to-close variance by incorporating intraday price information. The implementation includes RMA (Wilder's) smoothing with bias correction and optional annualization.
@@ -276,4 +293,4 @@ Confirmation: Wait for directional move
- Garman, M. B., & Klass, M. J. (1980). "On the Estimation of Security Price Volatilities from Historical Data." *Journal of Business*, 53(1), 67-78.
- Parkinson, M. (1980). "The Extreme Value Method for Estimating the Variance of the Rate of Return." *Journal of Business*, 53(1), 61-65.
- Rogers, L. C. G., & Satchell, S. E. (1991). "Estimating Variance from High, Low and Closing Prices." *Annals of Applied Probability*, 1(4), 504-512.
- Yang, D., & Zhang, Q. (2000). "Drift-Independent Volatility Estimation Based on High, Low, Open, and Close Prices." *Journal of Business*, 73(3), 477-491.
- Yang, D., & Zhang, Q. (2000). "Drift-Independent Volatility Estimation Based on High, Low, Open, and Close Prices." *Journal of Business*, 73(3), 477-491.
+20 -2
View File
@@ -1,8 +1,26 @@
# HLV: High-Low Volatility (Parkinson)
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` (default 20), `annualize` (default true), `annualPeriods` (default 252) |
| **Outputs** | Single series (Hlv) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period` bars |
### TL;DR
- *Also known as: PV (Parkinson Volatility)*
- Parameterized by `period` (default 20), `annualize` (default true), `annualperiods` (default 252).
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The simplest solution is often the most elegant. When you only need the peaks and valleys, why ask for the whole journey?"
*Also known as: PV (Parkinson Volatility)*
> "The simplest solution is often the most elegant. When you only need the peaks and valleys, why ask for the whole journey?"
High-Low Volatility (HLV), also known as the Parkinson estimator, is a range-based volatility measure that uses only the high and low prices of each period. Developed by Michael Parkinson in 1980, this estimator achieves approximately 5x better efficiency than close-to-close methods by exploiting the information content in the trading range. The implementation includes RMA (Wilder's) smoothing with bias correction and optional annualization.
@@ -291,4 +309,4 @@ Note: HLV may underestimate true volatility due to drift bias
- Parkinson, M. (1980). "The Extreme Value Method for Estimating the Variance of the Rate of Return." *Journal of Business*, 53(1), 61-65.
- Garman, M. B., & Klass, M. J. (1980). "On the Estimation of Security Price Volatilities from Historical Data." *Journal of Business*, 53(1), 67-78.
- Rogers, L. C. G., & Satchell, S. E. (1991). "Estimating Variance from High, Low and Closing Prices." *Annals of Applied Probability*, 1(4), 504-512.
- Alizadeh, S., Brandt, M. W., & Diebold, F. X. (2002). "Range-Based Estimation of Stochastic Volatility Models." *Journal of Finance*, 57(3), 1047-1091.
- Alizadeh, S., Brandt, M. W., & Diebold, F. X. (2002). "Range-Based Estimation of Stochastic Volatility Models." *Journal of Finance*, 57(3), 1047-1091.
+18 -1
View File
@@ -1,5 +1,22 @@
# HV: Historical Volatility (Close-to-Close)
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` (default 20), `annualize` (default true), `annualPeriods` (default 252) |
| **Outputs** | Single series (Hv) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period + 1` bars |
### TL;DR
- Historical Volatility (HV), also known as close-to-close volatility or realized volatility, is the classical measure of price volatility using the ...
- Parameterized by `period` (default 20), `annualize` (default true), `annualperiods` (default 252).
- Output range: $\geq 0$.
- Requires `period + 1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The foundation of all volatility measures—simple, intuitive, and yet surprisingly informative when you understand what it's actually measuring."
Historical Volatility (HV), also known as close-to-close volatility or realized volatility, is the classical measure of price volatility using the standard deviation of logarithmic returns. First formalized in the early 20th century and central to the Black-Scholes option pricing model, HV remains the benchmark against which all other volatility estimators are compared. This implementation uses population standard deviation with a rolling window and optional annualization.
@@ -290,4 +307,4 @@ HV is the standard for regulatory risk calculations (VaR, ES) because:
- Black, F., & Scholes, M. (1973). "The Pricing of Options and Corporate Liabilities." *Journal of Political Economy*, 81(3), 637-654.
- Parkinson, M. (1980). "The Extreme Value Method for Estimating the Variance of the Rate of Return." *Journal of Business*, 53(1), 61-65.
- Garman, M. B., & Klass, M. J. (1980). "On the Estimation of Security Price Volatilities from Historical Data." *Journal of Business*, 53(1), 67-78.
- Merton, R. C. (1980). "On Estimating the Expected Return on the Market: An Exploratory Investigation." *Journal of Financial Economics*, 8(4), 323-361.
- Merton, R. C. (1980). "On Estimating the Expected Return on the Market: An Exploratory Investigation." *Journal of Financial Economics*, 8(4), 323-361.
+18 -1
View File
@@ -1,5 +1,22 @@
# JVOLTY: Jurik Volatility
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | Source (close) |
| **Parameters** | `period` |
| **Outputs** | Single series (Jvolty) |
| **Output range** | $\geq 0$ |
| **Warmup** | 1 bar |
### TL;DR
- Jurik Volatility (JVOLTY) is the adaptive volatility component extracted from Mark Jurik's JMA algorithm.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The volatility measure that ignores the noise—because sometimes, the best signal comes from knowing what to throw away."
Jurik Volatility (JVOLTY) is the adaptive volatility component extracted from Mark Jurik's JMA algorithm. Unlike traditional volatility measures that treat all price movements equally, JVOLTY uses a 128-bar trimmed mean distribution to compute a robust volatility reference that rejects outliers by design. The result: a volatility measure that remains stable during flash crashes, earnings surprises, and 5-sigma events while still tracking genuine regime changes.
@@ -239,4 +256,4 @@ JVOLTY is proprietary. No open-source library implements it. Validation is perfo
- Jurik Research. (1998-2005). "JMA White Papers." *jurikres.com* (archived).
- Kositsin, Nikolay. (2007). "Digital Indicators for MetaTrader 4." *Alpari Forum Archives*.
- Wilcox, R. R. (2012). "Introduction to Robust Estimation and Hypothesis Testing." *Academic Press*. (Trimmed mean statistics)
- Wilcox, R. R. (2012). "Introduction to Robust Estimation and Hypothesis Testing." *Academic Press*. (Trimmed mean statistics)
+18 -1
View File
@@ -1,5 +1,22 @@
# JVOLTYN: Normalized Jurik Volatility
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | Source (close) |
| **Parameters** | `period` |
| **Outputs** | Single series (Jvoltyn) |
| **Output range** | $\geq 0$ |
| **Warmup** | 1 bar |
### TL;DR
- Normalized Jurik Volatility (JVOLTYN) maps the raw JVOLTY dynamic exponent to a 0-100 scale.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "When you need to compare apples to apples, normalize your volatility—0 is calm, 100 is chaos."
Normalized Jurik Volatility (JVOLTYN) maps the raw JVOLTY dynamic exponent to a 0-100 scale. While JVOLTY outputs values in the range [1, logParam] (where logParam is period-dependent), JVOLTYN transforms this to a universal scale where 0 represents minimum volatility and 100 represents maximum volatility. This normalization enables direct comparison across different periods and instruments.
@@ -212,4 +229,4 @@ public Jvoltyn(int period = 14)
## References
- Jurik Research. (1998-2005). "JMA White Papers." *jurikres.com* (archived).
- QuanTAlib. "JVOLTY: Jurik Volatility." [Documentation](../jvolty/Jvolty.md).
- QuanTAlib. "JVOLTY: Jurik Volatility." [Documentation](../jvolty/Jvolty.md).
+18 -1
View File
@@ -1,5 +1,22 @@
# MASSI: Mass Index
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `emaLength` (default 9), `sumLength` (default 25) |
| **Outputs** | Single series (Massi) |
| **Output range** | $\geq 0$ |
| **Warmup** | 1 bar |
### TL;DR
- The Mass Index, developed by Donald Dorsey and introduced in the June 1992 issue of *Technical Analysis of Stocks & Commodities*, identifies potent...
- Parameterized by `emalength` (default 9), `sumlength` (default 25).
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The Mass Index doesn't predict direction—it predicts the moment of maximum uncertainty before clarity emerges."
The Mass Index, developed by Donald Dorsey and introduced in the June 1992 issue of *Technical Analysis of Stocks & Commodities*, identifies potential trend reversals by measuring the narrowing and widening of the range between high and low prices. Unlike directional indicators, MASSI focuses on the *pattern* of range expansion and contraction, particularly the characteristic "reversal bulge" that often precedes significant market turns.
@@ -205,4 +222,4 @@ Massi.Calculate(ranges, output, emaLength: 9, sumLength: 25);
- Dorsey, Donald. (1992). "The Mass Index." *Technical Analysis of Stocks & Commodities*, June 1992.
- Achelis, Steven B. (2000). *Technical Analysis from A to Z*. McGraw-Hill.
- Pring, Martin J. (2002). *Technical Analysis Explained*. McGraw-Hill.
- Pring, Martin J. (2002). *Technical Analysis Explained*. McGraw-Hill.
+18 -1
View File
@@ -1,5 +1,22 @@
# NATR: Normalized Average True Range
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` (default 14) |
| **Outputs** | Single series (Natr) |
| **Output range** | $\geq 0$ |
| **Warmup** | 1 bar |
### TL;DR
- NATR normalizes the Average True Range (ATR) as a percentage of the closing price.
- Parameterized by `period` (default 14).
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The same volatility reads different on different price scales. NATR speaks the universal language of percentages."
NATR normalizes the Average True Range (ATR) as a percentage of the closing price. This is mathematically identical to ATRP (Average True Range Percent)—both compute `(ATR / Close) × 100`. The difference is purely nomenclature: NATR is the term used in TA-Lib and many charting platforms.
@@ -194,4 +211,4 @@ Ensures equal percentage risk per position regardless of asset price.
- Wilder, J.W. (1978). *New Concepts in Technical Trading Systems*. Trend Research.
- TA-Lib documentation: NATR function specification
- TradingView PineScript: `ta.natr()` implementation
- TradingView PineScript: `ta.natr()` implementation
+18 -1
View File
@@ -1,5 +1,22 @@
# RSV: Rogers-Satchell Volatility
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` (default 20), `annualize` (default true), `annualPeriods` (default 252) |
| **Outputs** | Single series (Rsv) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period` bars |
### TL;DR
- Rogers-Satchell Volatility (RSV) is a drift-adjusted OHLC-based volatility estimator that uses all four price points (Open, High, Low, Close) to pr...
- Parameterized by `period` (default 20), `annualize` (default true), `annualperiods` (default 252).
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The best estimator is one that extracts maximum information from all available data while remaining robust to the noise of market microstructure."
Rogers-Satchell Volatility (RSV) is a drift-adjusted OHLC-based volatility estimator that uses all four price points (Open, High, Low, Close) to provide more accurate volatility estimates than simpler range-based methods. Developed by L.C.G. Rogers and S.E. Satchell in 1991, this estimator is unique in its ability to account for price drift, making it particularly suitable for trending markets. The implementation uses SMA smoothing and optional annualization.
@@ -336,4 +353,4 @@ rsVariance = Math.FusedMultiplyAdd(lnHO, lnHC, lnLO * lnLC);
- Parkinson, M. (1980). "The Extreme Value Method for Estimating the Variance of the Rate of Return." *Journal of Business*, 53(1), 61-65.
- Garman, M. B., & Klass, M. J. (1980). "On the Estimation of Security Price Volatilities from Historical Data." *Journal of Business*, 53(1), 67-78.
- Yang, D., & Zhang, Q. (2000). "Drift-Independent Volatility Estimation Based on High, Low, Open, and Close Prices." *Journal of Business*, 73(3), 477-492.
- Alizadeh, S., Brandt, M. W., & Diebold, F. X. (2002). "Range-Based Estimation of Stochastic Volatility Models." *Journal of Finance*, 57(3), 1047-1091.
- Alizadeh, S., Brandt, M. W., & Diebold, F. X. (2002). "Range-Based Estimation of Stochastic Volatility Models." *Journal of Finance*, 57(3), 1047-1091.
+18 -1
View File
@@ -1,5 +1,22 @@
# RV: Realized Volatility
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` (default 5), `smoothingPeriod` (default 20), `annualize` (default true), `annualPeriods` (default 252) |
| **Outputs** | Single series (Rv) |
| **Output range** | $\geq 0$ |
| **Warmup** | 1 bar |
### TL;DR
- Realized Volatility (RV) measures price volatility using the sum of squared logarithmic returns over a rolling window, then applying SMA smoothing ...
- Parameterized by `period` (default 5), `smoothingperiod` (default 20), `annualize` (default true), `annualperiods` (default 252).
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The sum of squared returns—a direct measure of how much the market actually moved, free from the assumptions embedded in standard deviation."
Realized Volatility (RV) measures price volatility using the sum of squared logarithmic returns over a rolling window, then applying SMA smoothing for stability. Unlike traditional Historical Volatility (HV) which calculates standard deviation of returns, RV directly accumulates squared returns—the raw building blocks of variance—providing a more direct measure of realized price variation.
@@ -260,4 +277,4 @@ Diverging (short < long): Volatility compression
- Andersen, T. G., Bollerslev, T., Diebold, F. X., & Labys, P. (2001). "The Distribution of Realized Exchange Rate Volatility." *Journal of the American Statistical Association*, 96(453), 42-55.
- Andersen, T. G., Bollerslev, T., Diebold, F. X., & Ebens, H. (2001). "The Distribution of Realized Stock Return Volatility." *Journal of Financial Economics*, 61(1), 43-76.
- Barndorff-Nielsen, O. E., & Shephard, N. (2002). "Econometric Analysis of Realized Volatility and Its Use in Estimating Stochastic Volatility Models." *Journal of the Royal Statistical Society: Series B*, 64(2), 253-280.
- McAleer, M., & Medeiros, M. C. (2008). "Realized Volatility: A Review." *Econometric Reviews*, 27(1-3), 10-45.
- McAleer, M., & Medeiros, M. C. (2008). "Realized Volatility: A Review." *Econometric Reviews*, 27(1-3), 10-45.
+18 -1
View File
@@ -1,5 +1,22 @@
# RVI: Relative Volatility Index
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `stdevLength` (default 10), `rmaLength` (default 14) |
| **Outputs** | Single series (Rvi) |
| **Output range** | $0$ to $100$ |
| **Warmup** | 1 bar |
### TL;DR
- The Relative Volatility Index (RVI) is a directional volatility oscillator that distinguishes between upward and downward price volatility.
- Parameterized by `stdevlength` (default 10), `rmalength` (default 14).
- Output range: $0$ to $100$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Not all volatility is created equal—upward volatility feels like profit, downward volatility feels like loss. RVI separates these psychological experiences into a quantifiable measure."
The Relative Volatility Index (RVI) is a directional volatility oscillator that distinguishes between upward and downward price volatility. Originally developed by Donald Dorsey in 1993, RVI measures the standard deviation of closing prices and categorizes this volatility based on whether prices are rising or falling. The result is an oscillator bounded between 0 and 100, where values above 50 indicate upward volatility dominance and values below 50 indicate downward volatility dominance.
@@ -244,4 +261,4 @@ Price making lower lows + RVI making higher lows: Bullish divergence
- Dorsey, D. (1993). "The Relative Volatility Index." *Technical Analysis of Stocks & Commodities*, 11(6), 253-256.
- Dorsey, D. (1995). "Refining the Relative Volatility Index." *Technical Analysis of Stocks & Commodities*, 13(9).
- TradingView. (2024). "PineScript Reference Implementation." rvi.pine source file.
- TradingView. (2024). "PineScript Reference Implementation." rvi.pine source file.
+18 -1
View File
@@ -1,5 +1,22 @@
# TR: True Range
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | None |
| **Outputs** | Single series (TR) |
| **Output range** | $\geq 0$ |
| **Warmup** | `1` bars |
### TL;DR
- True Range (TR) is a volatility measure that captures the maximum price movement for each bar, including any gap from the previous close.
- No configurable parameters; computation is stateless per bar.
- Output range: $\geq 0$.
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The true measure of volatility isn't just where price traveled within the bar, but whether it leaped from where it was."
True Range (TR) is a volatility measure that captures the maximum price movement for each bar, including any gap from the previous close. Developed by J. Welles Wilder Jr. in 1978, TR forms the foundation for Average True Range (ATR) and numerous other volatility-based indicators. Unlike simple High-Low range, TR accounts for overnight gaps and opening jumps, providing a complete picture of price movement.
@@ -273,4 +290,4 @@ If gap contribution > 50% of TR: Significant gap move
- Wilder, J. W. (1978). *New Concepts in Technical Trading Systems*. Trend Research.
- Kaufman, P. J. (2013). *Trading Systems and Methods* (5th ed.). Wiley.
- Murphy, J. J. (1999). *Technical Analysis of the Financial Markets*. New York Institute of Finance.
- Murphy, J. J. (1999). *Technical Analysis of the Financial Markets*. New York Institute of Finance.
+18 -1
View File
@@ -1,5 +1,22 @@
# UI: Ulcer Index
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` (default 14) |
| **Outputs** | Single series (Ui) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period` bars |
### TL;DR
- Ulcer Index (UI) is a downside volatility measure that quantifies the depth and duration of drawdowns from recent highs.
- Parameterized by `period` (default 14).
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The ulcer-inducing anxiety of watching your portfolio decline—now quantified."
Ulcer Index (UI) is a downside volatility measure that quantifies the depth and duration of drawdowns from recent highs. Developed by Peter G. Martin in 1987, UI captures what most volatility measures miss: the pain of being underwater. Unlike standard deviation or ATR that treat upside and downside moves equally, UI measures only the decline from peaks—the psychological stress that keeps investors awake at night.
@@ -247,4 +264,4 @@ Strategy B is better risk-adjusted despite lower returns
- Martin, P. G., & McCann, B. B. (1989). *The Investor's Guide to Fidelity Funds*. John Wiley & Sons.
- Martin, P. G. (1987). "Ulcer Index, An Alternative Approach to the Measurement of Investment Risk & Risk-Adjusted Performance."
- Kaufman, P. J. (2013). *Trading Systems and Methods* (5th ed.). Wiley.
- Kaufman, P. J. (2013). *Trading Systems and Methods* (5th ed.). Wiley.
+18 -1
View File
@@ -1,5 +1,22 @@
# VOV: Volatility of Volatility
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `volatilityPeriod` (default 20), `vovPeriod` (default 10) |
| **Outputs** | Single series (Vov) |
| **Output range** | $\geq 0$ |
| **Warmup** | `volatilityPeriod + vovPeriod - 1` bars |
### TL;DR
- Volatility of Volatility (VOV) measures the standard deviation of volatility itself, quantifying how much volatility fluctuates over time.
- Parameterized by `volatilityperiod` (default 20), `vovperiod` (default 10).
- Output range: $\geq 0$.
- Requires `volatilityPeriod + vovPeriod - 1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "When markets become uncertain about their own uncertainty, that's when things get interesting."
Volatility of Volatility (VOV) measures the standard deviation of volatility itself, quantifying how much volatility fluctuates over time. While standard volatility tells you how much prices move, VOV tells you how stable or unstable that movement pattern is. High VOV indicates volatility is erratic and unpredictable; low VOV suggests volatility is relatively stable and consistent.
@@ -254,4 +271,4 @@ The formula $\sqrt{E[X^2] - E[X]^2}$ can produce small negative values due to fl
- Heston, S. L. (1993). "A Closed-Form Solution for Options with Stochastic Volatility with Applications to Bond and Currency Options." *Review of Financial Studies*, 6(2), 327-343.
- Gatheral, J. (2006). *The Volatility Surface: A Practitioner's Guide*. Wiley Finance.
- CBOE. "VVIX Index." Chicago Board Options Exchange white paper on volatility-of-volatility indices.
- CBOE. "VVIX Index." Chicago Board Options Exchange white paper on volatility-of-volatility indices.
+18 -1
View File
@@ -1,5 +1,22 @@
# VR: Volatility Ratio
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` (default 14) |
| **Outputs** | Single series (Vr) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period` bars |
### TL;DR
- Volatility Ratio (VR) measures the current bar's True Range relative to its Average True Range (ATR), providing a normalized indicator of short-ter...
- Parameterized by `period` (default 14).
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "When today's range dwarfs the average, pay attention—the market is telling you something unusual is happening."
Volatility Ratio (VR) measures the current bar's True Range relative to its Average True Range (ATR), providing a normalized indicator of short-term volatility expansion or contraction. Values above 1.0 indicate above-average volatility (potential breakouts), while values below 1.0 suggest below-average volatility (consolidation). This simple yet powerful ratio helps traders identify when markets are moving unusually, often preceding significant price moves.
@@ -269,4 +286,4 @@ The implementation uses:
- Wilder, J. W. (1978). *New Concepts in Technical Trading Systems*. Trend Research.
- Kaufman, P. J. (2013). *Trading Systems and Methods* (5th ed.). John Wiley & Sons.
- Kirkpatrick, C. D., & Dahlquist, J. R. (2010). *Technical Analysis: The Complete Resource for Financial Market Technicians* (2nd ed.). FT Press.
- Kirkpatrick, C. D., & Dahlquist, J. R. (2010). *Technical Analysis: The Complete Resource for Financial Market Technicians* (2nd ed.). FT Press.
+18 -1
View File
@@ -1,5 +1,22 @@
# YZV: Yang-Zhang Volatility
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Volatility |
| **Inputs** | OHLCV bar (TBar) |
| **Parameters** | `period` (default 20) |
| **Outputs** | Single series (Yzv) |
| **Output range** | $\geq 0$ |
| **Warmup** | `period` bars |
### TL;DR
- Yang-Zhang Volatility is a sophisticated volatility estimator that combines overnight (close-to-open) returns with Rogers-Satchell intraday volatil...
- Parameterized by `period` (default 20).
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The best volatility estimator uses all the information the market gives you—overnight gaps, intraday swings, and everything in between."
Yang-Zhang Volatility is a sophisticated volatility estimator that combines overnight (close-to-open) returns with Rogers-Satchell intraday volatility to capture the full spectrum of price dynamics. Unlike simple close-to-close volatility that misses overnight gaps, or purely intraday measures that ignore opening moves, Yang-Zhang provides a theoretically unbiased estimate that remains consistent whether markets gap or drift.
@@ -298,4 +315,4 @@ The implementation uses:
- Yang, D., & Zhang, Q. (2000). "Drift-Independent Volatility Estimation Based on High, Low, Open, and Close Prices." *Journal of Business*, 73(3), 477-491.
- Rogers, L. C. G., & Satchell, S. E. (1991). "Estimating Variance from High, Low and Closing Prices." *Annals of Applied Probability*, 1(4), 504-512.
- Parkinson, M. (1980). "The Extreme Value Method for Estimating the Variance of the Rate of Return." *Journal of Business*, 53(1), 61-65.
- Garman, M. B., & Klass, M. J. (1980). "On the Estimation of Security Price Volatilities from Historical Data." *Journal of Business*, 53(1), 67-78.
- Garman, M. B., & Klass, M. J. (1980). "On the Estimation of Security Price Volatilities from Historical Data." *Journal of Business*, 53(1), 67-78.