This function performs a Monte Carlo simulation for price movements using C++.
Arguments
- seed_price
numeric. The starting price for the simulation.
- daily_vol
numeric. The daily volatility of the price movements.
- num_sims
integer. The number of simulation paths to generate.
- num_days
integer. The number of days to simulate for each path.
Value
A list containing two data frames:
- simulations
A data frame with columns 'close' (simulated prices) and 'simulation' (simulation index)
- end_prices
A data frame with columns 'close' (final prices) and 'simulation' (simulation index)
Details
This function uses a geometric Brownian motion model to simulate price movements. For each simulation path, it generates daily returns using a normal distribution with mean 0 and standard deviation equal to the provided daily volatility. The function is implemented in C++ for improved performance, especially for large numbers of simulations or long time horizons.