A modern C++ library and GUI application for pricing financial options using various methodologies including Black-Scholes, Monte Carlo simulation, and binomial tree models.
- Multiple pricing models:
- Black-Scholes analytical solution
- Monte Carlo simulation with variance reduction
- Binomial tree model with Richardson extrapolation
- Support for both European and American options
- Complete Greeks calculations (Delta, Gamma, Theta, Vega, Rho)
- Modern, Qt-based graphical interface
- Fast, parallel Monte Carlo simulations
- Confidence interval calculations
- Export capabilities for results
- C++ compiler supporting C++20
- CMake (>= 3.15)
- Qt6
- Google Test (for unit tests)
Using Homebrew:
# Install basic requirements
brew install cmake
brew install qt@6
brew install googletest
# Make sure Qt is linked
brew link qt@6
# Install basic requirements
sudo apt-get update
sudo apt-get install cmake
sudo apt-get install qt6-base-dev
sudo apt-get install libgtest-dev
- Clone the repository:
git clone https://github.com/yourusername/options-pricing-calculator.git
cd options-pricing-calculator
- Create and enter build directory:
mkdir build
cd build
- Configure with CMake:
cmake ..
- Build:
make
After building, you can find the executable in the build directory:
# Run the GUI application
./src/gui/options_pricer_gui
# Run the tests
./tests/options_pricer_tests
- Select option type (Call/Put)
- Choose option style (European/American)
- Select pricing method:
- Black-Scholes (European options only)
- Monte Carlo simulation
- Binomial tree
- Enter parameters:
- Spot price
- Strike price
- Time to expiry
- Risk-free rate
- Volatility
- Dividend yield (if any)
- Configure method-specific settings if applicable
- Click "Calculate" to get results
options_pricer/
├── CMakeLists.txt # Main CMake configuration
├── README.md
├── include/
│ └── pricer/
│ ├── black_scholes.h
│ ├── monte_carlo.h
│ ├── binomial.h
│ ├── option.h
│ └── utils.h
├── src/
│ ├── CMakeLists.txt # Source build configuration
│ ├── black_scholes.cpp
│ ├── monte_carlo.cpp
│ ├── binomial.cpp
│ ├── option.cpp
│ ├── utils.cpp
│ └── gui/
│ ├── CMakeLists.txt # GUI build configuration
│ ├── main_window.h
│ ├── main_window.cpp
│ └── main.cpp
├── tests/
│ ├── CMakeLists.txt # Test build configuration
│ ├── test_main.cpp
│ ├── test_black_scholes.cpp
│ ├── test_monte_carlo.cpp
│ └── test_binomial.cpp
└── examples/
├── CMakeLists.txt # Examples build configuration
└── basic_usage.cpp
For quick calculations and comparison with our implementation, you can use these online calculators:
-
Black-Scholes Calculator: An interactive tool for calculating European option prices and Greeks using the Black-Scholes model. Useful for validating our implementation and quick price checks. Try it here
-
Monte Carlo Options Calculator: Demonstrates the Monte Carlo simulation method for option pricing, allowing you to understand how different numbers of simulations affect pricing accuracy. Try it here
-
Binomial Option Calculator: Interactive tool for pricing options using the binomial tree model, particularly useful for understanding early exercise features of American options. Try it here
-
Implied Volatility Calculator: Helpful tool for calculating implied volatility from market prices, which can be used as input for our pricing models. Try it here
If you're interested in understanding the implementation details or want to compare with other programming languages:
-
C++ Implementation: Detailed guide on implementing Black-Scholes in C++, which forms the basis of our analytical pricing engine. Read more
-
Python Implementation: For those interested in Python implementations, this guide provides a great comparison point and can help in validating our results. Read more
-
R Implementation: Provides another perspective on options pricing implementation, useful for cross-validation and understanding different approaches. Read more
- Options Greeks Derivation: Comprehensive guide explaining the mathematical derivation of option Greeks from the Black-Scholes formula. Essential for understanding our Greeks calculations implementation. Read more
These resources provide valuable reference points for understanding both the theoretical foundations and practical implementations of options pricing. They can be particularly helpful when extending or modifying our implementation, or when validating results against established tools.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Built with Qt6 and modern C++
- Uses Google Test for unit testing
- Special thanks to all contributors