PROTECTED SOURCE SCRIPT
Implied Volatility based on Option Prices

Implied Volatility Calculator for All Indices and F&O Symbols based on Option Prices
This Pine Script indicator calculates the Implied Volatility (IV) for any Futures & Options (F&O) contract traded on the NSE or BSE (only Sensex and Bankex), using the Black-Scholes model. It is designed to work directly on option charts by automatically parsing the symbol (e.g., "NIFTY250718C24500") to extract the underlying asset, expiry date, strike price, and option type (Call or Put). No manual input of the symbol is required—simply add the indicator to an option chart, and it will compute the IV based on the current market price of the option.
Key Features:
Automatic Symbol Parsing: Detects the underlying code (e.g., "NIFTY", "BANKNIFTY", or any supported F&O stock/index), expiry in YYMMDD format, Call/Put identifier, and strike price.
Underlying Mapper: Includes a comprehensive coverage of over 200 F&O symbols. This ensures compatibility with indices like NIFTY, BANKNIFTY, SENSEX, and stocks such as RELIANCE, HDFCBANK, TATAMOTORS, etc. If a symbol isn't mapped, it returns NA.
Incase of any missed F&O symbol, please reach out to me or comment below.
Time to Expiry Calculation: Computes days to expiry using the parsed expiry date (assuming 3:30 PM IST expiry) and the current chart time, converting it to years for the Black-Scholes formula.
Inputs:
- Risk Free Rate (%): Default 7.0% (e.g., government bond yield).
- Dividend Yield (%): Default 0.0% (adjust for dividend-paying stocks).
Plots:
- Implied Volatility (%): Main plot in blue, showing IV as a percentage.
Disclaimer:
This indicator is provided for educational and informational purposes only and is not intended as financial advice, investment recommendation, or trading signal. Options trading involves significant risk of loss and is not suitable for all investors. The calculations rely on the Black-Scholes model, which assumes constant volatility, no dividends (unless specified), and other simplifications that may not reflect real market conditions. Always verify data accuracy, consult a financial advisor, and use at your own risk. The author assumes no liability for any losses incurred.
This Pine Script indicator calculates the Implied Volatility (IV) for any Futures & Options (F&O) contract traded on the NSE or BSE (only Sensex and Bankex), using the Black-Scholes model. It is designed to work directly on option charts by automatically parsing the symbol (e.g., "NIFTY250718C24500") to extract the underlying asset, expiry date, strike price, and option type (Call or Put). No manual input of the symbol is required—simply add the indicator to an option chart, and it will compute the IV based on the current market price of the option.
Key Features:
Automatic Symbol Parsing: Detects the underlying code (e.g., "NIFTY", "BANKNIFTY", or any supported F&O stock/index), expiry in YYMMDD format, Call/Put identifier, and strike price.
Underlying Mapper: Includes a comprehensive coverage of over 200 F&O symbols. This ensures compatibility with indices like NIFTY, BANKNIFTY, SENSEX, and stocks such as RELIANCE, HDFCBANK, TATAMOTORS, etc. If a symbol isn't mapped, it returns NA.
Incase of any missed F&O symbol, please reach out to me or comment below.
Time to Expiry Calculation: Computes days to expiry using the parsed expiry date (assuming 3:30 PM IST expiry) and the current chart time, converting it to years for the Black-Scholes formula.
Inputs:
- Risk Free Rate (%): Default 7.0% (e.g., government bond yield).
- Dividend Yield (%): Default 0.0% (adjust for dividend-paying stocks).
Plots:
- Implied Volatility (%): Main plot in blue, showing IV as a percentage.
Disclaimer:
This indicator is provided for educational and informational purposes only and is not intended as financial advice, investment recommendation, or trading signal. Options trading involves significant risk of loss and is not suitable for all investors. The calculations rely on the Black-Scholes model, which assumes constant volatility, no dividends (unless specified), and other simplifications that may not reflect real market conditions. Always verify data accuracy, consult a financial advisor, and use at your own risk. The author assumes no liability for any losses incurred.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.