Skip to content

Derivatives

Classes

OptionData

A class to fetch and analyze option chain data from NSE.

Parameters:

Name Type Description Default
symbol str

Trading symbol of the stock/index (e.g., 'NIFTY', 'RELIANCE')

required
expiry_dt str

Expiry date in format '%d-%b-%Y' (e.g., '27-Mar-2025') Note: Month should be first 3 letters capitalized (Jan, Feb, Mar, etc.)

required

Attributes:

Name Type Description
get_put_call_ratio float

Put-Call ratio based on open interest

get_maximum_pain_strike float

Maximum pain strike price

get_call_option_data DataFrame

Call option chain data

get_put_option_data DataFrame

Put option chain data

Methods:

Name Description
get_option_quote : float

Get option quote for specific strike price, option type and transaction intent

get_synthetic_future_price : float

Calculate synthetic futures price using put-call parity

Functions

get_option_quote
get_option_quote(strikePrice, optionType, intent='')

Get option quote for specific strike price and option type.

Parameters:

Name Type Description Default
strikePrice float

Strike price of the option

required
optionType str

Type of option, either 'CE' (Call) or 'PE' (Put)

required
intent str

Quote type: - '' (default) for last traded price - 'sell' for bid price - 'buy' for ask price

''

Returns:

Type Description
float

Option price based on the specified intent

get_synthetic_future_price
get_synthetic_future_price(strike)

Calculate synthetic futures price using put-call parity.

Parameters:

Name Type Description Default
strike float

Strike price to use for calculation

required

Returns:

Type Description
float

Synthetic futures price