Options - spreads (pynance.opt.spread)

pynance.opt.spread.calendar(optdata, opttype, strike, expiry1, expiry2)[source]

Metrics for evaluating a simple calendar spread.

Parameters:

optdata : DataFrame

Data returned from pynance.opt.retrieve.get()

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

Type of option on which to collect data.

strike : numeric

Strike price.

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

Earlier expiration date.

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

Later expiration date.

Returns:

metrics : DataFrame

Metrics for evaluating spread.

pynance.opt.spread.dblcal(optdata, lowstrike, highstrike, expiry1, expiry2)[source]

Metrics for evaluating a double calendar spread.

Parameters:

optdata : DataFrame

Data returned from pynance.opt.retrieve.get()

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

Type of option on which to collect data.

lowstrike : numeric

Lower strike price. To be used for put spread.

highstrike : numeric

Higher strike price. To be used for call spread.

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

Earlier expiration date.

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

Later expiration date.

Returns:

metrics : DataFrame

Metrics for evaluating spread.

pynance.opt.spread.diagbtrfly(optdata, lowstrike, midstrike, highstrike, expiry1, expiry2)[source]

Metrics for evaluating a diagonal butterfly spread.

Parameters:

optdata : DataFrame

Data returned from pynance.opt.retrieve.get()

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

Type of option on which to collect data.

lowstrike : numeric

Lower strike price. To be used for far put.

midstrike : numeric

Middle strike price. To be used for near straddle. Typically at the money.

highstrike : numeric

Higher strike price. To be used for far call.

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

Earlier expiration date.

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

Later expiration date.

Returns:

metrics : DataFrame

Metrics for evaluating spread.

pynance.opt.spread.straddle(optdata, strike, expiry)[source]

Metrics for evaluating a straddle

Parameters:

optdata : DataFrame

Data returned from pynance.opt.retrieve.get().

strike : numeric

Strike price.

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

Expiration date.

Returns:

metrics : DataFrame

Metrics for evaluating straddle.

Previous topic

Options - remote retrieval (pynance.opt.retrieve)

Next topic

Portfolio optimization (pynance.pf)

This Page