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标签
致谢
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!