Options API¶
asrquant.derivatives ¶
Closed-form, tree, and Monte Carlo derivative analytics.
OptionPrice
dataclass
¶
Standard option-pricing response.
Source code in src/asrquant/derivatives.py
black_scholes_price ¶
black_scholes_price(spot: float | ndarray, strike: float | ndarray, maturity: float | ndarray, rate: float, volatility: float | ndarray, option: str = 'call', dividend: float = 0.0)
Black-Scholes-Merton European option value.
Source code in src/asrquant/derivatives.py
black_scholes_greeks ¶
black_scholes_greeks(spot: float | ndarray, strike: float | ndarray, maturity: float | ndarray, rate: float, volatility: float | ndarray, option: str = 'call', dividend: float = 0.0) -> dict[str, np.ndarray]
Return analytic delta, gamma, vega, theta, and rho.
Source code in src/asrquant/derivatives.py
bachelier_price ¶
bachelier_price(forward: float | ndarray, strike: float | ndarray, maturity: float | ndarray, normal_volatility: float | ndarray, option: str = 'call', discount: float | ndarray = 1.0)
Bachelier/normal-model European option value.
Source code in src/asrquant/derivatives.py
bachelier_greeks ¶
bachelier_greeks(forward: float | ndarray, strike: float | ndarray, maturity: float | ndarray, normal_volatility: float | ndarray, option: str = 'call', discount: float | ndarray = 1.0) -> dict[str, np.ndarray]
Forward delta, gamma, vega, and theta for the Bachelier model.
Source code in src/asrquant/derivatives.py
black76_price ¶
black76_price(forward: float | ndarray, strike: float | ndarray, maturity: float | ndarray, rate: float, volatility: float | ndarray, option: str = 'call')
Black-76 European option on a forward or futures price.
Source code in src/asrquant/derivatives.py
implied_volatility ¶
implied_volatility(market_price: float, spot: float, strike: float, maturity: float, rate: float, option: str = 'call', dividend: float = 0.0, model: str = 'black_scholes') -> float
Invert Black-Scholes-Merton, Black-76, or Bachelier by bracketing.
Source code in src/asrquant/derivatives.py
option_payoff ¶
option_payoff(terminal_price: ndarray | Series, strike: float, option: str = 'call', premium: float = 0.0, position: float = 1.0) -> np.ndarray
European option payoff net of premium.
Source code in src/asrquant/derivatives.py
put_call_parity_error ¶
put_call_parity_error(call: float, put: float, spot: float, strike: float, maturity: float, rate: float, dividend: float = 0.0) -> float
Return C-P-[S exp(-qT)-K exp(-rT)].
Source code in src/asrquant/derivatives.py
crr_binomial_price ¶
crr_binomial_price(spot: float, strike: float, maturity: float, rate: float, volatility: float, option: str = 'call', steps: int = 500, dividend: float = 0.0, american: bool = False) -> float
Cox-Ross-Rubinstein binomial price for European or American options.
Source code in src/asrquant/derivatives.py
finite_difference_greeks ¶
finite_difference_greeks(pricer: Callable[..., float], *, spot: float, volatility: float, rate: float, spot_step: float | None = None, vol_step: float = 0.0001, rate_step: float = 0.0001, **kwargs) -> dict[str, float]
Generic central finite-difference delta, gamma, vega, and rho.
Source code in src/asrquant/derivatives.py
price_option ¶
Unified option-pricing dispatcher returning a standard result object.