[datatable-help] Random Walk - stock price

xam max-gloeckner at web.de
Sun Nov 26 02:35:27 CET 2017


Hello everybody,

first of all I am a beginner in r. At the moment I' m trying to figure out a
solution for my r problem.
I want to create a random walk code for a stock price. That is my current
status:

days=250

plot(rnorm(250),type="l",xlab="days",ylab="stock price",main="stock price
XY")  

plus for example mean() and sd()  (based on historical data)

plot(rnorm(250,mean(),sd()),type="l",xlab="days",ylab="stock
price",main="stock price XY")  

Problem: The random walk simulation starts with 0. The stock price is for
example 100 and i want to start a random walk simulation from this price.
How can I do that? Thx. 



--
Sent from: http://r.789695.n4.nabble.com/datatable-help-f2315188.html


More information about the datatable-help mailing list