To use this project, ensure you have a C++ compiler installed on your machine. The project relies on standard libraries and does not require additional dependencies. Follow these steps to set up the project:
- Clone the repository:
git clone https://github.com/dkp116/PathDependant-Options-Binomial-Model.git
- Navigate into the project directory and compile the source code:
cd PathDependant-Options-Binomial-Model make - Run the executable:
./Main01
The code includes two pricing algorithms for arithmetic Asian options:
- CRR (Cox-Ross-Rubinstein) Method: A binomial tree model.
- Monte Carlo Simulation: A statistical approach.
To price an Arithmetic Asian Call option, use the following code:
BinModel Model;
if (Model.GetInputData() == 1) return 1;
BinLatticeDep<double> Tester1;
ArthAsianCall Opt; // Create an instance of the Arithmetic Asian Call option
Opt.GetInput(); // Input stock price, up/down factors, and risk-free rate
Opt.PriceByCRR(Tester1, Model); // Price using CRR method
Opt.PriceByMC(Model, 1000); // Price using Monte Carlo SimulationTo price a Lookback option, simply switch to the LookBack class:
BinModel Model;
if (Model.GetInputData() == 1) return 1;
BinLatticeDep<double> Tester1;
LookBack Opt; // Create an instance of the Lookback option
Opt.GetInput(); // Input stock price, up/down factors, and risk-free rate
Opt.PriceByCRR(Tester1, Model); // Price using CRR method
Opt.PriceByMC(Model, 1000); // Price using Monte Carlo SimulationThis project is licensed under the MIT License. See the LICENSE file for more details.