Quote from dtl:
Thanks for the reply.
Explaining a little bit more:
I would like to determine when the last 10 periods of an oscillator are smooth and the output over these 10 periods resembles something that looks like part of a sinuisoidal wave. I can do this visually but this is no good for proper backtesting.
I am away from home at the moment so unfortunatley I cannot post a screenshot of what I mean.
Thanks
It is not so easy to do, but not hard. You should understand that this is a well studied problem, and has many approaches. Here is a "simple" one:
Fit a cubic spline of a given order to the curve. Then do a [R]MSE of data points from the curve. The higher the MSE from the curve, the "choppier" it is. The higher the order of the curve, the closer the fit and the lower the MSE from the curve, so this problem is reduced to finding the "optimal" order of the curve. You can do the same estimation with moving averages, etc, but you get very rough numbers then.
I believe that other statistics like fractal dimension, lyapunov exponets, etc will give you a number that describes information about the time series that you want, but they may not necessarily be better if what you are trying to match is what you see with your
eye.
Finally, probably the closest approach to what you are seeing with your eye is to transform the signal (
time series) into the
frequency domain, and do fourier or wavelet type analysis there (edge detection etc.) This is not so easy to do if you are not trained in the subject matter.
nitro