Put-Call Parity¶
quantflow.options.parity.PutCallParity
pydantic-model
¶
Bases: BaseModel
A put-call parity at a single strike
used for forward and discount curve calibration.
Fields:
quantflow.options.parity.PutCallParities
pydantic-model
¶
Bases: BaseModel
A collection of put-call parities for a given maturity
Fields:
-
parities(list[PutCallParity]) -
spot(Decimal) -
ttm(Decimal) -
inverse(bool)
from_parities
classmethod
¶
Source code in quantflow/options/parity.py
regressand
¶
Calculate the regressand for put-call parity regression.
For direct options, the regressand is (C - P) / S, while for inverse options it is simply c - p.
Source code in quantflow/options/parity.py
regressor
¶
Calculate the regressor for put-call parity regression, which is the strike price divided by the spot price.
weights
¶
Inverse bid-ask spread weights for the put-call parity regression.
Pairs with a tighter parity spread receive a larger weight. A floor of one tenth of the median positive spread avoids infinite weights on zero spread pairs.
Source code in quantflow/options/parity.py
calibrate_forward
¶
Calibrate the forward price from put-call parity.
The forward is the zero crossing of the weighted parity regression.
Pairs far from the money contain one deep in the money option whose
quote carries little information, so the regression is restricted to
pairs within band units of convexity adjusted moneyness.
The moneyness requires the forward and the volatility, which are not known upfront. The algorithm therefore iterates: fit the crossing with all pairs, estimate the at the money volatility from the straddle nearest the crossing, select the pairs inside the band, refit, and repeat until the forward is stable.
Returns the forward price, or None when fewer than two pairs are available or the regression is degenerate.
| PARAMETER | DESCRIPTION |
|---|---|
band
|
Initial half width of the pair selection band, in units of convexity adjusted moneyness (standard deviations). The band widens automatically when it contains fewer than min_pairs pairs.
TYPE:
|
min_pairs
|
Minimum number of pairs; the band widens until reached
TYPE:
|
max_iterations
|
Maximum number of forward refinement iterations
TYPE:
|
tol
|
Relative tolerance on the forward for convergence
TYPE:
|
Source code in quantflow/options/parity.py
quote_discount
¶
Quote discount factor with the forward held fixed.
With the forward known, put-call parity has a single free parameter, the quote discount factor \(D_q\):
where \(y\) is the normalized call put difference, \(x\) the strike over spot and \(f\) the forward over spot. The parameter is estimated by weighted least squares over all pairs, with the weights of weights. Returns None when the estimate is not positive.
| PARAMETER | DESCRIPTION |
|---|---|
forward
|
Forward price divided by the spot price
TYPE:
|
Source code in quantflow/options/parity.py
plot
¶
Plot the normalized put-call parity data and the fitted regression line.
The line is built from the calibrated forward (calibrate_forward) and the quote discount factor estimated with the forward held fixed (quote_discount).