Module analytic
Expand description
Closed-form option formulas.
Structs§
- American
OnFuture 🔒 - An American option on a future priced by Barone-Adesi–Whaley, in parts.
Enums§
- Barrier
Kind - Which side a single barrier sits on and whether touching it brings the option in or knocks it out.
- Model
Error - A model that cannot price the inputs it was given.
- Option
Kind - Which side of an option is held.
Functions§
- bachelier
- The Bachelier (normal) forward price, undiscounted.
- barone_
adesi_ 🔒whaley_ on_ future - The Barone-Adesi–Whaley quadratic approximation to an American
option on a future: zero cost of carry, the premium paid up front and
discounted by
discount(the discount factor to expiry,e^{−rT}). - barrier_
option - A continuously monitored single-barrier European on a zero-dividend
lognormal spot: the Reiner-Rubinstein closed form, as Haug states it,
term for term.
discountis the risk-free discount factor to expiry andexpirythe vol’s year fraction to it; the rate is the one that makes the two agree,r = −ln P / τ. A knock-in’srebateis paid at expiry if it never knocks in, a knock-out’s when it is hit. The spot is assumed on the live side of the barrier and the variance positive. - black76
- The Black-76 forward-lognormal price, undiscounted.
- black76_
implied_ vol - The Black-76 volatility implying
price, by bisection. - critical_
on_ 🔒future - The Barone-Adesi–Whaley critical futures price, on passive values:
value matching solved by Newton safeguarded by a bracket —
(K, ∞)for a call,(0, K)for a put — widened until it brackets. - value_
matching 🔒 - Value matching
g(S) = ω(S − K) − v(S) − ω(1 − discount·N(ω·d₁(S)))·S/qat the futures prices— zero at the critical price — and its slope ins, in the mode the vol, the discount and the exponent carry.