Class FxResetCoupon
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
A floating-rate coupon of an FX-resetting leg.
[Experimental("NQL0001")]
public sealed class FxResetCoupon : FloatingRateCoupon
- Inheritance
-
FxResetCoupon
- Inherited Members
- Extension Methods
Remarks
The coupon wraps an underlying floating-rate coupon: its nominal is the constant leg's notional converted at the period's FX-reset observation, by its FX-reset pricer; its rate is the underlying's, and its amounts the underlying's rescaled to that nominal, which keeps the underlying's accrual logic, e.g. the partial-period compounding of an overnight-indexed coupon. ContractNominal is the underlying's.
Immutable, as every coupon is: SetFxResetPricer(FxResetPricer?) returns a copy holding the pricer, and a coupon pricer set through SetPricer<T>(T, FloatingRateCouponPricer?) is forwarded to a copy of the underlying, whose pricer drives the paid rate.
Constructors
FxResetCoupon(FloatingRateCoupon, double, FxReset)
Initializes a new instance of the FxResetCoupon class.
public FxResetCoupon(FloatingRateCoupon underlying, double constantLegNotional, FxReset fxReset)
Parameters
underlyingFloatingRateCouponThe underlying floating-rate coupon.
constantLegNotionaldoubleThe constant leg's notional, in its own currency.
fxResetFxResetThe FX-reset observation of the coupon's period.
Exceptions
- ArgumentNullException
underlyingis null.- ArgumentException
The underlying coupon's nominal is zero.
Properties
ConstantLegNotional
Gets the constant leg's notional, in its own currency.
public double ConstantLegNotional { get; }
Property Value
FxReset
Gets the FX-reset observation of the coupon's period.
public FxReset FxReset { get; }
Property Value
FxResetDate
Gets the date on which the FX rate is observed.
public Date FxResetDate { get; }
Property Value
FxResetPricer
Gets the FX-reset pricer, or null when none is set.
public FxResetPricer? FxResetPricer { get; }
Property Value
FxResetValueDate
Gets the settlement date of the FX observation.
public Date FxResetValueDate { get; }
Property Value
Underlying
Gets the underlying floating-rate coupon.
public FloatingRateCoupon Underlying { get; }
Property Value
Methods
AccruedAmount(Date, EvaluationContext)
The underlying coupon's accrued amount, rescaled to the FX-reset nominal.
public override double AccruedAmount(Date d, EvaluationContext context)
Parameters
dDateThe date.
contextEvaluationContextThe evaluation context.
Returns
- double
The accrued amount.
Amount(EvaluationContext)
The underlying coupon's amount, rescaled to the FX-reset nominal.
public override double Amount(EvaluationContext context)
Parameters
contextEvaluationContextThe evaluation context.
Returns
- double
The amount.
FixingDate()
The fixing date: the fixing days before the accrual start, or before the accrual end in arrears, on the index's fixing calendar.
public override Date FixingDate()
Returns
- Date
The fixing date.
IndexFixing(EvaluationContext)
The index fixing on the coupon's fixing date.
public override double IndexFixing(EvaluationContext context)
Parameters
contextEvaluationContextThe evaluation context.
Returns
- double
The fixing.
Nominal(EvaluationContext)
The nominal: the constant leg's notional converted at the observation's FX rate.
public override double Nominal(EvaluationContext context)
Parameters
contextEvaluationContextThe evaluation context, which the FX-reset pricer reads.
Returns
- double
The nominal.
Exceptions
- NanoQLException
No FX-reset pricer is set.
Rate(EvaluationContext)
The coupon's rate: its pricer's swaplet rate.
public override double Rate(EvaluationContext context)
Parameters
contextEvaluationContextThe evaluation context.
Returns
- double
The rate.
Exceptions
- NanoQLException
No pricer is set.
SetFxResetPricer(FxResetPricer?)
A copy of the coupon holding an FX-reset pricer: QuantLib's setFxResetPricer.
public FxResetCoupon SetFxResetPricer(FxResetPricer? pricer)
Parameters
pricerFxResetPricerThe pricer, or null for none.
Returns
- FxResetCoupon
The copy; the receiver is unchanged.
WithPricer(FloatingRateCouponPricer?)
A copy of the coupon holding another pricer: SetPricer<T>(T, FloatingRateCouponPricer?)'s step, which
QuantLib's setPricer does in place. The base's copy is memberwise; an override returns a copy of the same
runtime type.
protected override FloatingRateCoupon WithPricer(FloatingRateCouponPricer? pricer)
Parameters
pricerFloatingRateCouponPricerThe pricer, or null for none.
Returns
- FloatingRateCoupon
The copy.
Remarks
The pricer is forwarded to a copy of the underlying coupon, whose pricer drives the paid rate.