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)
Where:
- 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!
Answer
GBM is defined as St=St−1exp((μ−σ22)dt+σdWt)
So, in your notation, assuming your daily parameters:
Snew=Sprevious⋅exp((drift−volatility22)days+volatility√daysN(0,1))
So your formula was incorrect. The youtube you quote is only true for 1-year timesteps (while you have days steps).
No comments:
Post a Comment