Value at risk engine3/26/2023 ![]() Examples of such derived classes are various equity derivatives, Bonds and IRS, and FX forwards. These are the pure virtual classes: SimulationEngine, ValuationFunction and MCStatistics.Īn object of the class ValuationFunction serves the purpose of representing one position in the portfolio, it has members such as nominal and uniqueIdentifier that describe the position with instrument specific attributes such as the spot value of an underlying risk factor or the implied volatility of an instrument being members of the relevant derived classes. The system comprises the core MCEngine class where the Monte Carlo simulation takes place along with 3 key base classes that together make up the structure of the program. Structure and components of the programĪttached in the repository is a class diagram of the program showing the structure of the system. One could even straightforwardly extend the program by adding additional stochastic processes for the path simulations of the risk factors such as adding a jump diffusion processes or allowing for stochastic volatility. ![]() This has resulted in a code base that can be seamlessly extended in a logical way to handle additional functionality such as support for additional instrument types and calculations of different statistics (VaR itself being one statistic). The program as such readily makes use of design patterns to produce reusable and extensible code following the open/closed principle of object-oriented programming. The knowledge base drawn upon when implementing the financial models in C++ primarily comes from the book C++ Design Patterns and Derivatives Pricing by Mark Joshi. The task was undertaken with the motivation of solidifying my knowledge of the fundamentals of risk and valuations calculations and teaching myself proper usage of C++ as a tool for implementing sound financial engineering solutions with object-oriented programming. The program was written in my spare time immediately following graduating with a Master’s degree in Financial Mathematics while at the same time working full time as a quantitative analyst at an investment bank. ![]() This program is the culmination of two months of work to create a fully functional and comprehensive Monte Carlo value-at-risk engine for calculating the risk of a financial portfolio, on a total portfolio level as well as on an individual instrument level. C++ Monte Carlo Value at Risk Engine Background and overview
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |