Crate black_scholes

Crate black_scholes 

Source
Expand description

§black_scholes

A Black Scholes option pricing library.

This library provides implementations of the Black-Scholes option pricing model along with the Black 76 model for options on futures and the Black-Scholes-Merton model for options on dividend-paying stocks.

§Features

  • European call and put option pricing
  • Full set of Greeks (Delta, Gamma, Theta, Vega, Rho, Vanna, Vomma, Charm)
  • Implied volatility calculation
  • Support for multiple option models
  • High-performance calculations with caching

Structs§

PricesAndGreeks
Container for option prices and Greeks.

Functions§

black76
Returns call and put prices and Greeks using the Black 76 model for options on futures.
bsm_compute_all
Returns call and put prices and Greeks using Black-Scholes-Merton formula.
call
Returns standard BS call option formula.
call_charm
Returns charm of a BS call option
call_delta
Returns delta of a BS call option
call_discount
Returns BS call option formula with discount and volatility already computed.
call_gamma
Returns gamma of a BS call option
call_iv
Returns implied volatility from a call option
call_iv_guess
Returns implied volatility from a call option with initial guess
call_rho
Returns rho of a BS call option
call_theta
Returns theta of a BS call option
call_vanna
Returns vanna of a BS call option
call_vega
Returns vega of a BS call option
call_vomma
Returns vomma of a BS call option
compute_all
Returns call and put prices and Greeks. Due to caching the complex computations (such as N(d1)), this implementation is faster if you need to obtain all the information for a given stock price and strike price.
put
Returns BS put option formula.
put_charm
Returns charm of a BS put option
put_delta
Returns delta of a BS put option
put_discount
Returns BS put option formula with discount and volatility already computed.
put_gamma
Returns gamma of a BS put option
put_iv
Returns implied volatility from a put option
put_iv_guess
Returns implied volatility from a put option with initial guess
put_rho
Returns rho of a BS put option
put_theta
Returns theta of a BS put option
put_vanna
Returns vanna of a BS put option
put_vega
Returns vega of a BS put option
put_vomma
Returns vomma of a BS put option
validate_params
Validates that the input parameters for option pricing are within reasonable bounds.