This project implements a Monte Carlo simulation-based engine for pricing vanilla and exotic options using the Geometric Brownian Motion (GBM) model. The library is designed for educational purposes and showcases the implementation of parallelization with OpenMP to speed up Monte Carlo simulations.
This C++ project implements a Monte Carlo-based engine for pricing financial derivatives, specifically European and Asian options, using the Geometric Brownian Motion (GBM) model. The project incorporates parallelization using OpenMP to speed up Monte Carlo simulations, improving performance when simulating large numbers of paths.
A Monte Carlo simulation is a way to model the probability of different outcomes in a process that cannot easily be predicted due to the intervention of random variables. It is a technique used to understand the impact of risk and uncertainty. A Monte Carlo simulation takes the variable that has uncertainty and assigns it a random value. The model is then run, and a result is provided. This process is repeated again and again while assigning many different values to the variable in question. Once the simulation is complete, the results are averaged to arrive at an estimate.
The library can be used to price:
- European Call/Put options
- Arithmetic Asian Call/Put options
- Monte Carlo Simulation: Pricing of European and Asian options using Monte Carlo methods.
- Geometric Brownian Motion (GBM): Utilizes the GBM model to simulate the underlying asset price.
- Parallelization with OpenMP: Uses OpenMP to parallelize Monte Carlo simulations, speeding up the process.
- Modular Design: The code is modular and allows for easy extension to include more complex option pricing methods.
- C++17: The code is written in C++17.
- OpenMP: For parallelizing the Monte Carlo simulations.
- CMake: To manage the build process.
Ensure you have the following tools installed:
- C++ Compiler (e.g., GCC or Clang)
- CMake (Version 3.10 or above)
- OpenMP (Can be installed via Homebrew on macOS:
brew install libomp)
-
Clone the repository:
git clone https://github.com/pratycodes/Simulated-Option-Pricer cd MonteCarloLibrary -
Create a
builddirectory:mkdir build cd build -
Run
cmaketo configure the project:cmake ..
-
Build the project using
make:make
After building the project, you can run the tests (e.g., for European or Asian options pricing):
./TestOptionPricingThis will execute the Monte Carlo simulation for pricing European options and output the results.
Contributions are welcome! Feel free to fork the repository, make changes, and submit pull requests. Please make sure to adhere to the following guidelines:
- Write clear, descriptive commit messages.
- Ensure all tests pass before submitting a pull request.
- Follow the project's coding style and conventions.
This project is licensed under the MIT License - see the LICENSE file for details.