# Monte Carlo Option Pricing Simulator: GBM paths next to the Black-Scholes price

> Two Python files simulate Geometric Brownian Motion paths, price a European call and put by Monte Carlo, and set the result beside the Black-Scholes value in an animated dark theme plot. None of the four inputs is configurable from the command line.

**tubakhxn/Monte-Carlo-Option-Pricing-Simulator** — Monte-Carlo-Option-Pricing-Simulator

- Repository: https://github.com/tubakhxn/Monte-Carlo-Option-Pricing-Simulator
- Stars: 101 · Forks: 21
- Language: Python
- License: MIT
- Published: 2026-08-17 · Updated: 2026-08-18 · Language: en
- Canonical page: https://hysenlabs.com/projects/tubakhxn-monte-carlo-option-pricing-simulator

## Two Python files hold the simulator, and a __pycache__ sits beside them

The whole simulator is two Python files at the repository root. `main.py` is the entry point and, by the project's own account, handles the simulation, the visualization and the comparison in one place. `utils.py` holds the Geometric Brownian Motion simulation and the pricing functions that `main.py` calls. Alongside them sit `requirements.txt` for the dependencies, `README.md` for the documentation and formulas, and a `LICENSE` file. There is no package directory, no test suite and no configuration file in the tree, and a committed `__pycache__` directory sits at the root, which is compiled bytecode from an earlier local run rather than anything the program needs at startup. The code you read to judge the pricing is short, and there is no build step between the clone and the plot.

## Strike, volatility, risk-free rate and maturity are the whole input surface

Four parameters are named under the Parameters heading: strike price, volatility, risk-free rate and time to maturity. One more line says all of them are labeled and visualized in the plot. Nowhere is there a way to set them. The usage section is only `pip install -r requirements.txt` followed by `python main.py`, with no command-line flag, no default value for any of the four, and no mention of how many price paths are simulated or how many time steps a single path is broken into. Those two numbers decide how close the simulated price lands on the analytical one, and neither appears in the documentation. To change an input you have to open `main.py` or `utils.py` and read where the value is put.

## Volatility enters the GBM exponent twice, and no dividend yield enters at all

The paths come from Geometric Brownian Motion, written as S_t = S_0 exp((r - 0.5 sigma^2) t + sigma W_t), with S_t the stock price at time t, S_0 the initial stock price, r the risk-free rate, sigma the volatility and W_t a Wiener process. Two things follow from the shape of that exponent. Volatility shows up twice, once in the drift correction term and once as the scaling factor on the random term, so moving sigma moves both parts at once. And of the four inputs you can set, r and sigma drive the simulated path, while the strike K and the maturity t appear only in the pricing formulas, as the strike itself and as the exponent in the discount term. No dividend yield appears anywhere in that path equation.

## The benchmark is the Black-Scholes closed form, not a second engine

The number the simulation is measured against is the analytical formula, not another simulation. The call price is written as C = S_0 N(d_1) - K e^(-rt) N(d_2) and the put price as P = K e^(-rt) N(-d_2) - S_0 N(-d_1), with d_1 = (ln(S_0/K) + (r + 0.5 sigma^2) t) / (sigma sqrt(t)) and d_2 = d_1 - sigma sqrt(t), where N is the cumulative distribution function of the standard normal distribution, K is the strike and t is the time to maturity. Holding both sides in one run is the point of the project: the simulated price and the analytical price for the same four inputs appear at once, and each of them is labeled in the plot. The documentation never states the tolerance between them, nor any error figure, so a gap you see in the window is something you judge yourself.

## pip install -r requirements.txt pulls four packages with no version pins

Installation is one command, and the dependency list is four names:

```bash
pip install -r requirements.txt
```

The file itself is unpinned, one package per line:

```text
numpy
pandas
matplotlib
scipy
```

Starting the simulator is the second command:

```bash
python main.py
```

No version number is attached to any of the four packages, and no Python version is asked for, so the interpreter and the library versions come from whatever your environment already holds. Two entries deserve a note. pandas is listed, and the project describes paths, prices and animated plots without ever mentioning a table or a data frame, so the role of pandas is not stated. scipy is listed, and the analytical side needs the standard normal cumulative distribution function N, but the text does not say which call computes it. Both questions are answered by reading the import lines in `utils.py`.

## The animated plot is the only interface, and nothing is written to disk

The interface is the plot. The feature list promises animated stock price paths and option prices in a clean, professional dark theme, and the Parameters section says every parameter is labeled and visualized there, so the window doubles as the readout for the four inputs. There is no web page, no endpoint and no command-line option in the tree, and no output file is named, so nothing here writes a price that a spreadsheet or a backtest could pick up. There is also no documented switch to turn the animation off or to run without a display; `python main.py` is the entire entry surface. That shape suits watching a simulated path settle onto the analytical value, and it does not suit a pipeline.

## European exercise only, which the formulas make plain

The contract is a European call and a European put, and the opening paragraph says so. That limit shows in the mathematics rather than in a setting. Neither the path equation nor either pricing formula carries a dividend yield term, and dividend yield is not among the four parameters you can set, so a paying stock sits outside what these equations express. The same narrowness appears on the exercise side: no early exercise, no American contract and no second numerical method are named anywhere, so one exercise style is all the tree offers. The stated audience is finance, education and research, which fits a script whose first output is a moving picture and whose second output is a number.

## No releases, and the last push to main is February 11, 2026

Two facts about the repository's own history matter before you build on it. There is no GitHub release, so there is no tagged version to install and nothing recording which library versions the code last ran against. The last push to the main branch is dated February 11, 2026, and the repository is not archived. Because `requirements.txt` pins nothing, that combination leaves your run using whatever numpy, pandas, matplotlib and scipy your resolver selects on the day you install them, which is the practical reason to read the imports before you trust a figure. Licensing is the simple part: MIT, stated in the project text and in the `LICENSE` file at the root, with no separate terms attached to it.

## Conclusion

Use this repository when you want a short, readable script that prices a European call and put by simulation and shows the analytical value next to it, and you are willing to open the source to change the four inputs. Skip it for American-style contracts, for calibration work, or for anything that needs numbers written to disk. Before you trust an output, check which numpy and scipy versions your environment resolves, since requirements.txt pins nothing, and work out for yourself how many paths and time steps the simulation uses, because the README names neither.

## FAQ

### Can Monte Carlo simulation be used to price options?

Yes, and this repository does it for European calls and puts. It simulates stock price paths with Geometric Brownian Motion, prices the option by Monte Carlo, and compares that figure with the Black-Scholes analytical price in the same run.

### Is there a free Monte Carlo simulation?

The repository is MIT licensed and runs on your own machine, so there is no service to sign up for. You install four packages listed in requirements.txt, numpy, pandas, matplotlib and scipy, and start it with python main.py.

### What inputs does Monte-Carlo-Option-Pricing-Simulator actually expose?

Four: strike price, volatility, risk-free rate and time to maturity, and all four are labeled in the plot. No defaults, no command-line flags and no configuration file are given, and the number of simulated paths and time steps is not stated either.

### How does the tubakhxn simulator line its price up against Black-Scholes?

main.py handles the simulation, the visualization and the comparison, while the Geometric Brownian Motion and pricing functions live in utils.py. The analytical side uses d_1 and d_2 with the standard normal cumulative distribution function N, and no tolerance between the two prices is documented.

## Sources

- [Official README](https://github.com/tubakhxn/Monte-Carlo-Option-Pricing-Simulator#readme)
- [Project repository](https://github.com/tubakhxn/Monte-Carlo-Option-Pricing-Simulator)
- [README](https://github.com/tubakhxn/Monte-Carlo-Option-Pricing-Simulator/blob/main/README.md)
- [Releases](https://github.com/tubakhxn/Monte-Carlo-Option-Pricing-Simulator/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/tubakhxn-monte-carlo-option-pricing-simulator
