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.
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。