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
basisdoubleThe quoted basis.
tenorPeriodThe swap's tenor, from the settlement date.
fixingDaysintThe settlement days.
calendarCalendarThe calendar of the settlement and the schedules.
conventionBusinessDayConventionThe business-day convention.
endOfMonthboolWhether the schedules follow the end-of-month rule.
baseCurrencyIndexIborIndexThe base-currency leg's index.
quoteCurrencyIndexIborIndexThe quote-currency leg's index.
collateralCurveYieldTermStructureThe collateral currency's discount curve, or null.
isFxBaseCurrencyCollateralCurrencyboolWhether the collateral currency is the base currency.
isBasisOnFxBaseCurrencyLegboolWhether the basis is quoted on the base-currency leg.
isFxBaseCurrencyLegResettableboolWhether the base-currency leg's notional resets.
contextEvaluationContextThe evaluation context the helper's dates and legs are built from.
paymentFrequencyFrequency?The base-currency leg's payment frequency; the index's tenor when null.
paymentLagintThe coupons' payment lag, in days, on both legs.
quoteCurrencyPaymentFrequencyFrequency?The quote-currency leg's payment frequency; the base-currency leg's when null, and the index's tenor if that is null too.
fxResetFixingDaysintThe business days by which each FX fixing precedes its accrual-start value date.
fxResetFixingCalendarCalendarThe calendar of the FX fixing offset; for a non-zero fixing lag, the resettable leg's schedule calendar when null.
useIndexedCouponsbool?Whether Ibor coupons are indexed or at par; the context's at-par switch when null.
baseStubIndexSelectionStubIndexSelectionThe base-currency Ibor leg's stub-index selection, whose candidate indexes must use exogenous forwarding curves; none when null.
quoteStubIndexSelectionStubIndexSelectionThe 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
FxResetFixingDays
Gets the number of business days from an FX value date to its fixing date.
public int FxResetFixingDays { get; }
Property Value
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
Methods
ImpliedQuote(EvaluationContext)
The quote implied by the term structure the helper is bound to.
public override double ImpliedQuote(EvaluationContext context)
Parameters
contextEvaluationContextThe evaluation context.
Returns
- double
The implied quote.
Exceptions
- ArgumentNullException
contextis 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
contextEvaluationContextThe evaluation context whose evaluation date the dates are computed from.