Table of Contents

Class G2SwaptionEngine

Namespace
NanoQL.PricingEngines
Assembly
NanoQL.dll

The G2 swaption engine: a European swaption priced by G2's analytic formula.

public static class G2SwaptionEngine
Inheritance
G2SwaptionEngine
Inherited Members

Remarks

A static class: Calculate runs QuantLib's four steps (playbook §2.1) on the model, an argument where QuantLib's engine holds it. The fixed rate is corrected for the floating leg's spread, which the model doesn't take into account, by the spread times the ratio of the legs' basis-point values on the model's curve, and the swaption is priced by G2's integral over the given number of standard deviations on the given number of segments, its coupons the swap's own fixed coupons.

As QuantLib's header warns, the engine assumes that the exercise date equals the start date of the swap.

Methods

Calculate(Swaption, EvaluationContext, G2, double, int)

Prices a European swaption on a G2 model.

public static InstrumentResults Calculate(Swaption swaption, EvaluationContext context, G2 model, double range, int intervals)

Parameters

swaption Swaption

The swaption.

context EvaluationContext

The evaluation context.

model G2

The model.

range double

The number of standard deviations used in the exponential term of the integral.

intervals int

The number of intervals used in the integration.

Returns

InstrumentResults

The swaption's results: the expired results when the swaption has expired.

Exceptions

ArgumentNullException

The swaption, the context or the model is null.

NanoQLException

The swaption's terms are inconsistent, it is cash settled, its swap's nominals aren't constant, a leg's basis-point value isn't available, or the integrand's break-even level can't be solved.

ArgumentException

intervals is 0.