InvestorsHub Logo
Followers 3
Posts 124
Boards Moderated 0
Alias Born 07/04/2002

Re: Rien post# 3767

Monday, 07/08/2002 12:58:38 PM

Monday, July 08, 2002 12:58:38 PM

Post# of 47343
Hi Rien - re your Java program

Yes, artificial stocks are one component. This "mean reversion" stuff relates to that - it's a tendency of the stock prices to revert to an underlying trend.

I am currently writing a java application to do this kind of testing. ... I am using this application as a learning example. That's a great idea. Although I don't program in Java, I've done lots of programming and learned lots of new languages and programming environments. IMO the best way to learn is to pick a project and try to do it. It helps immensely to work on something that you have a personal interest in.

Re your artificial stocks, you can think of the stock price as separable into the underlying trend (offset and slope) plus some price fluctuations. I'm skeptical of the sinusoid idea, since it presumes in advance that the stock price will fluctuate in some predetermined way.

I'd start off with a simpler experiment; just some constant value plus fluctuations. You can generate random numbers using the built-in function rand() in C or C++; something simliar must exist in Java. The random numbers range from 0 to 1, and then you map them onto a normal (gaussian) distribution. The larger you make the std deviation, the more the numbers will fluctuate around the mean (here the offset). I think there's an example in "Numerical Recipes" or I can post a scrap of code if you are interested.

Then I'd add a trend, and maybe autocorrelation. You could also add some cyclic character, but I'm not sure how to justify it or how to generate it without adding a lot of bias to the result.

I think it's important to add a stochastic component from the beginning, before you start adding some more complicated deterministic parts. Unpredictability is central to the problem.

Hope that's helpful - best regards Tim

Join InvestorsHub

Join the InvestorsHub Community

Register for free to join our community of investors and share your ideas. You will also get access to streaming quotes, interactive charts, trades, portfolio, live options flow and more tools.