Class IborLegCashFlows
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
A floating leg mapped to deterministic cash flows under a tenor basis: the notional at the first remaining coupon's
start, a spread coupon per remaining coupon, and the notional back at the end: QuantLib's
IborLegCashFlows.
[Experimental("NQL0001")]
public class IborLegCashFlows
- Inheritance
-
IborLegCashFlows
- Derived
- Inherited Members
Remarks
The first remaining coupon is the first that starts on or after the discount curve's reference date; with none, the flows are empty. Each spread is the coupon's forward against the discount curve's forward over its accrual, continuously compounded and paid at the coupon's start, or simply compounded and paid at its payment date. The times are from the reference date, Actual/365 (Fixed), and the weights the flows' amounts, read in the context.
An extension point, as QuantLib's: SwapCashFlows derives from it. QuantLib reads its first cash flow as a coupon before it checks the leg, so an empty leg, or a first flow that isn't a coupon, is undefined there; here both are refused, the latter with QuantLib's own "FloatingLeg CashFlow is no Coupon.".
Constructors
IborLegCashFlows()
Initializes a new instance of the IborLegCashFlows class, with no flows: QuantLib's default constructor.
public IborLegCashFlows()
IborLegCashFlows(IReadOnlyList<CashFlow>, YieldTermStructure, EvaluationContext, bool)
Initializes a new instance of the IborLegCashFlows class.
public IborLegCashFlows(IReadOnlyList<CashFlow> iborLeg, YieldTermStructure discountCurve, EvaluationContext context, bool contTenorSpread = true)
Parameters
iborLegIReadOnlyList<CashFlow>The floating leg, its flows coupons.
discountCurveYieldTermStructureThe discount curve, whose reference date the times start from.
contextEvaluationContextThe evaluation context, whose fixings and forecasts the coupons' rates read.
contTenorSpreadboolWhether the spreads are continuously compounded and paid at each coupon's start; otherwise simply compounded and paid at its payment date.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentException
The leg is empty.
- NanoQLException
A flow of the leg isn't a coupon, with QuantLib's text, or a rate can't be read.
Properties
FloatLeg
Gets the mapped floating flows: the first notional, the spread coupons and the last notional.
public ImmutableArray<CashFlow> FloatLeg { get; }
Property Value
FloatTimes
Gets the floating flows' times from the reference date, Actual/365 (Fixed).
public ImmutableArray<double> FloatTimes { get; }
Property Value
FloatWeights
Gets the floating flows' amounts.
public ImmutableArray<double> FloatWeights { get; }
Property Value
RefDate
Gets the reference date the times start from, the discount curve's; default(Date) for no
flows.
protected Date RefDate { get; }
Property Value
Methods
Times(IEnumerable<CashFlow>)
The flows' times from the reference date, Actual/365 (Fixed), QuantLib's model time.
protected ImmutableArray<double> Times(IEnumerable<CashFlow> flows)
Parameters
flowsIEnumerable<CashFlow>The flows.
Returns
- ImmutableArray<double>
The times.