Table of Contents

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

referenceDate Date

The reference date.

dates IEnumerable<Date>

The expiries, increasing and after the reference date; at least two.

putDeltas IEnumerable<double>

The put deltas of the matrix's first columns.

callDeltas IEnumerable<double>

The call deltas of its last columns.

hasAtm bool

Whether an at-the-money column sits between them.

blackVolMatrix Matrix

The volatilities, one row per expiry and one column per delta.

dayCounter DayCounter

The day counter.

cal Calendar

The calendar, or null for QuantLib's empty one.

spot double

The spot.

domesticTS YieldTermStructure

The domestic curve.

foreignTS YieldTermStructure

The foreign curve.

deltaType DeltaVolQuoteDeltaType

The delta convention.

atmType DeltaVolQuoteAtmType

The at-the-money convention.

atmDeltaType DeltaVolQuoteDeltaType?

The at-the-money quote's delta convention; null for deltaType.

interpolationMethod BlackVolatilitySurfaceDeltaSmileInterpolationMethod

The smile's interpolation in strike.

flatStrikeExtrapolation bool

Whether the smile is flat outside its strikes.

timeExtrapolationType BlackVolTimeExtrapolationType

How the volatilities extrapolate past the last expiry.

switchTenor Period?

The tenor from which the long-term conventions apply; null, QuantLib's 0 days, for none.

longTermDeltaType DeltaVolQuoteDeltaType

The long-term delta convention.

longTermAtmType DeltaVolQuoteAtmType

The long-term at-the-money convention.

longTermAtmDeltaType DeltaVolQuoteDeltaType?

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

ImmutableArray<Date>

MaxDate

Gets the latest date: QuantLib's Date::maxDate().

public override Date MaxDate { get; }

Property Value

Date

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

t double

The 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

t double

The time.

strike double

The strike.

Returns

double

The volatility.

BlackVolSmile(Date)

The smile at a date: BlackVolSmile(double) at its time.

public SmileSection BlackVolSmile(Date d)

Parameters

d Date

The date.

Returns

SmileSection

The smile section.

Exceptions

ArgumentException

d is default(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

t double

The 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()

Returns

double