Table of Contents

Class ConstNotionalCrossCurrencyFixedVsFloatingSwap

Namespace
NanoQL.Instruments
Assembly
NanoQL.dll

A cross-currency swap exchanging a fixed-rate leg in one currency against a floating-rate leg in another, with constant notionals exchanged at inception and maturity.

public sealed class ConstNotionalCrossCurrencyFixedVsFloatingSwap : ConstNotionalCrossCurrencySwap
Inheritance
ConstNotionalCrossCurrencyFixedVsFloatingSwap
Inherited Members

Remarks

Payment lags apply only to coupon payments. Notional exchanges remain on the effective and maturity dates, adjusted by the corresponding leg's payment convention. A payer swap pays the fixed leg, which is then the first leg; a receiver swap pays the floating leg. The floating leg is an overnight leg on an overnight index and an Ibor leg otherwise.

The constructor builds the legs, as QuantLib's does: an Ibor leg reads the context's at-par switch, so it takes the context. An engine's results are a ConstNotionalCrossCurrencyFixedVsFloatingSwapResults, whose fair rate and spread FetchResults(InstrumentResults) derives from the legs' BPS when the engine gives none.

Constructors

ConstNotionalCrossCurrencyFixedVsFloatingSwap(SwapType, double, Currency?, Schedule, double, DayCounter, BusinessDayConvention, int, Calendar?, double, Currency?, Schedule, IborIndex, double, BusinessDayConvention, int, Calendar?, EvaluationContext, bool, bool, int?, bool, int, RateAveragingType, bool?, StubIndexSelection?)

Initializes a new instance of the ConstNotionalCrossCurrencyFixedVsFloatingSwap class.

public ConstNotionalCrossCurrencyFixedVsFloatingSwap(SwapType type, double fixedNominal, Currency? fixedCurrency, Schedule fixedSchedule, double fixedRate, DayCounter fixedDayCount, BusinessDayConvention fixedPaymentBdc, int fixedPaymentLag, Calendar? fixedPaymentCalendar, double floatNominal, Currency? floatCurrency, Schedule floatSchedule, IborIndex floatIndex, double floatSpread, BusinessDayConvention floatPaymentBdc, int floatPaymentLag, Calendar? floatPaymentCalendar, EvaluationContext context, bool telescopicValueDates = false, bool floatCompoundSpread = false, int? floatLookbackDays = null, bool floatObservationShift = false, int floatLockoutDays = 0, RateAveragingType floatAveragingMethod = RateAveragingType.Compound, bool? useIndexedCoupons = null, StubIndexSelection? floatStubIndexSelection = null)

Parameters

type SwapType

A payer swap pays the fixed leg; a receiver swap receives it.

fixedNominal double

The fixed leg's notional.

fixedCurrency Currency

The fixed leg's currency.

fixedSchedule Schedule

The fixed leg's schedule.

fixedRate double

The fixed rate.

fixedDayCount DayCounter

The fixed leg's day counter.

fixedPaymentBdc BusinessDayConvention

The fixed leg's payment convention.

fixedPaymentLag int

The fixed leg's coupon payment lag, in days.

fixedPaymentCalendar Calendar

The fixed leg's payment calendar; the schedule's when null, QuantLib's empty calendar, for the coupons.

floatNominal double

The floating leg's notional.

floatCurrency Currency

The floating leg's currency.

floatSchedule Schedule

The floating leg's schedule.

floatIndex IborIndex

The floating leg's index.

floatSpread double

The spread over the floating leg's index.

floatPaymentBdc BusinessDayConvention

The floating leg's payment convention.

floatPaymentLag int

The floating leg's coupon payment lag, in days.

floatPaymentCalendar Calendar

The floating leg's payment calendar; the schedule's when null, for the coupons.

context EvaluationContext

The evaluation context, whose at-par switch an Ibor leg reads.

telescopicValueDates bool

Whether an overnight leg uses telescopic value dates.

floatCompoundSpread bool

Whether an overnight leg compounds its spread daily.

floatLookbackDays int?

An overnight leg's lookback days; the index's fixing days when null, QuantLib's Null<Natural>().

floatObservationShift bool

Whether an overnight leg applies the observation shift.

floatLockoutDays int

An overnight leg's lockout days.

floatAveragingMethod RateAveragingType

An overnight leg's averaging method.

useIndexedCoupons bool?

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

floatStubIndexSelection StubIndexSelection

The index selection for an Ibor leg's irregular coupons; none when null.

Exceptions

ArgumentNullException

A schedule, the index, the fixed day counter or the context is null.

ArgumentOutOfRangeException

The type, a convention or the averaging method isn't a member of its enum, or a payment lag, lookback or lockout days are negative.

ArgumentException

A leg can't be built from the arguments.

Properties

FixedCurrency

Gets the fixed leg's currency.

public Currency? FixedCurrency { get; }

Property Value

Currency

FixedDayCount

Gets the fixed leg's day counter.

public DayCounter FixedDayCount { get; }

Property Value

DayCounter

FixedNominal

Gets the fixed leg's notional.

public double FixedNominal { get; }

Property Value

double

FixedPaymentBdc

Gets the fixed leg's payment convention.

public BusinessDayConvention FixedPaymentBdc { get; }

Property Value

BusinessDayConvention

FixedPaymentCalendar

Gets the fixed leg's payment calendar, null for QuantLib's empty one.

public Calendar? FixedPaymentCalendar { get; }

Property Value

Calendar

FixedPaymentLag

Gets the fixed leg's coupon payment lag, in days.

public int FixedPaymentLag { get; }

Property Value

int

FixedRate

Gets the fixed rate.

public double FixedRate { get; }

Property Value

double

FixedSchedule

Gets the fixed leg's schedule.

public Schedule FixedSchedule { get; }

Property Value

Schedule

FloatAveragingMethod

Gets an overnight floating leg's averaging method.

public RateAveragingType FloatAveragingMethod { get; }

Property Value

RateAveragingType

FloatCompoundSpread

Gets a value indicating whether an overnight floating leg compounds its spread daily.

public bool FloatCompoundSpread { get; }

Property Value

bool

FloatCurrency

Gets the floating leg's currency.

public Currency? FloatCurrency { get; }

Property Value

Currency

FloatIndex

Gets the floating leg's index.

public IborIndex FloatIndex { get; }

Property Value

IborIndex

FloatLockoutDays

Gets an overnight floating leg's lockout days.

public int FloatLockoutDays { get; }

Property Value

int

FloatLookbackDays

Gets an overnight floating leg's lookback days, null for the index's.

public int? FloatLookbackDays { get; }

Property Value

int?

FloatNominal

Gets the floating leg's notional.

public double FloatNominal { get; }

Property Value

double

FloatPaymentBdc

Gets the floating leg's payment convention.

public BusinessDayConvention FloatPaymentBdc { get; }

Property Value

BusinessDayConvention

FloatPaymentCalendar

Gets the floating leg's payment calendar, null for QuantLib's empty one.

public Calendar? FloatPaymentCalendar { get; }

Property Value

Calendar

FloatPaymentLag

Gets the floating leg's coupon payment lag, in days.

public int FloatPaymentLag { get; }

Property Value

int

FloatSchedule

Gets the floating leg's schedule.

public Schedule FloatSchedule { get; }

Property Value

Schedule

FloatSpread

Gets the spread over the floating leg's index.

public double FloatSpread { get; }

Property Value

double

FloatStubIndexSelection

Gets the index selection for an Ibor floating leg's irregular coupons.

public StubIndexSelection FloatStubIndexSelection { get; }

Property Value

StubIndexSelection

Type

Gets the swap's type: a payer swap pays the fixed leg.

public SwapType Type { get; }

Property Value

SwapType

Methods

FetchResults(InstrumentResults)

Reads an engine's results into the instrument's, applying any derivations the instrument makes.

public override ConstNotionalCrossCurrencyFixedVsFloatingSwapResults FetchResults(InstrumentResults results)

Parameters

results InstrumentResults

The engine's results.

Returns

ConstNotionalCrossCurrencyFixedVsFloatingSwapResults

The instrument's results.

Remarks

The fair rate and spread are the engine's when it gives them; otherwise each is derived from the NPV and its leg's BPS, and is null when that BPS is unknown or zero, where QuantLib divides by it and gives an infinite rate (QuantLib's fixed-vs-floating swap tests the zero).

Exceptions

ArgumentException

The results aren't a swap's, or a per-leg result has the wrong number of legs.

ArgumentException

The results aren't a cross-currency swap's, or a per-leg result has the wrong number of legs.

SetupExpired()

The results of an expired instrument: a zero value and error estimate, and no valuation date.

public override ConstNotionalCrossCurrencyFixedVsFloatingSwapResults SetupExpired()

Returns

ConstNotionalCrossCurrencyFixedVsFloatingSwapResults

The expired results.