Black Pricing¶
Here we define the log strike k as
where \(K\) is the strike price and \(F\) is the forward price of the underlying asset.
quantflow.options.bs.black_price
¶
Calculate the Black call/put option prices in forward terms from the following params
The results are option prices divided by the forward price also known as option prices in forward terms. These are non-dimensional prices that can be easily converted to actual option prices by multiplying with the forward price of the underlying asset.
| PARAMETER | DESCRIPTION |
|---|---|
k
|
Vector or single value of log-strikes
TYPE:
|
sigma
|
Corresponding vector or single value of implied volatilities (0.2 for 20%)
TYPE:
|
ttm
|
Corresponding vector or single value of Time to Maturity
TYPE:
|
s
|
Corresponding vector or single value of call/put flag (1 for call, -1 for put)
TYPE:
|
Source code in quantflow/options/bs.py
quantflow.options.bs.black_call
¶
| PARAMETER | DESCRIPTION |
|---|---|
k
|
Vector or single value of log-strikes
TYPE:
|
sigma
|
Corresponding vector or single value of implied volatilities (0.2 for 20%)
TYPE:
|
ttm
|
Corresponding vector or single value of Time to Maturity
TYPE:
|
Source code in quantflow/options/bs.py
quantflow.options.bs.black_vega
¶
Calculate the Black option vega from the log-strikes, volatility and time to maturity. The vega is the same for calls and puts.
Same formula for both calls and puts.
| PARAMETER | DESCRIPTION |
|---|---|
k
|
Vector or single value of log-strikes
TYPE:
|
sigma
|
Corresponding vector or single value of implied volatilities (0.2 for 20%)
TYPE:
|
ttm
|
Corresponding vector or single value of Time to Maturity
TYPE:
|
Source code in quantflow/options/bs.py
quantflow.options.bs.BlackSensitivities
pydantic-model
¶
Bases: BaseModel
Black model sensitivities (Greeks) for a single option or array of options
Fields:
-
iv(FloatArrayLike) -
price(FloatArrayLike) -
delta(FloatArrayLike) -
gamma(FloatArrayLike) -
vega(FloatArrayLike) -
volga(FloatArrayLike) -
vanna(FloatArrayLike) -
theta(FloatArrayLike)
calculate
classmethod
¶
Calculate Black model sensitivities (Greeks) in forward space.
Either the implied volatility iv or the option price must be provided.
If both are provided, the implied volatility will be used.
| PARAMETER | DESCRIPTION |
|---|---|
k
|
Vector or single value of log-strikes
TYPE:
|
ttm
|
Time to maturity
TYPE:
|
s
|
Call/put flag (1 for call, -1 for put)
TYPE:
|
iv
|
Implied volatility (0.2 for 20%)
TYPE:
|
price
|
Option price in forward space
TYPE:
|
Source code in quantflow/options/bs.py
quantflow.options.bs.implied_black_volatility
¶
Calculate the implied black volatility via Newton's method
It returns a ImpliedVols object which contains the implied volatility and convergence status. Implied volatility is in decimals (0.2 for 20%).
| PARAMETER | DESCRIPTION |
|---|---|
k
|
Vector or scalar of log strikes
TYPE:
|
price
|
Corresponding vector or scalar of option price in forward terms (price divided by forward price)
TYPE:
|
ttm
|
Corresponding vector or single value of Time to Maturity
TYPE:
|
initial_sigma
|
Corresponding vector or single value of initial volatility
TYPE:
|
call_put
|
Corresponding vector or single value of call/put flag (1 for call, -1 for put)
TYPE:
|
Source code in quantflow/options/bs.py
quantflow.options.bs.ImpliedVols
¶
Bases: NamedTuple
Result of root finding algorithm
converged
instance-attribute
¶
Array indicating whether the root finding algorithm converged for each implied volatility
single
¶
Return the first implied volatility and convergence status a a single ImpliedVol