Tag: Quantitative Finance

Triangular Arbitrage in Forex Trading

Triangular Arbitrage in Forex Trading

Triangular arbitrage is a strategy used to exploit inefficiencies in the currency markets by executing a series of trades across three currencies in different markets. Let’s assume we now observe the following quotes for currency pairs from the interbank market and dealers. We want to analyse whether there is any arbitrage opportunity. Interbank Market Quotes … Continue reading Triangular Arbitrage in Forex Trading

Performance Attribution with Brinson Model in DolphinDB and Python

Performance Attribution with Brinson Model in DolphinDB and Python

Performance attribution is discussed in the CFA Portfolio Management curriculum, specifically in Module 2, Section 2: "Active Management and Value Added". Performance attribution is a process used to decompose the "value added," i.e., the excess return relative to a benchmark, into different sources. In the CFA curriculum, a simplified Brinson model is presented, which discusses the basic calculations of … Continue reading Performance Attribution with Brinson Model in DolphinDB and Python

The Monte Carlo Method of VaR Estimation

The Monte Carlo Method of VaR Estimation

In the previous blog post, we explored the Parametric Method for estimating Value at Risk (VaR). While the parametric method offers the advantage of optimal computational efficiency, it relies on strict assumptions, particularly that returns follow a specific distribution (e.g., normal distribution). For complex portfolios, nonlinear instruments, and scenarios where flexibility and precision are critical, the parametric method may not be suitable. In such … Continue reading The Monte Carlo Method of VaR Estimation

The Parametric Method of VaR Estimation

The Parametric Method of VaR Estimation

In the previous blog post, we explored the Historical Method of VaR Estimation. The historical method is simple and intuitive; however, it relies on the assumption that financial markets will repeat historical patterns, disregarding structural changes in market conditions. This limitation makes the historical method less practical in real-world scenarios. In this blog post, I will … Continue reading The Parametric Method of VaR Estimation

VaR Overview and the Historical Method

VaR Overview and the Historical Method

Value at Risk (VaR) is arguably the most widely used metric for risk management. It quantifies the potential loss in the value of a portfolio over a certain period. In this blog post, I will first provide an overview of VaR, clarifying its definition and discussing its advantages and disadvantages. Then, I will implement Python code … Continue reading VaR Overview and the Historical Method

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 Credit Default Swaps

Pricing Credit Default Swaps

Some Basics of Credit Default Swap (CDS) A Credit Default Swap is a credit derivative instrument that functions as a form of insurance, where one party pays a series of premiums to another party in exchange for protection against the risk of default by the issuer of the underlying debt. Parties Involved: Protection Buyer - Owns … Continue reading Pricing Credit Default Swaps

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

Effect of Interest Rate and Volatility

Effect of Interest Rate and Volatility

In CFA Fixed Income curriculum, module 3, section 3, "Effect of Interest Rate Volatility", the impact of interest rate volatility on the value of callable and putable bonds is explored. In this blog post, I will replicate the examples from the CFA curriculum using Python code, leveraging the QuantLib library for bond valuations, including: Effect … Continue reading Effect of Interest Rate and Volatility