public final class NormalFormulaRepository extends Object
| Modifier and Type | Method and Description |
|---|---|
static double |
delta(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Computes the delta.
|
static double |
gamma(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Computes the gamma.
|
static double |
impliedVolatility(double optionPrice,
double forward,
double strike,
double timeToExpiry,
double initialNormalVol,
double numeraire,
PutCall putCall)
Computes the implied volatility.
|
static double |
impliedVolatilityFromBlackApproximated(double forward,
double strike,
double timeToExpiry,
double blackVolatility)
Compute the implied volatility using an approximate explicit transformation formula.
|
static ValueDerivatives |
impliedVolatilityFromBlackApproximatedAdjoint(double forward,
double strike,
double timeToExpiry,
double blackVolatility)
Compute the implied volatility using an approximate explicit transformation formula and its derivative
with respect to the input Black volatility.
|
static double |
price(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Computes the forward price.
|
static ValueDerivatives |
priceAdjoint(double forward,
double strike,
double timeToExpiry,
double normalVol,
double numeraire,
PutCall putCall)
Computes the price and first order derivatives.
|
static double |
theta(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Computes the theta.
|
static double |
vega(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Computes the vega.
|
public static double price(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.
forward - the forward value of the underlyingstrike - the striketimeToExpiry - the time to expirynormalVol - the normal volatilityputCall - whether it is put or callpublic static ValueDerivatives priceAdjoint(double forward, double strike, double timeToExpiry, double normalVol, double numeraire, PutCall putCall)
The derivatives are stored in an array with:
forward - the forward value of the underlyingstrike - the striketimeToExpiry - the time to expirynormalVol - the normal volatilitynumeraire - the numeraireputCall - whether it is put or callpublic static double delta(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.
forward - the forward value of the underlyingstrike - the striketimeToExpiry - the time to expirynormalVol - the normal volatilityputCall - whether it is put or callpublic static double gamma(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.
forward - the forward value of the underlyingstrike - the striketimeToExpiry - the time to expirynormalVol - the normal volatilityputCall - whether it is put or callpublic static double theta(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.
forward - the forward value of the underlyingstrike - the striketimeToExpiry - the time to expirynormalVol - the normal volatilityputCall - whether it is put or callpublic static double vega(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.
forward - the forward value of the underlyingstrike - the striketimeToExpiry - the time to expirynormalVol - the normal volatilityputCall - whether it is put or callpublic static double impliedVolatility(double optionPrice,
double forward,
double strike,
double timeToExpiry,
double initialNormalVol,
double numeraire,
PutCall putCall)
If the volatility data is not zero, it is used as a starting point for the volatility search.
Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.
optionPrice - the price of the optionforward - the forward value of the underlyingstrike - the striketimeToExpiry - the time to expiryinitialNormalVol - the normal volatility used to start the searchnumeraire - the numeraireputCall - whether it is put or callpublic static double impliedVolatilityFromBlackApproximated(double forward,
double strike,
double timeToExpiry,
double blackVolatility)
Reference: Hagan, P. S. Volatility conversion calculator. Technical report, Bloomberg.
forward - the forward rate/pricestrike - the option striketimeToExpiry - the option time to maturityblackVolatility - the Black implied volatilitypublic static ValueDerivatives impliedVolatilityFromBlackApproximatedAdjoint(double forward, double strike, double timeToExpiry, double blackVolatility)
Reference: Hagan, P. S. Volatility conversion calculator. Technical report, Bloomberg.
forward - the forward rate/pricestrike - the option striketimeToExpiry - the option time to maturityblackVolatility - the Black implied volatilityCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.