QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
BlackDeltaCalculator Class Reference

Black delta calculator class. More...

#include <ql/pricingengines/blackdeltacalculator.hpp>

Constructors

 BlackDeltaCalculator (Option::Type ot, DeltaVolQuote::DeltaType dt, Real spot, DiscountFactor dDiscount, DiscountFactor fDiscount, Real stdDev)
 Constructs a BlackDeltaCalculator object This class provides methods to calculate option delta and strike values using the Black-Scholes formula, supporting various FX delta conventions (spot, forward, premium-adjusted, etc.). It is designed for efficient repeated calculations across different strikes, which is useful in volatility smile construction and calibration routines.
Real deltaFromStrike (Real strike) const
 Computes the option delta for a given strike.
Real strikeFromDelta (Real delta) const
 Computes the strike corresponding to a given delta.
Real atmStrike (DeltaVolQuote::AtmType atmT) const
 Calculates the at-the-money (ATM) strike for the given ATM convention.
void setDeltaType (DeltaVolQuote::DeltaType dt)
 Sets the delta calculation convention.
void setOptionType (Option::Type ot)
 Sets the option type (call or put).
Real cumD1 (Real strike) const
Real cumD2 (Real strike) const
Real nD1 (Real strike) const
Real nD2 (Real strike) const

Detailed Description

Black delta calculator class.

Class includes many operations needed for different applications in FX markets, which has special quotation mechanisms, since every price can be expressed in both numeraires.

Constructor & Destructor Documentation

◆ BlackDeltaCalculator()

BlackDeltaCalculator ( Option::Type ot,
DeltaVolQuote::DeltaType dt,
Real spot,
DiscountFactor dDiscount,
DiscountFactor fDiscount,
Real stdDev )

Constructs a BlackDeltaCalculator object This class provides methods to calculate option delta and strike values using the Black-Scholes formula, supporting various FX delta conventions (spot, forward, premium-adjusted, etc.). It is designed for efficient repeated calculations across different strikes, which is useful in volatility smile construction and calibration routines.

Parameters
otOption type (call or put)
dtDelta type (spot, forward, premium-adjusted, etc.)
spotSpot FX rate
dDiscountDomestic discount factor
fDiscountForeign discount factor
stdDevStandard deviation of the underlying
Warning
instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity)

Member Function Documentation

◆ deltaFromStrike()

Real deltaFromStrike ( Real strike) const

Computes the option delta for a given strike.

Calculates the delta of an option using the Black-Scholes formula, according to the delta convention specified at construction (spot, forward, premium-adjusted, etc.).

Parameters
strikeThe option strike price.
Returns
The option delta under the chosen convention.

◆ strikeFromDelta()

Real strikeFromDelta ( Real delta) const

Computes the strike corresponding to a given delta.

Inverts the Black-Scholes formula to find the strike that yields the specified delta, according to the delta convention set at construction. Used for constructing volatility smiles and for quoting FX options by delta.

Parameters
deltaThe target option delta (under the chosen convention).
Returns
The strike price corresponding to the given delta.

◆ atmStrike()

Real atmStrike ( DeltaVolQuote::AtmType atmT) const

Calculates the at-the-money (ATM) strike for the given ATM convention.

Computes the strike price that corresponds to "at-the-money" under different conventions commonly used in FX markets. This method does not require an explicit strike input as it determines the ATM level based on the specified convention.

Parameters
atmTThe ATM convention to use:
  • AtmNull: No ATM convention (returns null)
  • AtmSpot: ATM strike equals the current spot rate
  • AtmForward: ATM strike equals the forward rate
  • AtmDeltaNeutral: ATM strike where call and put deltas sum to zero
  • AtmVegaMax: ATM strike that maximizes vega (typically close to forward)
  • AtmGammaMax: ATM strike that maximizes gamma
  • AtmPutCall25: ATM strike where 25-delta call and put have equal volatility
Returns
The ATM strike price according to the specified convention.
Note
This calculation is independent of the strike and uses the forward rate, volatility, and time to expiration set at construction.

◆ setDeltaType()

void setDeltaType ( DeltaVolQuote::DeltaType dt)

Sets the delta calculation convention.

Parameters
dtThe new delta type convention:

◆ setOptionType()

void setOptionType ( Option::Type ot)

Sets the option type (call or put).

Parameters
otThe option type

◆ cumD1()

Real cumD1 ( Real strike) const
Deprecated
Internal: do not use. Deprecated in version 1.40. This method will be moved in the private section

◆ cumD2()

Real cumD2 ( Real strike) const
Deprecated
Internal: do not use. Deprecated in version 1.40. This method will be moved in the private section

◆ nD1()

Real nD1 ( Real strike) const
Deprecated
Internal: do not use. Deprecated in version 1.40. This method will be moved in the private section

◆ nD2()

Real nD2 ( Real strike) const
Deprecated
Internal: do not use. Deprecated in version 1.40. This method will be moved in the private section