Skip to content

Option Chain

dhanhq._option_chain

Classes

OptionChain

OptionChain(dhan_context)
Functions
expiry_list
expiry_list(under_security_id, under_exchange_segment)

Retrieve the dates of all expiries for a specified underlying instrument.

Parameters:

Name Type Description Default
under_security_id int

The security ID of the underlying instrument.

required
under_exchange_segment str

The exchange segment of the underlying instrument (e.g., NSE, BSE).

required

Returns:

Name Type Description
dict

The response containing list of dates for which option expiries are present for the specified underlying instrument.

option_chain
option_chain(under_security_id, under_exchange_segment, expiry)

Retrieve the real-time Option Chain for a specified underlying instrument.

Parameters:

Name Type Description Default
under_security_id int

The security ID of the underlying instrument.

required
under_exchange_segment str

The exchange segment of the underlying instrument (e.g., NSE, BSE).

required
expiry str

The expiry date of the options.

required

Returns:

Name Type Description
dict

The response containing Open Interest (OI), Greeks, Volume, Last Traded Price, Best Bid/Ask, and Implied Volatility (IV) across all strikes for the specified underlying.