Table of Contents

Class MtMCrossCurrencyBasisSwapRateHelper

Namespace
NanoQL.Experimental
Assembly
NanoQL.dll

The rate helper for bootstrapping over mark-to-market cross-currency basis swaps.

[Experimental("NQL0001")]
public sealed class MtMCrossCurrencyBasisSwapRateHelper : CrossCurrencyBasisSwapRateHelperBase, IBootstrapHelper
Inheritance
MtMCrossCurrencyBasisSwapRateHelper
Implements
Inherited Members
Extension Methods

Remarks

A helper for a cross-currency swap with a resetting notional: at each accrual-period boundary the notional on the mark-to-market leg is reset to reflect changes in the FX rate, reducing the counterparty and FX risk of the structure. For more details see N. Moreni, A. Pallavicini (2015), FX Modelling in Collateralized Markets: foreign measures, basis curves and pricing formulae.

The coupon payment lag applies to both legs; notional exchanges remain on the effective and maturity dates. In both frequency parameters, NoFrequency is read as none.

Constructors

MtMCrossCurrencyBasisSwapRateHelper(double, Period, int, Calendar, BusinessDayConvention, bool, IborIndex, IborIndex, YieldTermStructure?, bool, bool, bool, EvaluationContext, Frequency?, int, Frequency?, int, Calendar?, bool?, StubIndexSelection?, StubIndexSelection?)

Initializes a new instance of the MtMCrossCurrencyBasisSwapRateHelper class.

public MtMCrossCurrencyBasisSwapRateHelper(double basis, Period tenor, int fixingDays, Calendar calendar, BusinessDayConvention convention, bool endOfMonth, IborIndex baseCurrencyIndex, IborIndex quoteCurrencyIndex, YieldTermStructure? collateralCurve, bool isFxBaseCurrencyCollateralCurrency, bool isBasisOnFxBaseCurrencyLeg, bool isFxBaseCurrencyLegResettable, EvaluationContext context, Frequency? paymentFrequency = null, int paymentLag = 0, Frequency? quoteCurrencyPaymentFrequency = null, int fxResetFixingDays = 0, Calendar? fxResetFixingCalendar = null, bool? useIndexedCoupons = null, StubIndexSelection? baseStubIndexSelection = null, StubIndexSelection? quoteStubIndexSelection = null)

Parameters

basis double

The quoted basis.

tenor Period

The swap's tenor, from the settlement date.

fixingDays int

The settlement days.

calendar Calendar

The calendar of the settlement and the schedules.

convention BusinessDayConvention

The business-day convention.

endOfMonth bool

Whether the schedules follow the end-of-month rule.

baseCurrencyIndex IborIndex

The base-currency leg's index.

quoteCurrencyIndex IborIndex

The quote-currency leg's index.

collateralCurve YieldTermStructure

The collateral currency's discount curve, or null.

isFxBaseCurrencyCollateralCurrency bool

Whether the collateral currency is the base currency.

isBasisOnFxBaseCurrencyLeg bool

Whether the basis is quoted on the base-currency leg.

isFxBaseCurrencyLegResettable bool

Whether the base-currency leg's notional resets.

context EvaluationContext

The evaluation context the helper's dates and legs are built from.

paymentFrequency Frequency?

The base-currency leg's payment frequency; the index's tenor when null.

paymentLag int

The coupons' payment lag, in days, on both legs.

quoteCurrencyPaymentFrequency Frequency?

The quote-currency leg's payment frequency; the base-currency leg's when null, and the index's tenor if that is null too.

fxResetFixingDays int

The business days by which each FX fixing precedes its accrual-start value date.

fxResetFixingCalendar Calendar

The calendar of the FX fixing offset; for a non-zero fixing lag, the resettable leg's schedule calendar when null.

useIndexedCoupons bool?

Whether Ibor coupons are indexed or at par; the context's at-par switch when null.

baseStubIndexSelection StubIndexSelection

The base-currency Ibor leg's stub-index selection, whose candidate indexes must use exogenous forwarding curves; none when null.

quoteStubIndexSelection StubIndexSelection

The quote-currency Ibor leg's stub-index selection; none when null.

Exceptions

ArgumentNullException

An index, the calendar or the context is null.

ArgumentOutOfRangeException

Fixing days are negative, or the convention isn't a member of its enum.

ArgumentException

An overnight leg has no payment frequency, the tenor is shorter than a coupon period, or the swap can't be built.

Properties

FxResetFixingCalendar

Gets the calendar used to determine FX fixing dates, null for none.

public Calendar? FxResetFixingCalendar { get; }

Property Value

Calendar

FxResetFixingDays

Gets the number of business days from an FX value date to its fixing date.

public int FxResetFixingDays { get; }

Property Value

int

Swap

Gets the underlying par swap: unit notionals, zero spreads and spot FX of 1, so that its fair spread on the basis leg reproduces the helper's quote; it pays the base-currency leg. QuantLib's swap carries a DiscountingMtMCrossCurrencyBasisSwapEngine on the quote currency, its leg's discount curve, the base currency, its leg's, and a spot of 1, the flows on the settlement date included, which Calculate(MtMCrossCurrencyBasisSwap, EvaluationContext, Currency?, YieldTermStructure, Currency?, YieldTermStructure, double, bool?, Date?, Date?, Date?) takes as its arguments.

public MtMCrossCurrencyBasisSwap Swap { get; }

Property Value

MtMCrossCurrencyBasisSwap

Methods

ImpliedQuote(EvaluationContext)

The quote implied by the term structure the helper is bound to.

public override double ImpliedQuote(EvaluationContext context)

Parameters

context EvaluationContext

The evaluation context.

Returns

double

The implied quote.

Exceptions

ArgumentNullException

context is null.

NanoQLException

The helper isn't bound to a term structure.

NanoQLException

The helper isn't bound to a curve, has no collateral curve, or the swap's fair spread on the basis leg isn't available.

InitializeDates(EvaluationContext)

Computes the helper's dates for an evaluation date: QuantLib's initializeDates(). A helper whose dates follow the evaluation date overrides it and calls it from its constructor; the bootstraps call it on a fresh copy to re-date the helper for a curve built under another evaluation date. The base does nothing.

protected override void InitializeDates(EvaluationContext context)

Parameters

context EvaluationContext

The evaluation context whose evaluation date the dates are computed from.