I'm forecasting a stock price 'St1' starting at 'Stt = 10' at time t. Dates are not important. I want to find the next 100 prices using the following formula:
St1 <- Stt*exp((r-0.5*sigma^2)*T/n+sigma*E*sqrt(T/n))
So I'm starting with 10 and then need the next 100 values and put it in a data.frame or whatever is easy. How do I do this? I'm stuck trying this...
Stt = 10
r = 0.15
sigma = 0.2
T = 1
n = 100
E = 0.15
St1 = Stt
for (i in 1:100)
{
St1[i] <- Stt*exp((r-0.5*sigma^2)*T/n+sigma*E*sqrt(T/n))
}