Book Image

Advanced Quantitative Finance with C++

By : Alonso Peña, Ph.D.
Book Image

Advanced Quantitative Finance with C++

By: Alonso Peña, Ph.D.

Overview of this book

<p>This book will introduce you to the key mathematical models used to price financial derivatives, as well as the implementation of main numerical models used to solve them. In particular, equity, currency, interest rates, and credit derivatives are discussed. In the first part of the book, the main mathematical models used in the world of financial derivatives are discussed. Next, the numerical methods used to solve the mathematical models are presented. Finally, both the mathematical models and the numerical methods are used to solve some concrete problems in equity, forex, interest rate, and credit derivatives.</p> <p>The models used include the Black-Scholes and Garman-Kohlhagen models, the LIBOR market model, structural and intensity credit models. The numerical methods described are Monte Carlo simulation (for single and multiple assets), Binomial Trees, and Finite Difference Methods. You will find implementation of concrete problems including European Call, Equity Basket, Currency European Call, FX Barrier Option, Interest Rate Swap, Bankruptcy, and Credit Default Swap in C++.</p>
Table of Contents (17 chapters)
Advanced Quantitative Finance with C++
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

Advanced example – equity basket


In this second, more advanced example, we will illustrate the implementation of the pricing of an equity basket option, with the payoff being the largest between two asset values at maturity. The details of the approach are shown in the following Bento Box template:

Bento Box template for advanced example: equity basket

Our aim is to compute the option premium as before.

The details of the contract are in Box 1, particularly the payoff function is as follows:

Note that this being a basket option with two assets, we will now need two GBM processes to describe the evolution of the underlying. This is reflected in STEP 3 that has been updated in the algorithm in box 4. We can then use the same MC numerical method to compute the expectation of the payoffs.

The C++ implementation of this algorithm can be found in code snippet 4. There are only two slight differences with Code 1: first, regarding the input parameters (STEP 1) and second regarding the calculation of...