Synthetic Stock Data: how to "correctly" simulate volatility
Now take a look at a chart of the volatility of daily returns for the same rolling periods on a synthetic data series created using GBM and (in the GBM calculations) a fixed, static figure for volatility. Take a look also at the chart of the closing prices from which the volatility was calculated. Neither the volatility chart nor the stock price chart look much like those derived from real prices. Too static, not enough jumps and changes as volatility flows with market conditions.
See below:
randomClosefixedstddev
fixedstddev
The next two charts show volatility and closing prices for another synthetic data series, this time using randomly altered figures for target volatility. Note how both bear a much greater similarity to the volatility charts for real price series shown in the above posts, reflecting day to day â€œnormalityâ€
Synthetic Stock Data: how to "correctly" simulate

 Roundtable Knight
 Posts: 2071
 Joined: Fri Apr 25, 2003 3:33 pm
 Location: London
 Contact:
Synthetic Stock Data: how to "correctly" simulate
 Attachments

 randomClosefixed std dev.PNG (26.62 KiB) Viewed 4685 times

 fixed StdDev.PNG (112.27 KiB) Viewed 4686 times

 randomClose.PNG (36.23 KiB) Viewed 4685 times

 randomStdDev.PNG (80.06 KiB) Viewed 4685 times

 gui.PNG (14.59 KiB) Viewed 4686 times
Re: Synthetic Stock Data: how to "correctly" simul
I'm not sure of the above posts that your referring too.AFJ Garner wrote: Note how both bear a much greater similarity to the volatility charts for real price series shown in the above posts
With that said, your solution does a much better job at capturing the volatility clustering that actually occurs in the market, compared to the static method.
Very nice.

 Roundtable Knight
 Posts: 2071
 Joined: Fri Apr 25, 2003 3:33 pm
 Location: London
 Contact:
Sorry for the confusion (the result of clumsy copy and pasting). The "other" post can be seen here: http://tradersplace.net/forum/thread/15 ... smarkets/
It gives some charts of rolling period volatility on various real data series.
It gives some charts of rolling period volatility on various real data series.

 Roundtable Knight
 Posts: 2071
 Joined: Fri Apr 25, 2003 3:33 pm
 Location: London
 Contact:
Below you will find a screenshot of the latest version of my random data generator. At some stage I will explain the GUI in greater detail  but it is probably pretty obvious. I have randomised pretty well every element except for â€œdriftâ€
 Attachments

 generator11Jul13.PNG (20.96 KiB) Viewed 4603 times

 ASCII File No 4.PNG (33.32 KiB) Viewed 4603 times

 4.xls
 (1.86 MiB) Downloaded 302 times

 1000Tests.xls
 (141.5 KiB) Downloaded 255 times

 Roundtable Knight
 Posts: 199
 Joined: Sun Oct 10, 2010 1:47 am
 Location: Melbourne Australia
[quote="AFJ Garner"]Below you will find a screenshot of the latest version of my random data generator.
...
What does that mean in practical terms? It means that with an assumption of zero drift, you can expect the price series to be mean reverting in the long term.
...
The trends are of course meaningless and unpredictable: but that does NOT mean they are â€œunfollowableâ€
...
What does that mean in practical terms? It means that with an assumption of zero drift, you can expect the price series to be mean reverting in the long term.
...
The trends are of course meaningless and unpredictable: but that does NOT mean they are â€œunfollowableâ€

 Roundtable Knight
 Posts: 2071
 Joined: Fri Apr 25, 2003 3:33 pm
 Location: London
 Contact:
Timstopsareforwimps wrote:
Anthony as I understand it random fluctuations (eg coin flips) do not mean revert. The expected average *absolute* deviation from zero is proportional to the square root of the time. This, even though the expected value at any time is 0.
Actually they do revert in that you can show that the value passes through zero an infinite number of times eventually. But in between the diverge further and further away.
From memory Einstein showed this in the context of Brownian motion.
On the second point I cannot fathom how trends that are unpredictable and meaningless can be followed (profitably). Can you give us some hints as to how this can be?
Tim
I believe I am right in saying that the distribution of outcomes in a coin flip is uniform whereas with geometric Brownian motion it is normal? I am using the latter but of course both "mean revert" in the sense I used the term. They cross and recross the starting point. Again, both distributions are symmetrical.
If you take a big enough collection of data series calculated in such a way, the mean reversion and symmetrical distribution become more immediately apparent and obvious: on a buy and hold basis they will sum up to a return of zero (however long an individual series may take to revert to its starting point).
Since trend following is about "following" and not prediction, it seems to me that the lack of predictability does not matter. The apparent "trends" in random data are meaningless in that they are not caused by any agency other than computer code and random chance: in real markets you may be able to ascribe a "meaning" to the trend: scarcity of oil in an environment of rising Crude price for instance. But an algorithm does not care what causes a "trend" (meaningless or otherwise): it can still follow it while it lasts.
Using pure geometric Brownian motion to create many thousands of price series, I find that any sort of trend following is a zero sum game before costs. However it is interesting to note that the win loss ratio is remarkably similar to that that typically applies on profitable trading of real markets: around 30% of trades are profitable. Although of course you can play around with different systems and get the win loss ratio far higher if you so choose. So, it IS possible to follow "trends" in random data created by GBM. The difference is that such trends are not strong, frequent or long enough for the 30% winners to outweigh the 70% of losers in terms of profitability.
But, is data any less "random" if we introduce random drift? I think probably not. If positive or negative drift lasts for long enough in a single direction at any one time suddenly, BINGO, it becomes possible to trade profitably using a trend following algorithm on random data. Drift elongates and strengthens trends.
Why does any of this matter to real trading and the real world? Well, the huge benefit for me has been to appreciate very much more clearly what market conditions are necessary for TF to work. Will it make me any more profitable? No but it has made me a great deal more comfortable with what I am doing.
If there are frequent and strong enough real world trends I will profit; if not I won't.
The creation of random, synthetic data is a very useful playground.