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
typeSwapTypeA payer swap pays the fixed leg; a receiver swap receives it.
fixedNominaldoubleThe fixed leg's notional.
fixedCurrencyCurrencyThe fixed leg's currency.
fixedScheduleScheduleThe fixed leg's schedule.
fixedRatedoubleThe fixed rate.
fixedDayCountDayCounterThe fixed leg's day counter.
fixedPaymentBdcBusinessDayConventionThe fixed leg's payment convention.
fixedPaymentLagintThe fixed leg's coupon payment lag, in days.
fixedPaymentCalendarCalendarThe fixed leg's payment calendar; the schedule's when null, QuantLib's empty calendar, for the coupons.
floatNominaldoubleThe floating leg's notional.
floatCurrencyCurrencyThe floating leg's currency.
floatScheduleScheduleThe floating leg's schedule.
floatIndexIborIndexThe floating leg's index.
floatSpreaddoubleThe spread over the floating leg's index.
floatPaymentBdcBusinessDayConventionThe floating leg's payment convention.
floatPaymentLagintThe floating leg's coupon payment lag, in days.
floatPaymentCalendarCalendarThe floating leg's payment calendar; the schedule's when null, for the coupons.
contextEvaluationContextThe evaluation context, whose at-par switch an Ibor leg reads.
telescopicValueDatesboolWhether an overnight leg uses telescopic value dates.
floatCompoundSpreadboolWhether an overnight leg compounds its spread daily.
floatLookbackDaysint?An overnight leg's lookback days; the index's fixing days when null, QuantLib's
Null<Natural>().floatObservationShiftboolWhether an overnight leg applies the observation shift.
floatLockoutDaysintAn overnight leg's lockout days.
floatAveragingMethodRateAveragingTypeAn overnight leg's averaging method.
useIndexedCouponsbool?Whether an Ibor leg's coupons are indexed or at par; the context's at-par switch when null.
floatStubIndexSelectionStubIndexSelectionThe 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
FixedDayCount
Gets the fixed leg's day counter.
public DayCounter FixedDayCount { get; }
Property Value
FixedNominal
Gets the fixed leg's notional.
public double FixedNominal { get; }
Property Value
FixedPaymentBdc
Gets the fixed leg's payment convention.
public BusinessDayConvention FixedPaymentBdc { get; }
Property Value
FixedPaymentCalendar
Gets the fixed leg's payment calendar, null for QuantLib's empty one.
public Calendar? FixedPaymentCalendar { get; }
Property Value
FixedPaymentLag
Gets the fixed leg's coupon payment lag, in days.
public int FixedPaymentLag { get; }
Property Value
FixedRate
Gets the fixed rate.
public double FixedRate { get; }
Property Value
FixedSchedule
Gets the fixed leg's schedule.
public Schedule FixedSchedule { get; }
Property Value
FloatAveragingMethod
Gets an overnight floating leg's averaging method.
public RateAveragingType FloatAveragingMethod { get; }
Property Value
FloatCompoundSpread
Gets a value indicating whether an overnight floating leg compounds its spread daily.
public bool FloatCompoundSpread { get; }
Property Value
FloatCurrency
Gets the floating leg's currency.
public Currency? FloatCurrency { get; }
Property Value
FloatIndex
Gets the floating leg's index.
public IborIndex FloatIndex { get; }
Property Value
FloatLockoutDays
Gets an overnight floating leg's lockout days.
public int FloatLockoutDays { get; }
Property Value
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
FloatPaymentBdc
Gets the floating leg's payment convention.
public BusinessDayConvention FloatPaymentBdc { get; }
Property Value
FloatPaymentCalendar
Gets the floating leg's payment calendar, null for QuantLib's empty one.
public Calendar? FloatPaymentCalendar { get; }
Property Value
FloatPaymentLag
Gets the floating leg's coupon payment lag, in days.
public int FloatPaymentLag { get; }
Property Value
FloatSchedule
Gets the floating leg's schedule.
public Schedule FloatSchedule { get; }
Property Value
FloatSpread
Gets the spread over the floating leg's index.
public double FloatSpread { get; }
Property Value
FloatStubIndexSelection
Gets the index selection for an Ibor floating leg's irregular coupons.
public StubIndexSelection FloatStubIndexSelection { get; }
Property Value
Type
Gets the swap's type: a payer swap pays the fixed leg.
public SwapType Type { get; }
Property Value
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
resultsInstrumentResultsThe 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.