Monte Carlo Stock Predictor - GBM & OU Comparison

Version 1.4 (4,19 ko) par Benjamin
A Monte Carlo stock prediction code comparing Geometric Brownian Motion and Mean Reversion mathematical models.
8 téléchargements
Mise à jour 27 oct. 2025

Afficher la licence

This is a fun, interesting introduction to quantitative finance using two commonly used mathematical models following stochastic price movements.
The example provided used one year of data from bitcoin found on MarketWatch. Only csv files can be imported into the script and used to extract the relevant data.
Choosing between a crypocurrency/currency or a stock determines the number of days of change in a given year. Then you can choose how long you wish the projection to be for in years. Finally, enter the number of simulations. A reasonable and fast number will be anything from 1000 - 10000.
As a check that the data imported is compatible to work with, the most common gap in days between entries under Initial Computations must be "1".
The simulation returns the Geometric Brownian Motion (GBM) and Mean Reversion (OU) summary, yielding a mean final price, probility of increase, decrease, and, maximum and minimum predicted prices. These are then compiled and compared yielding a final probability of increase or decrease.
As a check of accuracy, if both GBM and OU agree, the Position to Open yields a "conclusive result".
However, THIS IS NOT FINANCIAL ADVICE AND SHOULD NOT BE USED.
See the example below using bitcoin.

Citation pour cette source

Benjamin (2025). Monte Carlo Stock Predictor - GBM & OU Comparison (https://fr.mathworks.com/matlabcentral/fileexchange/181412-monte-carlo-stock-predictor-gbm-ou-comparison), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R2025a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Remerciements

Inspiré par : Monte Carlo Stock Price Predictor

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.4

- Improved volatility predictions for OU model
- Fixed bugs

1.3

*larger data can be inputted

1.2

*Able to input more than a year data now

1.0.0