OPEN-SOURCE SCRIPT

Realized Volatility Comparator [AlgoTraderPro]

237
What it does
Plots the annualized realized volatility of the chart's symbol and of a second symbol of your choice in the same pane, so you can compare how "nervous" two assets actually are — and how that changes across years. The default comparison is gold, which makes it useful for one specific long-term study: watching Bitcoin's volatility mature toward that of older stores of value.

How it works
For each symbol the script computes the standard deviation of logarithmic returns over a configurable window, then annualizes it:

realized vol = stdev( ln(close / close[1]), window ) × √(periods per year) × 100

The annualization factor is derived from the chart timeframe automatically (a 365-day year), so the reading is comparable across daily and weekly charts. The comparison symbol's volatility is computed in its own symbol context via request.security, using its own bar series. An optional simple moving average smooths both lines, and a readout table shows the current value for each symbol plus the ratio between them.

Inputs
  • Realized volatility window — bars in the standard deviation (default 26; suggested 26 on weekly ≈ six months, 90 on daily ≈ one quarter). Shorter = more reactive, longer = smoother regime view.
  • Smoothing — SMA applied to both lines; 1 = off.
  • Comparison symbol — any symbol (default OANDA:XAUUSD). Indices, FX, equities all work.
  • Show readout table — toggles the current-values table.
  • Colors — line colors for each series.


How to read it
The absolute level tells you the market's current disagreement about the asset's value: a young or contested asset prints high realized volatility; a settled one prints low. The slope across years tells you whether that disagreement is widening or narrowing. The ratio in the table condenses the comparison into one number — how many times more volatile the chart symbol is than the reference.

Suggested study
Load on BNC:BLX (Bitcoin Liquid Index, history back to 2010) on a weekly chart with the default gold comparison. The full history shows Bitcoin's realized volatility declining cycle after cycle while gold's stays in a low band — a maturation pattern gold itself went through after 1971.

Other uses
Position sizing context (size inversely to the regime), comparing any two assets' risk regimes before pairing them in a portfolio, or checking whether a "quiet" market is genuinely quiet by historical standards.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.