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.


df : pandas.DataFrame

Options data.


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


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

Metrics for evaluating a calendar spread.


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.


metrics : DataFrame

Metrics for evaluating spread.