The Nelson-Siegel-[Svensson] Model is a common approach to fit a yield curve. Its popularity might be explained with economic interpretability of its parameters but most likely it is because the European Central Bank uses it. However, what may do for ECB will not necessarily work in all cases: the model parameters are sometimes extremely unstable and fail to converge. Continue reading "Pitfalls of Nelson-Siegel Yield Curve Modeling – Part I"
The Open Source Risk Engine is an opensource software project for risk analytics and xVA. It is written (mostly) in C++ and based on QuantLib. In this post we explain how the ORE can be built from source in Visual Studio 2017. Continue reading "Building Open Source Risk Engine (Quaternion ORE) in VS2017 without Git"
QuantLib Python - a port of C++ library to Python via SWIG - provides a lot of advantages for a practical usage. In particular, it gives a great flexibility due to interactive python console and allows a seamless integration with the AI libraries like Keras and Tensorflow. However, it seems to be challenging to debug the C++ code, called from Python side. So far we found out a quick but dirty solution. Continue reading "QuantLib Python – debugging C++ side with Visual Studio and PyCharm – a dirty way"
I explain how to install QuantLib Python from sources and discuss how to fit a yield curve: PiecewiseLogCubicDiscount and NelsonSiegel.
Continue reading "QuantLib Python – Twisting a Snake to fit a Yieldcurve"
QuantLib is a magnificent library for quantitative finance. But it is also like a gun, heavy enough to shoot your own foot. You might expect that QuantLibXL (a plug-in that provides a subset of QuantLib functionality in Excel) makes your life easier. Unfortunately, it hardly does, as we show in this case study. For an easy and straight way you should better have a look at Deriscope. Continue reading "QuantLibXL – A Curvy Way to fit a Yield Curve"
QuantLibXL (Excel QuantLibAddin) provides a [limited subset of] QuantLib functionality directly in Excel. However, its development follows the development of QuantLib with a lag, e.g. currently the last modified date in project repository is 2017-05-02. I tried to build QuantLibXL with currently latest version of the Visual Studio (success) and to bind it to the latest version of QuantLib (no way).
Continue reading "Building QuantLibXL in Visual Studio 2017"
We have already used QuantLib at letYourMoneyGrow.com several times, in particular to provide a helpful scenario simulator for option traders. QuantLib User Meeting 2017, in which I also took part, provides insights on how to make QuantLib even more accessible for the "mere mortals".
Continue reading "QuantLib for Mere Mortals – Insights from QL User Meeting 2017"
Remarkably, many market players in energy market still cannot calculate the fair value of a gas storage. In particular, many of them rely on perfect foresight. We put online a simple but correct model from QuantLib. Confidence intervals are estimated as well.
NB! This time not for retail investors but for the colleagues from energy industry. Have a look at short introductory video.
Gas Storage is a relatively complex option to evaluate, esp. if there are non-trivial constraints. Remarkably, many energy companies cannot correctly evaluate even the simplest storage contracts. Moreover, they often resort to a so-called perfect foresight: the price paths are considered random but once the price path is known, it is assumed to be known completely (like at the left-hand sketch).
|Prefect foresight (unrealistic)||One-step foresight (realistic)|
Some of QuantLib functionality is ported to R in RQuantLib. In particular the pricing of Barrier options. Unfortunately, only European. But we need American in order to price and simulate future scenarios for the so-called KO-Zertifikate (Knock-Out Warrants), which are quite popular among German retail traders. We show how to quickly adopt the code from QuantLib testsuite, compile it under Linux and integrate with R and web.
Continue reading "Integrating QuantLib with R and Web – Barrier Options Pricer"
Many retail investors are unaware that the option price sometimes depends on the (implied) volatility much stronger than on the price of underlying. They also often underestimate the losses of time value. Our option calculator lets you estimate the future fair price of an option by different pairs of implied volatility and underlying price.
Continue reading "Online Option Calculator – estimate the future value of an option"