Go to Deriscope's documentation start page


QuantLib issues an error if the strike of a VarianceSwap is either zero or negative.
This is an unnecessary restriction since the price can be very easily calculated for any strike value.
Note for the QuantLib developer:
The pricing algorithm in the QuantLib code actually handles non-positive strikes correctly.
The only problem occurs in the file F:\Devel\DeriscopeExternals\QuantLib-1.9\ql\instruments\varianceswap.cpp
There exists the following code:
void VarianceSwap::arguments::validate() const {
QL_REQUIRE(strike > 0.0, "negative or null strike given");
Simply removing the QL_REQUIRE line above will solve the problem.

Click on
download to download an xml file that contains an Excel formula that demonstrates this issue.

You may then reproduce the issue in spreadsheet by clicking on Go -> Load Excel Formula from XML or one of its variations and choose the xml file downloaded in the step above.