An open API service indexing awesome lists of open source software.

https://github.com/lexiestleszek/montestocks

Monte Carlo simulation for stocks
https://github.com/lexiestleszek/montestocks

Last synced: 3 months ago
JSON representation

Monte Carlo simulation for stocks

Awesome Lists containing this project

README

        

# montestocks
## Fetch Historical Data:
The function first retrieves the stock's historical data using yfinance. It extracts the closing prices.
## Calculate Log Returns:
Log returns are calculated from the historical closing prices. These are used as the basis for the Monte Carlo simulation.
## Monte Carlo Simulation:
The simulation generates random returns for the next days based on the historical log returns. It then calculates the potential prices for each day, assuming the stock price follows a geometric Brownian motion (a common thing in financial modeling).
## Price Prediction:
The function returns the minimum, maximum, mean, and median potential prices for the future days. These values give a range of possible outcomes for the stock price.