## Sunday, 20 June 2010

### Update on recent efforts #4

MC testing on the slope of the repeated median straight line fit is now complete. Normalising the optimal length look back slope of a sine wave by its amplitude ( slope/(max-min)values of sine wave ) gives a ratio. A ratio distribution has a tendency to be heavy tailed (wiki/Ratio_distribution) and as quantiles are "useful measures because they are less susceptible to long-tailed distributions and outliers" I have simply used R to calculate quantiles and determined outliers to be 1.5 * IQR above and below Q3 and Q1.

By using this "new" measure of cyclic tendency the intent/hope is that prices can be said the be trending or going sideways dependent upon whether the normalised slope is outside of, or between, the levels calculated above. This idea, along with the others previously detailed, will be tested on real world data very soon. The details of this testing and a discussion of the rationale of the intended system input will be the subject of my next posting.

## Saturday, 19 June 2010

### Update on recent efforts #3

In my last post I spoke about conducting a Monte Carlo test to determine a maximum and minimum slope value for the repeated median straight line fit, the purpose being to establish levels outside of which it could be said that price is unlikely to be moving sideways according to the modelling of prices as a sine wave. A plot of the first step in this procedure is shown above.

The plot shows the MC test output of the slope of the repeated median straight line fit at various multiples of the period of the sine wave model. At 6 on the x-axis, representing a particular multiple, it can be seen that the standard deviation of the test run output is at a minimum, meaning this is the value that sees the least variation between MC runs, and the mean and median of the output at this point is the expected value of zero. This exact pattern repeats for all periods of interest (10 to 50 inclusive). This result is gratifying in that the actual value of the look back period multiplier seems to make sense theoretically, and the fact that it is the same across all periods means that it is a robust parameter. However, because the standard deviation is not zero, the next MC test will be to determine the normalised upper and lower levels already mentioned, using the optimised look back period multiplier represented above.

## Sunday, 13 June 2010

### Update on recent efforts #2

I have been working on my new idea for the past week or so and I have finally managed to get a compiled .oct function which works, although it is not optimised for speed. Above is a plot of this, which shows two sine waves with their respective repeated median straight line fits. Both sine waves are one complete cycle, have the same period and amplitude, and only differ in their phase. As can be seen the straight line fits display different slopes, so the next thing I'm going to do is a Monte Carlo test to determine upper and lower values for the slopes at different periods, normalised to the amplitudes. The point of this to determine levels of normalised slope above and below which it can be said that price is not likely to be moving sideways. Conceptually, this could be thought of as a switch between trending and non-trending market environments.

## Sunday, 6 June 2010

### Update on recent efforts

In my last post I spoke about a new idea that I want to code. Well, I have been working on this and the coding has turned out to be frustratingly difficult and I am having to rely on the generosity of forum members (Nabble-Octave-General) to help me. However, I'm sure that eventually it will be successfully coded.

What I'm trying to code (as a dynamically loaded C++ Oct file function) is an adaptive, moving window, repeated median, straight line fit, the inspiration for which I got from Meyers Analytics and the system on this site which is called the Robust Repeated Median Velocity System. I don't intend to use this system as such, but I have an intended use for the idea of a statistically robust, straight line fit. More on this in due course.