PureBytes Links
Trading Reference Links
|
>From a math point a view, if the slope(m) of the linear regression through
the close of the spread values approaches zero then it would be reverting.
However this would only be true it the market maintained a constant cycle
and the number of data points for the regression were equal to the cycle
and the end point was back to the mean.
I.E. a simple regression line will not work unless you ass-u-me the correct
cycle.
Using std deviations will tell you the range but for it to be symmetrical
about the axis or mean the data would have to posses a constant cycle.
Why not look to the past and make your life easy. As all good engineers do.
Here is one quick possible solution.
1. Calculate a moving average of the spread as your mean.
2. Calculate the last 2 swing hi and swing low points for the data and
determine how long ago they were.
3. Check to make sure that these 2 points were on opposite sides of the
mean at the same time period.
If this condition is fulfilled then you know that it has reverted at least
three times in the past.
example data
data points 10,9,8,7,6,5, 6,7,8,9,10,9,8,7,6,5,6,7
3 day ma 9,8,7,6,5.6,6,7,8,9,9.3,9,8,7,6,5.6,6
mean=7.4
First swing hi=10 occurred 17 bars ago and mov avg=not known
Second swing hi=10 occurred 7 bars ago and mov avg=9.3
First swing low=5 occurred 12 bars ago and mov avg=5.6
Second swing low=10 occurred 5 bars ago mov avg=5.6
Plus they were all on opposite sides of the longer period mean
Test checks out all swing points were opposite the moving avg.
If you use TS or metastock and code this up please email me a copy.
I would write the code but am a bit busy.
Email me with any ?s
Mike Clark
clarkmj@xxxxxxxxxx
-----Original Message-----
From: Kozo Morimoto <K.Morimoto@xxxxxxxxx>
To: RealTraders Discussion Group <realtraders@xxxxxxxxxxxxxx>
Date: Wednesday, June 24, 1998 8:56 AM
Subject: ALGO: Mean Reverting time series
I am data mining/number crunching thru a lot of spreads and I would like
to minimize the amount of charts that I would end up looking at. I am
comfortable with spreads that oscillate around a mean, which is flat -
thus mean reverting. Is there a nice way to tell programatically whether
if a time series is mean reverting or not? I was thinking of running
linear regression and rank the spreads according to the slope (flatter the
better), error with respect to calculated slope (even if it has a nice
flat slope does not mean that it oscillates around it) and standard
deviation (to see how spread apart the deviation is). This seems a very
convoluted and processor intensive way to me and wanted to know if there
is a simpler way of doing this.
Any suggestions are welcome at: kozo.morimoto@xxxxxxxxxxxxxxxxxxxxx
|