PROTECTED SOURCE SCRIPT

Option Value/Time Value Difference

144
This indicator calculates and visualizes the difference between two option contracts (either their time value or option value) based on a user-selected underlying instrument (e.g., NIFTY 50). It fetches real-time data for the underlying and the two specified options, computes their intrinsic and time values, and plots either the time value or option value (ask price) along with their difference. A customizable table displays key details, including strike prices, option types (Call/Put), and the selected values, with a dark mode option for better visibility.
Key Features:
Flexible Plotting: Choose to plot and display either the Time Value (option price minus intrinsic value) or the Option Value (ask price) for two option strikes.

Difference Calculation: Plots the difference between the two options’ selected values (time value or option value) as a distinct line.

Dynamic Table: Shows strike prices, option types (CE/PE), and the selected values (time value or option value) for both options, plus their difference.

Dark Mode Support: Toggle between light and dark themes for the table display.

Real-Time Data: Uses TradingView’s request.security to fetch live prices for the underlying and options.

Use Case:
This script is ideal for options traders who want to compare two strikes (e.g., a Call and a Put, or two Calls/Puts at different strikes) and analyze their time value or option value differences in real-time. It’s particularly useful for strategies like spreads, straddles, or strangles.
How to Use
Add to Chart:
Open TradingView, go to the Pine Editor, paste this script, and click “Add to Chart.”

Configure Inputs:
Underlying Instrument: Enter the symbol of the underlying asset (e.g., NSE:NIFTY for NIFTY 50).

Option Instrument 1: Enter the symbol of the first option (e.g., NSE:NIFTY250327C24000 for a Call expiring March 27, 2025, at strike 24000).

Option Instrument 2: Enter the symbol of the second option (e.g., NSE:NIFTY250327C24500 for a Call at strike 24500).

Plot Type: Select either Time Value (default) or Option Value to determine what is plotted and displayed.

Dark Mode: Check this box to switch the table to a dark theme (default is light).

Interpret Outputs:
Chart Lines:
Blue Line: Value of the first option (time value or option value, based on selection).

Red Line: Value of the second option.

Purple Line: Difference between the two options’ values.

Table (Middle-Left Position):
Row 1: Strike price and type (CE/PE) of the first option.

Row 2: Strike price and type of the second option.

Row 3: Selected value (time value or option value) of the first option.

Row 4: Selected value of the second option.

Row 5: Difference between the two options’ values.

Adjust Settings:
Modify the input symbols or plot type via the indicator’s settings to suit your analysis needs.

Inputs
Underlying Instrument (Symbol, Default: NSE:NIFTY):
The ticker symbol of the underlying asset (e.g., NIFTY 50 index).

Option Instrument 1 (Symbol, Default: NSE:NIFTY250327C24000):
The ticker symbol of the first option contract. Must follow a format like NSE:NIFTY<expiry>[C/P]<strike> (e.g., Call at 24000).

Option Instrument 2 (Symbol, Default: NSE:NIFTY250327C24500):
The ticker symbol of the second option contract (e.g., Call at 24500).

Plot Type (String, Options: Time Value, Option Value, Default: Time Value):
Choose whether to plot and display the Time Value (option price minus intrinsic value) or the Option Value (ask price).

Dark Mode (Boolean, Default: false):
Enable for a dark-themed table; disable for a light theme.

Outputs
Plotted Lines:
Value 1 (Blue): Time value or option value of the first option, depending on the Plot Type.

Value 2 (Red): Time value or option value of the second option.

Difference (Purple): The difference between Value 1 and Value 2 (e.g., Time Value 1 - Time Value 2).

Table Display:
Strike prices and option types (Call/Put) for both options.

Selected values (time value or option value) for each option.

The difference between the two options’ selected values.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.