I am writing a program that creates realizations of a GBM.
Starting from an initial price, I get the following price with this formula:
NewPrice = PreviousPrice * Exp(Volatility * N10 * Sqrt(DaysElapsed) + Drift * DaysElapsed)
- Volatility is the annual percentage volatility / 100 / sqrt(250)
- Drift the annual percentage Drift / 100 / 250
- N01 is a standard normal realization
- DaysElapsed are the days elapsed from previous price (this is a small fraction in my case)
I am not sure that I am doing this right. Is the above line correct ? Please, suggest the right code expression or other possible corrections. Thank you!