OPEN-SOURCE SCRIPT
Realized Volatility Comparator [AlgoTraderPro]

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
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.
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.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Code. Structure. Execution. Zones and flows from a live algorithmic trading desk. algotraderpro.io
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Code. Structure. Execution. Zones and flows from a live algorithmic trading desk. algotraderpro.io
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.