OPEN-SOURCE SCRIPT
VRP IV vs Realised Vol

**Indicator name:** VRP — IV vs Realised Vol
---
**What it calculates:**
**Line 1 — India VIX (IV)**
It pulls the daily closing value of India VIX directly from TradingView using `request.security("INDIAVIX", "D", close)`. This is your implied volatility — what the market expects NIFTY to move annually.
**Line 2 — 20-day Realised Volatility (RV)**
It calculates the actual movement of NIFTY over the past 20 trading days using log returns. The formula is: standard deviation of daily log returns × √252 × 100. This converts daily movement into an annualised percentage — same unit as VIX so you can compare them directly.
**Line 3 — VRP**
It subtracts RV from IV. The result is plotted as a histogram.
---
**What you see on screen:**
- **Green bar** — VIX is above 20-day RV. IV is overpricing actual movement. Selling has structural edge. Enter trades.
- **Red bar** — VIX is below 20-day RV. IV is underpricing actual movement. No edge. Skip the week.
- **Zero line** — the crossover point. Green above, red below.
---
**How to read it practically:**
| Bar colour | What it means | Action |
|---|---|---|
| Green and tall | High VRP — IV significantly above RV | Strong edge — full size |
| Green and small | Low positive VRP — IV slightly above RV | Weak edge — half size |
| Red | Negative VRP — IV below RV | No edge — sit out |
---
**One important limitation:**
VIX is a 30-day forward looking measure. RV is a 20-day backward looking measure. They are not perfectly matched in time horizon — but this is the most practical comparison available on TradingView without complex calculations. The signal is directionally correct even if not perfectly precise.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。