Monte Carlo Stock Predictor - GBM & OU Comparison

版本 1.4 (4.2 KB) 作者: Benjamin
A Monte Carlo stock prediction code comparing Geometric Brownian Motion and Mean Reversion mathematical models.
9.0 次下载
更新时间 2025/10/27

查看许可证

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.

引用格式

Benjamin (2025). Monte Carlo Stock Predictor - GBM & OU Comparison (https://ww2.mathworks.cn/matlabcentral/fileexchange/181412-monte-carlo-stock-predictor-gbm-ou-comparison), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2025a
兼容任何版本
平台兼容性
Windows macOS Linux
致谢

参考作品: Monte Carlo Stock Price Predictor

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
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