OPEN-SOURCE SCRIPT
更新済 Realized volatility term structure

Volatility has a curve too. See whether the short end is screaming or sleeping.
Description
Measures realized volatility of bar returns over five horizons at once, from short to long, and draws the resulting curve at the right edge of the pane so you can see its shape rather than a single number.
How it calculates
Realized volatility at each horizon is the population standard deviation of log returns over that many bars, scaled by the square root of the number of bars in a year for the current timeframe, shown as a percentage. The plotted history is horizon one divided by horizon five. The curve is drawn as four connected segments through five points placed just past the last bar, each point's height equal to that horizon's volatility divided by the longest horizon's.
How to read it
Above 1.0 the short end is running hotter than the long end, which is what a fresh shock looks like. Below 1.0 the short end is quieter than the long end, which is what compression looks like. The pane shades amber while the short end is elevated. The curve at the right edge is normalized to the longest horizon so its shape is comparable across instruments and timeframes. Each point is labeled with its horizon in bars and its annualized value.
Repainting
Closed bars do not repaint. The live bar updates until it closes. The curve at the right edge is redrawn on the last bar only.
Originality and attribution
Realized volatility over a window is standard. What is original here is presenting it as a term structure: five horizons measured together, the short-to-long ratio tracked through time, and the live curve drawn on the chart as connected points. This is not derived from and does not reuse code from any existing published script.
Honest limitations
Realized volatility is backward looking by construction. The short end reacts within a few bars. The long end takes as many bars as its horizon to fully reflect a change.
Annualization is a display convention. The trading-minutes-per-day and days-per-year inputs only scale the percentages shown.
On timeframes above daily the annualization assumes 52 weekly or 12 monthly bars per year.
The elevated and subdued thresholds are conventions, not calibrations.
Five horizons is a choice. The curve between them is a straight line.
Nothing here is a signal. An elevated short end is not a direction.
Description
Measures realized volatility of bar returns over five horizons at once, from short to long, and draws the resulting curve at the right edge of the pane so you can see its shape rather than a single number.
How it calculates
Realized volatility at each horizon is the population standard deviation of log returns over that many bars, scaled by the square root of the number of bars in a year for the current timeframe, shown as a percentage. The plotted history is horizon one divided by horizon five. The curve is drawn as four connected segments through five points placed just past the last bar, each point's height equal to that horizon's volatility divided by the longest horizon's.
How to read it
Above 1.0 the short end is running hotter than the long end, which is what a fresh shock looks like. Below 1.0 the short end is quieter than the long end, which is what compression looks like. The pane shades amber while the short end is elevated. The curve at the right edge is normalized to the longest horizon so its shape is comparable across instruments and timeframes. Each point is labeled with its horizon in bars and its annualized value.
Repainting
Closed bars do not repaint. The live bar updates until it closes. The curve at the right edge is redrawn on the last bar only.
Originality and attribution
Realized volatility over a window is standard. What is original here is presenting it as a term structure: five horizons measured together, the short-to-long ratio tracked through time, and the live curve drawn on the chart as connected points. This is not derived from and does not reuse code from any existing published script.
Honest limitations
Realized volatility is backward looking by construction. The short end reacts within a few bars. The long end takes as many bars as its horizon to fully reflect a change.
Annualization is a display convention. The trading-minutes-per-day and days-per-year inputs only scale the percentages shown.
On timeframes above daily the annualization assumes 52 weekly or 12 monthly bars per year.
The elevated and subdued thresholds are conventions, not calibrations.
Five horizons is a choice. The curve between them is a straight line.
Nothing here is a signal. An elevated short end is not a direction.
リリースノート
Display only. No change to how anything is calculated.The short-to-long ratio and the annualized percentages now show a leading zero, so a value below one reads as 0.85 rather than .85.
Table text and the labels on the right-edge curve are larger and easier to read at normal chart zoom.
リリースノート
Display only. No change to how anything is calculated.Values show a leading zero, so a reading below one reads as 0.85 rather than .85. This applies to the short-to-long ratio, the annualized percentages, and the labels on the right-edge curve.
Table text and curve labels are larger and easier to read at normal zoom.
Timeframe behaviour is now documented in the source: the script runs on any timeframe, and annualization adapts automatically. Intraday uses the trading-minutes-per-day and days-per-year inputs; daily uses days-per-year; weekly assumes 52 and monthly assumes 12. Those inputs scale the displayed percentages only and do not affect the ratio or the curve shape.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。