Table of Contents

Class CapFloorTermVolCurve

Namespace
NanoQL.TermStructures
Assembly
NanoQL.dll

The at-the-money cap and floor term-volatility curve: the volatility of a cap or floor of a given length, interpolated in the market volatilities of caps and floors of given lengths, whatever the strike.

public sealed class CapFloorTermVolCurve : CapFloorTermVolatilityStructure
Inheritance
CapFloorTermVolCurve
Inherited Members
Extension Methods

Remarks

The option dates and times are computed from the reference date when the curve is built, and the interpolation is a natural cubic spline over the option times, built once, which extrapolates inside the structure's range checks.

QuantLib's constructors on quotes and on volatilities coincide once a quote is a double. The floating forms, whose reference date QuantLib moves with the evaluation date, are Create(int, Calendar, BusinessDayConvention, IEnumerable<Period>, IEnumerable<double>, EvaluationContext, DayCounter?): a curve under a later evaluation date is a new curve, whose option dates are that date's, where QuantLib's moving curve can keep the previous reference date's option dates (a documented divergence).

Constructors

CapFloorTermVolCurve(Date, Calendar?, BusinessDayConvention, IEnumerable<Period>, IEnumerable<double>, DayCounter?)

Initializes a new instance of the CapFloorTermVolCurve class with a fixed reference date: the settlement date.

public CapFloorTermVolCurve(Date settlementDate, Calendar? calendar, BusinessDayConvention bdc, IEnumerable<Period> optionTenors, IEnumerable<double> vols, DayCounter? dc = null)

Parameters

settlementDate Date

The settlement date, the reference date.

calendar Calendar

The calendar of the option dates, or null, QuantLib's empty calendar, with which the option dates can't be computed.

bdc BusinessDayConvention

The convention adjusting the option dates.

optionTenors IEnumerable<Period>

The option tenors, positive and increasing.

vols IEnumerable<double>

The volatilities, one per option tenor.

dc DayCounter

The day counter; Actual365Fixed, QuantLib's default, when null.

Exceptions

ArgumentNullException

optionTenors or vols is null.

ArgumentException

The option tenors are empty, not positive or not increasing, there is not one volatility per option tenor, or there are fewer than two option tenors.

ArgumentOutOfRangeException

bdc isn't a member of its type.

NanoQLException

Two tenors can't be compared, or the calendar is null.

Properties

MaxDate

Gets the latest date for which the curve returns volatilities: the last option tenor's date.

public override Date MaxDate { get; }

Property Value

Date

OptionDates

Gets the option dates, computed from the reference date.

public ImmutableArray<Date> OptionDates { get; }

Property Value

ImmutableArray<Date>

OptionTenors

Gets the option tenors.

public ImmutableArray<Period> OptionTenors { get; }

Property Value

ImmutableArray<Period>

OptionTimes

Gets the option times, from the reference date.

public ImmutableArray<double> OptionTimes { get; }

Property Value

ImmutableArray<double>

Methods

Create(int, Calendar, BusinessDayConvention, IEnumerable<Period>, IEnumerable<double>, EvaluationContext, DayCounter?)

A curve whose reference date is the given number of business days after the evaluation date, on the calendar: QuantLib's floating forms.

public static CapFloorTermVolCurve Create(int settlementDays, Calendar calendar, BusinessDayConvention bdc, IEnumerable<Period> optionTenors, IEnumerable<double> vols, EvaluationContext context, DayCounter? dc = null)

Parameters

settlementDays int

The business days from the evaluation date to the reference date.

calendar Calendar

The calendar of the business days and of the option dates.

bdc BusinessDayConvention

The convention adjusting the option dates.

optionTenors IEnumerable<Period>

The option tenors, positive and increasing.

vols IEnumerable<double>

The volatilities, one per option tenor.

context EvaluationContext

The evaluation context.

dc DayCounter

The day counter; Actual365Fixed, QuantLib's default, when null.

Returns

CapFloorTermVolCurve

The curve, with a fixed reference date.

Exceptions

ArgumentNullException

context, calendar or a collection is null.

ArgumentOutOfRangeException

settlementDays is negative, or bdc isn't a member of its type.

ArgumentException

The option tenors are empty, not positive or not increasing, there is not one volatility per option tenor, or there are fewer than two option tenors.

NanoQLException

Two tenors can't be compared.

MaxStrike()

The maximum strike for which the structure returns values.

public override double MaxStrike()

Returns

double

The strike.

MinStrike()

The minimum strike for which the structure returns values.

public override double MinStrike()

Returns

double

The strike.

VolatilityImpl(double, double)

The volatility calculation, after the range and strike checks.

protected override double VolatilityImpl(double length, double strike)

Parameters

length double

The time, from the reference date.

strike double

The strike.

Returns

double

The volatility.