Options - vertical spreads (pynance.opt.spread.vert)

class pynance.opt.spread.vert.Vert(df)[source]

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

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

New in version 0.3.0.

Parameters:

df : pandas.DataFrame

Options data.

Attributes

data (pandas.DataFrame)

Methods

call(lowstrike, highstrike, expiry)[source]

Metrics for evaluating a bull call spread.

The metrics returned can easily be translated into bear spread metrics. The difference is only whether one buys the call at the lower strike and sells at the higher (bull call spread) or sells at the lower while buying at the higher (bear call spread). The metrics dataframe shows values for a bull call spread, where the transaction is a debit. A bear call spread is created by selling a bull call spread, so the transaction amount is the same, but it is a credit rather than a debit.

Parameters:

lowstrike : numeric

Lower strike price.

highstrike : numeric

Higher strike sprice.

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

Expiration date.

Returns:

metrics : DataFrame

See also

put()

Notes

Cf. Lawrence McMillan, Options as a Strategic Investment, 5th ed., pp. 157ff.

 
put(lowstrike, highstrike, expiry)[source]

Metrics for evaluating a bear put spread.

The metrics returned can easily be translated into bull spread metrics. The difference is only whether one buys the put at the lower strike and sells at the higher (bear put spread) or sells at the lower while buying at the higher (bull put spread). The metrics dataframe shows values for a bear put spread, where the transaction is a debit. A bull put spread is created by selling a bear put spread, so the transaction amount is the same, but it is a credit rather than a debit.

Parameters:

lowstrike : numeric

Lower strike price.

highstrike : numeric

Higher strike sprice.

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

Expiration date.

Returns:

metrics : DataFrame

See also

call()

Notes

Cf. Lawrence McMillan, Options as a Strategic Investment, 5th ed., pp. 316ff.

 
straddle(strike, expiry)[source]

Metrics for evaluating a straddle.

Parameters:

strike : numeric

Strike price.

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

Expiration date.

Returns:

metrics : DataFrame

Metrics for evaluating straddle.