Bojan Nikolic: Using and Understanding the QuantLib Addin

[website home] | [BN Algorithms]

qlConstantSwaptionVolatility – Simple rates volatility for use with swaptions

Usage:

=qlConstantSwaptionVolatility(<ObjPrefix>, <NDays>,
                              <Calendar>, <BusinessDayConvention>,
                              <Volatility>, <DayCounter>)
<ObjPrefix>

Optional prefix for names of objects created with this function

<NDays>

Number of dates from the EvaluationDate at which the variance is 0, i.e., the value date

<Calendar>

The calendar used for determining the business days. For example, “TARGET” (see TARGET Calendar)

<BusinessDayConvention>

Business day convention to adjust the exercise date if the expiry falls on a non-working day

<Volatility>

Constant in time volatility to assume

<DayCounter>

Day count convention used to calculate the interest earned over a specific period of time. For example, “Actual/360”

// Copyright (C) 2012 Bojan Nikolic <bojan@bnikolic.co.uk>
//

import co.uk.bnikolic.qlw.property_t;
import co.uk.bnikolic.qlw.qlw;
import co.uk.bnikolic.qlw.StringVector;
import co.uk.bnikolic.qlw.LongVector;
import co.uk.bnikolic.qlw.PropertyVector;
import co.uk.bnikolic.qlw.PropertyMatrix;
import co.uk.bnikolic.qlw.DoubleVector;

public class qlConstantSwaptionVolatility {
    
    public static void main(String[] args) throws Exception {
        String vol=qlw.qlConstantSwaptionVolatility("vol",
                                                    new property_t(0),
                                                    "TARGET",
                                                    "Following",
                                                    new property_t(0.20),
                                                    new property_t("Actual/365 (Fixed)"),
                                                    qlw.OH_NULL(),
                                                    qlw.OH_NULL(),
                                                    false);
    }

}