Options - spreads (pynance.opt.spread.core)

class pynance.opt.spread.core.Spread(df)[source]

Wrapper class for pandas.DataFrame for retrieving metrics on options spreads.

Objects of this class are not intended for direct instantiation but are created as attributes of objects of type Options.

New in version 0.3.0.

Parameters:

df : pandas.DataFrame

Options data.

Attributes

data (pandas.DataFrame)
diag (Diag) Wrapper for retrieving metrics on diagonal spreads.
vert (Vertical) Wrapper for retrieving metrics on vertical spreads.

Methods

cal(opttype, strike, exp1, exp2)[source]

Metrics for evaluating a calendar spread.

Parameters:

opttype : str (‘call’ or ‘put’)

Type of option on which to collect data.

strike : numeric

Strike price.

exp1 : date or date str (e.g. ‘2015-01-01’)

Earlier expiration date.

exp2 : date or date str (e.g. ‘2015-01-01’)

Later expiration date.

Returns:

metrics : DataFrame

Metrics for evaluating spread.