public final class BlackScholesFormulaRepository extends Object
When the formula involves ambiguous quantities, a reference value (rather than NaN) is returned Note that the formulas are expressed in terms of interest rate (r) and cost of carry (b), then d_1 and d_2 are d_{1,2} = \frac{\ln(S/X) + (b \pm \sigma^2 ) T}{\sigma \sqrt{T}}.
| Modifier and Type | Method and Description |
|---|---|
static double |
carryRho(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
Computes the carry rho.
|
static double |
charm(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
Computes the charm.
|
static double |
crossGamma(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
Computes the cross gamma.
|
static double |
delta(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
Computes the spot delta.
|
static double |
dualCharm(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
Computes the dual charm.
|
static double |
dualDelta(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
Computes the dual delta.
|
static double |
dualGamma(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
Computes the dual gamma.
|
static double |
dualVanna(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
Computes the dual vanna.
|
static double |
gamma(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
Computes the spot gamma.
|
static double |
price(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
Computes the spot price.
|
static double |
rho(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
Computes the rho.
|
static double |
strikeForDelta(double spot,
double spotDelta,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
Computes the strike for the delta.
|
static double |
theta(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
Computes the theta.
|
static double |
vanna(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
Computes the vanna.
|
static double |
vega(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
Computes the spot vega.
|
static double |
vegaBleed(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
Computes the vega bleed.
|
static double |
vomma(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
Computes the vomma (aka volga).
|
public static double price(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry rateisCall - true for call, false for putpublic static double delta(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry rateisCall - true for call, false for putpublic static double strikeForDelta(double spot,
double spotDelta,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
Note that the parameter range is more restricted for this method because the strike is undetermined for infinite/zero valued parameters.
spot - the spot value of the underlyingspotDelta - The spot deltatimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry rateisCall - true for call, false for putpublic static double dualDelta(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
This is the first derivative of option price with respect to strike.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry rateisCall - true for call, false for putpublic static double gamma(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
This is the second order sensitivity of the spot option value to the spot.
$\frac{\partial^2 FV}{\partial^2 f}$.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry ratepublic static double dualGamma(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry ratepublic static double crossGamma(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
This is the sensitivity of the delta to the strike.
$\frac{\partial^2 V}{\partial f \partial K}$.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry ratepublic static double theta(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
This is the sensitivity of the present value to a change in time to maturity.
$\-frac{\partial V}{\partial T}$.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry rateisCall - true for call, false for putpublic static double charm(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
This is the minus of second order derivative of option value, once spot and once time to maturity.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - The interest ratecostOfCarry - The cost of carryisCall - true for call, false for putpublic static double dualCharm(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
This is the minus of second order derivative of option value, once strike and once time to maturity.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost of carryisCall - true for call, false for putpublic static double vega(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
This is the sensitivity of the option's spot price wrt the implied volatility (which is just the spot vega divided by the numeraire).
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry ratepublic static double vanna(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
This is the second order derivative of the option value, once to the underlying spot and once to volatility.
$\frac{\partial^2 FV}{\partial f \partial \sigma}$.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry ratepublic static double dualVanna(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
This is the second order derivative of the option value, once to the strike and once to volatility.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry ratepublic static double vomma(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
This is the second order derivative of the option spot price with respect to the implied volatility.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry ratepublic static double vegaBleed(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry)
This is the second order derivative of the option spot price, once to the volatility and once to the time.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - the interest ratecostOfCarry - the cost-of-carry ratepublic static double rho(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
This is the derivative of the option value with respect to the risk free interest rate . Note that costOfCarry = interestRate - dividend, which the derivative also acts on.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - The interest ratecostOfCarry - the cost of carryisCall - true for call, false for putpublic static double carryRho(double spot,
double strike,
double timeToExpiry,
double lognormalVol,
double interestRate,
double costOfCarry,
boolean isCall)
This is the derivative of the option value with respect to the cost of carry . Note that costOfCarry = interestRate - dividend, which the derivative also acts on.
spot - the spot value of the underlyingstrike - the striketimeToExpiry - the time to expirylognormalVol - the log-normal volatilityinterestRate - The interest ratecostOfCarry - The cost of carryisCall - true for call, false for putCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.