Class BlackVolatilitySurfaceDelta
- Namespace
- NanoQL.TermStructures
- Assembly
- NanoQL.dll
A Black volatility surface quoted by delta: put deltas, call deltas and optionally an at-the-money quote at each expiry, each delta's volatilities a BlackVarianceCurve in time, its smile at a time the deltas converted to strikes on the spot and the domestic and foreign curves under the delta and at-the-money conventions, interpolated in strike.
public sealed class BlackVolatilitySurfaceDelta : BlackVolatilityTermStructure
- Inheritance
-
BlackVolatilitySurfaceDelta
- Inherited Members
- Extension Methods
Remarks
Immutable; its smile is built at each query, as QuantLib builds it.
Its curves are read at the instants its times denote, each on its own clock, where QuantLib reads them at the
surface's own times (blackvolsurfacedelta.cpp:96-97, :210): curves on Actual/360 under a surface on
Actual/365 (Fixed) gave the strikes of curves on Actual/365 (Fixed). Where the curves share the surface's day
counter and reference date, QuantLib's bits stand.
Its smile section's at-the-money level is the surface's forward, AtmLevel(double), where QuantLib passes the
at-the-money volatility, or 1 without an at-the-money quote (blackvolsurfacedelta.cpp:118, :135),
which the section's option prices, vega, digital prices and density read as the forward. Its volatilities are
QuantLib's. A documented divergence.
Constructors
BlackVolatilitySurfaceDelta(Date, IEnumerable<Date>, IEnumerable<double>, IEnumerable<double>, bool, Matrix, DayCounter, Calendar?, double, YieldTermStructure, YieldTermStructure, DeltaVolQuoteDeltaType, DeltaVolQuoteAtmType, DeltaVolQuoteDeltaType?, BlackVolatilitySurfaceDeltaSmileInterpolationMethod, bool, BlackVolTimeExtrapolationType, Period?, DeltaVolQuoteDeltaType, DeltaVolQuoteAtmType, DeltaVolQuoteDeltaType?)
Initializes a new instance of the BlackVolatilitySurfaceDelta class.
public BlackVolatilitySurfaceDelta(Date referenceDate, IEnumerable<Date> dates, IEnumerable<double> putDeltas, IEnumerable<double> callDeltas, bool hasAtm, Matrix blackVolMatrix, DayCounter dayCounter, Calendar? cal, double spot, YieldTermStructure domesticTS, YieldTermStructure foreignTS, DeltaVolQuoteDeltaType deltaType = DeltaVolQuoteDeltaType.Spot, DeltaVolQuoteAtmType atmType = DeltaVolQuoteAtmType.AtmDeltaNeutral, DeltaVolQuoteDeltaType? atmDeltaType = null, BlackVolatilitySurfaceDeltaSmileInterpolationMethod interpolationMethod = BlackVolatilitySurfaceDeltaSmileInterpolationMethod.Linear, bool flatStrikeExtrapolation = false, BlackVolTimeExtrapolationType timeExtrapolationType = BlackVolTimeExtrapolationType.FlatVolatility, Period? switchTenor = null, DeltaVolQuoteDeltaType longTermDeltaType = DeltaVolQuoteDeltaType.Fwd, DeltaVolQuoteAtmType longTermAtmType = DeltaVolQuoteAtmType.AtmDeltaNeutral, DeltaVolQuoteDeltaType? longTermAtmDeltaType = null)
Parameters
referenceDateDateThe reference date.
datesIEnumerable<Date>The expiries, increasing and after the reference date; at least two.
putDeltasIEnumerable<double>The put deltas of the matrix's first columns.
callDeltasIEnumerable<double>The call deltas of its last columns.
hasAtmboolWhether an at-the-money column sits between them.
blackVolMatrixMatrixThe volatilities, one row per expiry and one column per delta.
dayCounterDayCounterThe day counter.
calCalendarThe calendar, or null for QuantLib's empty one.
spotdoubleThe spot.
domesticTSYieldTermStructureThe domestic curve.
foreignTSYieldTermStructureThe foreign curve.
deltaTypeDeltaVolQuoteDeltaTypeThe delta convention.
atmTypeDeltaVolQuoteAtmTypeThe at-the-money convention.
atmDeltaTypeDeltaVolQuoteDeltaType?The at-the-money quote's delta convention; null for
deltaType.interpolationMethodBlackVolatilitySurfaceDeltaSmileInterpolationMethodThe smile's interpolation in strike.
flatStrikeExtrapolationboolWhether the smile is flat outside its strikes.
timeExtrapolationTypeBlackVolTimeExtrapolationTypeHow the volatilities extrapolate past the last expiry.
switchTenorPeriod?The tenor from which the long-term conventions apply; null, QuantLib's 0 days, for none.
longTermDeltaTypeDeltaVolQuoteDeltaTypeThe long-term delta convention.
longTermAtmTypeDeltaVolQuoteAtmTypeThe long-term at-the-money convention.
longTermAtmDeltaTypeDeltaVolQuoteDeltaType?The long-term at-the-money quote's delta convention; null for
longTermDeltaType.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentOutOfRangeException
An enum argument isn't a member of its type.
- ArgumentException
Fewer than two dates are given, a date isn't after the reference date, the dates aren't sorted and unique, no deltas are given, or the matrix's size doesn't match them; with QuantLib's messages.
- NanoQLException
A switch tenor is given and the surface has no calendar.
Properties
Dates
Gets the expiries.
public ImmutableArray<Date> Dates { get; }
Property Value
MaxDate
Gets the latest date: QuantLib's Date::maxDate().
public override Date MaxDate { get; }
Property Value
Methods
AtmLevel(double)
The forward at a time: the spot times the foreign discount over the domestic one, each read at the instant the time denotes on its own clock.
public override double? AtmLevel(double t)
Parameters
tdoubleThe time.
Returns
- double?
The forward.
Exceptions
- NanoQLException
A curve can't give its discount there.
BlackVolImpl(double, double)
The volatility at a time and strike: the smile's, past the last expiry at the last expiry's time under flat extrapolation; at a strike of 0 or QuantLib's null, the at-the-money quote's, or the smile's at the forward.
protected override double BlackVolImpl(double t, double strike)
Parameters
Returns
- double
The volatility.
BlackVolSmile(Date)
The smile at a date: BlackVolSmile(double) at its time.
public SmileSection BlackVolSmile(Date d)
Parameters
dDateThe date.
Returns
- SmileSection
The smile section.
Exceptions
- ArgumentException
disdefault(Date).- NanoQLException
A strike can't be found from its delta, or a curve can't give its discount.
BlackVolSmile(double)
The smile at a time: the deltas' strikes and volatilities there, interpolated in strike.
public SmileSection BlackVolSmile(double t)
Parameters
tdoubleThe time.
Returns
- SmileSection
The smile section, its at-the-money level the forward.
Exceptions
- NanoQLException
A strike can't be found from its delta, or a curve can't give its discount.
MaxStrike()
The highest strike, unbounded: QuantLib's QL_MAX_REAL.
public override double MaxStrike()
Returns
- double
1.7976931348623157e308.
MinStrike()
The lowest strike, 0.
public override double MinStrike()