european_binomial
module jetblack_options.trees.european_binomial
Summary
Optional valuation with a European binomial implementation.
function jetblack_options.trees.european_binomial.ivol
Summary
Calculate the volatility of an option that is implied by the price.
Parameters
is_call: boolTrue for a call, false for a put.
The current asset price.
The option strike price
The time to expiry of the option in years.
The risk free rate.
The cost of carry of the asset.
The option price.
The number of the steps in the tree.
The maximum number of iterations before a price is returned. Defaults to 20.
The largest acceptable error. Defaults to 1e-8.
Returns
float: The implied volatility.function jetblack_options.trees.european_binomial.make_numeric_greeks
Summary
Make a class to generate greeks numerically using finite difference methods.
Parameters
is_call: boolTrue for a call, false for a put.
The number of the steps in the tree.
Returns
NumericGreeks: A class which can generate Greeks using finite difference methods.function jetblack_options.trees.european_binomial.price
Summary
A European binomial option pricing tree.
Parameters
is_call: boolTrue for a call, false for a put.
The current asset price.
The option strike price
The time to maturity of the option in years.
The risk free rate.
The cost of carry of the asset.
The volatility of the asset.
The number of the steps in the tree.