Fourier-based hypothesis

 

There is a hypothesis: If we take a segment of prices, suppose for the last 1000 bars, and approximate it by FFT, then, if we correctly capture the basic harmonics by FFT, we can equally extrapolate prices not only into the future, but also into the past.


This can be done, for example, as follows: we can select such a set of FFT parameters (number of harmonics, approximation accuracy) so that it would give the minimum RMS at the interval preceding the selected one (for example, from 1200 to 1000 bars). In this case there is a probability that the selected coefficients will approximate not only the previous interval, but also the future one from 0 to 200 (of course, if the basic market rhythms do not significantly change).



Colleagues, can anyone help to test the hypothesis?

 
equantis >> :

IMHO, the very definition of the prediction problem is completely wrong. This, by the very definition of PF, will not work.

 
The Fourier transform itself has one disadvantage - when the signal is reconstructed backwards it leads to distortion relative to the minute state backwards... So, to check it, you either have to understand it yourself or try to find other topics... all such topics have been ploughed over long ago...
 

I understand that the main idea is still to predict the future, while the past is only for verification.

The hypothesis you have is that if the past forecast will be correct, then you can trust the future forecast (correct me if I'm wrong).

Hence the question if the past forecast will converge, where is the guarantee that the market has not changed the mood in the life time of the last segment and

the future forecast will converge?

 
Yes, that's right. I think any market model (FFT or NS or any other, e.g. on candlesticks) works for a certain period of time. As far as I understand it, FFT tries to approximate the price curve in the same way over the whole given section (as the RMS is applied to each bar). Therefore the hypothesis is valid only for the situation when the market behaviour pattern has not changed (and consequently all harmonics remain) during the whole "learning" period from 1200 bars in the past to +200 bars in the future ((a) main learning segment of 1000 - 0 bars, (b) 1200-1000 testing segment and (c) 0 - 200 forecasting segment). Naturally, if the market behaviour pattern changes in this section, all is lost )))


On the other hand I thought there is probably not much difference between the options:

1. to run the FFT on a segment 1200 - 0

2. or FFT (using FOS) on the interval 1000 - 0 and then optimize (using the same FOS) for the results on the interval 1200 - 1000.


I will try to program it and have a look at the results, thank goodness there are libraries here.

 
 
And maybe throw an indicator template with the principle of processing of indicator reaction to the script ... not only in manual but also in automatic mode ... I check almost all indicators for dynamic data change in offline mode ... do not wait for price movements ...
 
Assuming that FFT signal analysis aims to eventually get a near-optimal digital filter response, I wrote such a predictor. Ironically it showed a PF close to 2 on the last 4 months without any optimisation, but drains on the other periods. And we return to the old question that whatever tool is used, i.e. even the one that seems to be self-adapting to the market, we have to select its parameters which will be optimal only in a certain period of time, and we don't know when this period will be over. For a filter in particular, we have to play with bandwidth frequencies.
 

And assuming you have minimal distortions that can be neglected to make a prediction - is the prediction process then possible?

 
equantis >> :

There is a hypothesis: If we take a segment of prices over, say, the last 1000 bars and approximate it with FFT, then if we have caught the basic rhythms correctly with FFT, we can equally extrapolate prices not only into the future, but also into the past.


Colleagues, can anyone help to test the hypothesis?

We can. It is enough to remember the very, very basics of mathematics.

Check question, even three ( leading questions ;) ).

1. What is the maximum number of bars forward/backward (relative to your example) you can extrapolate the value of a function which is restored by the Fourier method, and why ?

2. If we take an infinite number of terms of the series, what values will be obtained at which bars (can this be estimated without applying the decomposition ;) ) ?

3. what is a periodic function ;)...

Good luck.

ZS 2 to all those who haven't yet given up on Fourier - start by learning the basics of the methods and don't rush straight into the thicket - you can save quite a lot of time ;)...

 
forte928 >> :

And assuming you have minimal distortion which can be neglected to make a prediction - is the prediction process then possible?

1. A proper FFT has almost zero distortion, which is why it is used to multiply large numbers (on the order of hundreds of megabits) and very rarely has an error. For 4-5 digit accuracy of quotes, these distortions will have no effect at all.

2. PF is a spectral analysis of periodic functions. That is, if you obtain a Fourier series expansion in BP of 1000 bars, then for the next 1000 bars you will obtain the exact copy of the previous period of 1000 bars. Because PF is an approximation of periodic functions, not an extrapolation.


All that can be done for extrapolation, is for example to decompose two previous periods by N bars in spectral analysis. Then, to extrapolate the next (not yet existing) N bars, take the arithmetic mean of harmonic amplitudes and shift the phase of each harmonic by exactly as many radians as the difference in the corresponding harmonics in the two previous periods under study.