Tag: QuantLib

General Residual Income Model for Equity Valuation

General Residual Income Model for Equity Valuation

The Residual Income Model is one of the equity valuation methods covered in the CFA Level 2 curriculum. This method estimates the intrinsic value of a stock based on the stock's current book value, plus the present value of expected future residual income. Residual income represents the income generated by the company in excess of … Continue reading General Residual Income Model for Equity Valuation

Setup QuantLib C++ Dev Environment with VS Code on Linux

Setup QuantLib C++ Dev Environment with VS Code on Linux

Since I really don't want to go back to Windows, the bulky, messy headache, I decided to set up my QuantLib C++ development environment on Ubuntu. It took a few extra steps compared to setting up Visual Studio on Windows, so I’m sharing the process in this blog post in case it helps anyone. Step … Continue reading Setup QuantLib C++ Dev Environment with VS Code on Linux

Pricing Credit Default Swap with QuantLib

Pricing Credit Default Swap with QuantLib

In the previous blog, I manually crafted the Python code for pricing CDS without relying on third-party quant libraries. While this approach was useful for understanding the underlying algorithm, in practice, it's preferable to use a mature, validated library for standardisation when available. In this blog post, I will revisit the CDS pricing exercise using … Continue reading Pricing Credit Default Swap with QuantLib

Pricing Capped and Floored Floating-Rate Bonds with QuantLib

Pricing Capped and Floored Floating-Rate Bonds with QuantLib

The concept of "capped and floored floating-rate bonds" is covered in Section 9, Module 3 of the CFA Fixed Income curriculum. Compared to fixed-rate bonds, floating-rate bonds have distinct features that make their valuation and pricing more complex. In this blog post, I will begin by discussing the key features of floating-rate bonds and then … Continue reading Pricing Capped and Floored Floating-Rate Bonds with QuantLib

Pricing Callable and Putable Bonds with QuantLib

Pricing Callable and Putable Bonds with QuantLib

The valuation and analysis of bonds with embedded options is the most focused topic discussed in the CFA Level 2 Fixed Income curriculum. These types of bonds, such as callable and puttable bonds, introduce an additional layer of complexity due to the optionality features embedded within the instrument. In this blog post, I will discuss … Continue reading Pricing Callable and Putable Bonds with QuantLib

Simulating Future Interest Rates Path

Simulating Future Interest Rates Path

The interest rate term structure models are discussed in the CFA curriculum, Fixed Income, Module 2, Section 8. This section focuses on understanding how interest rates evolve over time, with models used to explain and predict the term structure of interest rates. Modeling the future path of interest rates is critical for a wide range … Continue reading Simulating Future Interest Rates Path

Calculate Z-Spread with QuantLib

Calculate Z-Spread with QuantLib

The Z-spread is an important metric for analysing the yield premium on a bond. It measures the constant spread over the benchmark yield curve, typically a risk-free curve, representing the additional credit or liquidity risks associated with the bond. Key features of Z-spread Risk-free benchmark - the Z-spread is measured with a risk-free curve as … Continue reading Calculate Z-Spread with QuantLib

Riding the Yield Curve with QuantLib

Riding the Yield Curve with QuantLib

"Riding the Yield Curve" is the topic covered in the CFA Fixed Income, Module 1, Section 3, "Active Bond Portfolio Management". In this blog post, I will simulate the approach discussed in the CFA curriculum with the support of the QuantLib library. "Riding the Yield Curve", also known as "Rolling Down the Yield Curve", is … Continue reading Riding the Yield Curve with QuantLib

Curve Fitting with QuantLib

Curve Fitting with QuantLib

In the previous blog post, I implemented the bootstrapping spot curve in both Python and DolphinDB. However, to boost productivity and improve reusability, it's more efficient to leverage an established quantitative library. QuantLib is a widely-used open-source library for fixed income and derivatives pricing, offering a variety of curve fitting methods and built-in bootstrapping functionality. … Continue reading Curve Fitting with QuantLib