Market Maker is an Options Market Maker program that simulates the behavior of a market maker in the financial options market. The program uses the Black-Scholes option pricing model, random price generation, and includes AI-based volatility prediction using LSTM neural networks. It also includes pricing for natural gas and oil.
- Option Market Making: The program acts as a market maker for options, handling buy and sell orders.
- Black-Scholes Model: The program uses the Black-Scholes option pricing model to calculate option prices based on the current market conditions.
- Random Price Generation: The program generates random price changes based on the given volatility.
- Volatility Prediction: The program includes an AI-based volatility prediction model trained using LSTM neural networks to forecast future volatility.
- P&L Calculation: The program tracks profit and loss (P&L) for both options and futures.
- Pricing for Natural Gas and Oil: The program provides pricing for natural gas and oil based on random price changes and volatility.
- C++ Standard Library
- Ensure you have a C++ compiler installed.
- Compile the code using the compiler with C++11 support. For example:
g++ maker.cpp -std=c++11 -o market-maker
- Run the executable.
./market-maker
maker.cpp
: The main source file containing the options market maker program.
The program acts as a market maker for options. It generates bid and ask prices for a list of predefined options based on the current market conditions. The bid and ask prices are calculated using the Black-Scholes option pricing model, taking into account the current price of the underlying asset, strike price, time to expiry, risk-free rate, and volatility. The program handles both buy and sell orders for options and tracks the profit and loss (P&L) based on executed trades.
To simulate market conditions, the program generates random price changes for the underlying asset based on the given volatility. The random price changes are generated using a normal distribution with the mean of zero and the specified volatility.
The program includes an AI-based volatility prediction model trained using LSTM neural networks. The model is trained on historical volatility data to forecast future volatility. During the simulation, the program uses the predicted volatility to generate more accurate option prices and market conditions.
The program provides pricing for natural gas and oil based on random price changes and volatility. It generates random price changes for natural gas and oil using a normal distribution with the mean and volatility specified for each asset.