Bojan Nikolic: Using and Understanding the QuantLib Addin

[website home] | [BN Algorithms]

qlDiscountingSwapEngine – create an engine for pricing of interest rate swaps

Creates an pricing engine that prices swaps simply by discounting the cashflows off the supplied yield curve. See view-only spreadsheet.

Usage:

=qlDiscountingSwapEngine(<ObjPrefix>, <YieldCurve>,
                         <IncludeSettlDate>, <SettlementDate>,
                         <NpvDate>)
<ObjPrefix>

Optional parameter to specify the object name prefix

<YieldCurve>

Yield curve object to be used for discounting the cashflows of the swap to be priced.

<IncludeSettlDate>

True or false parameter specifying if cashflows due on the settlement date should be included in the calculation. Optional parameter, true if not specified.

<SettlementDate>

Optional parameter specifying the settlement date. If not supplied the reference date of the yield curve is used.

<NpvDate>

Optional parameter representing the date to which to discount all cashflows. Yield curve reference date is used if the parameter is not supplied.

Example

Here is a minimal example of construction a discounting swap engine:

0D

nil

->

0D

nil

10Y

nil

->

10Y

nil

=qlInterpolatedYieldCurve(, R[-2]C:R[-1]C,R[-2]C[1]:R[-1]C[1], “TARGET”, “Actual/360”,,,”ZeroYield”,)

yield curve (needed for pricing engine)

->

obj_00004#0004

yield curve (needed for pricing engine)

=qlDiscountingSwapEngine(,R[-1]C)

pricing engine

->

obj_00005#0004

pricing engine