Class SwapTenorThreshold
- Namespace
- NanoQL.Instruments
- Assembly
- NanoQL.dll
A currency's fixed leg tenor at the swap tenors on one side of a threshold: QuantLib's GBP swaps take a 1Y fixed leg at most a year long, and its AUD swaps a 6M one at least four years long.
public sealed record SwapTenorThreshold : IEquatable<SwapTenorThreshold>
- Inheritance
-
SwapTenorThreshold
- Implements
- Inherited Members
Constructors
SwapTenorThreshold(SwapTenorComparison, Period, Period)
A currency's fixed leg tenor at the swap tenors on one side of a threshold: QuantLib's GBP swaps take a 1Y fixed leg at most a year long, and its AUD swaps a 6M one at least four years long.
public SwapTenorThreshold(SwapTenorComparison Comparison, Period SwapTenor, Period FixedLegTenor)
Parameters
ComparisonSwapTenorComparisonHow the swap's tenor compares with the threshold.
SwapTenorPeriodThe threshold.
FixedLegTenorPeriodThe fixed leg's tenor where the comparison holds.
Properties
Comparison
How the swap's tenor compares with the threshold.
public SwapTenorComparison Comparison { get; init; }
Property Value
FixedLegTenor
The fixed leg's tenor where the comparison holds.
public Period FixedLegTenor { get; init; }
Property Value
SwapTenor
The threshold.
public Period SwapTenor { get; init; }
Property Value
Methods
Deconstruct(out SwapTenorComparison, out Period, out Period)
public void Deconstruct(out SwapTenorComparison Comparison, out Period SwapTenor, out Period FixedLegTenor)
Parameters
ComparisonSwapTenorComparisonSwapTenorPeriodFixedLegTenorPeriod
Equals(SwapTenorThreshold?)
public bool Equals(SwapTenorThreshold? other)
Parameters
otherSwapTenorThreshold
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
Holds(Period)
Whether a swap's tenor is on the threshold's side, by QuantLib's comparison of periods.
public bool Holds(Period tenor)
Parameters
tenorPeriodThe swap's tenor.
Returns
- bool
Whether the comparison holds.
Exceptions
- NanoQLException
The two periods can't be compared (days with months).
ToString()
public override string ToString()
Returns
Operators
operator ==(SwapTenorThreshold?, SwapTenorThreshold?)
public static bool operator ==(SwapTenorThreshold? left, SwapTenorThreshold? right)
Parameters
leftSwapTenorThresholdrightSwapTenorThreshold
Returns
operator !=(SwapTenorThreshold?, SwapTenorThreshold?)
public static bool operator !=(SwapTenorThreshold? left, SwapTenorThreshold? right)
Parameters
leftSwapTenorThresholdrightSwapTenorThreshold