get_option_chain

Returns the option chain for the specified symbol and expiration date.

This function is often used in conjunction with the get_option_chain_info function in order to retrieve the available expiration dates.

Syntax

Fields

Description

symbol(str)

Symbol of stock

date(str | datetime.datetime)

Expiration date of the option

def get_option_chain(self, symbol: str, date):

The date parameter can either be a string in the format “YYYY-MM-DD” or a datetime object. If using a datetime object, it should be timezone-aware. If a timezone-naive object is passed, it would assume to be in the timezone of the computer running the algorithm, and convert it to UTC timezone.

Returns

Returns a DataFrame in the following format:

exp_date

strike

type

str

str

str

float

The index is a string representing the option symbol, and the columns are as follows:

Raises