Predicting the future with Fourier transforms - page 9

 

Well yes, that's nonsense.

To make it clearer what I have written, let's assume we have 3 bars of rising price at 10 pips each, and 3 bars of falling price at 5 pips. The rising price will give 30 pips in total, the falling one - 15 pips. The timing is the same whether the wave is going up or down. If we approximate it by a sinusoid, then neither the left nor the right wave will coincide with it. This is what we encounter when we try to work with fixed periods and the same in simple indicators. It may be that the indicator optimizes at some period or builds the same Fourier and then it may accelerate and break some support or some politician announced something in the news and it jumped 100-200 points in few minutes. And then it slows down and it cannot gain 20 points within several hours.

It changes all the time. I tried to use spectrum analyzer to find some constant frequencies. But it turned out that even if I had them, they were rather far away from each other and hardly ever repeating next to each other. That is, I have to work on such a data structure that constantly wriggles like a snake... In short, "Serpent 666".

 

hard to tell the difference by sight

(Close[i]-Close[i+1]);

from

iOpen(NULL,SubPeriod,shift)-iClose(NULL,SubPeriod,shift)

(top and bottom)

here is an indicator



Files:
 

There was an RZI indicator popping up somewhere. I made fun of it.... And with volume and high-low and close and all together.... I got a similar picture. But the price did not always go where it was supposed to.

It's all a trend. And then suddenly it moves in the opposite direction.

There is a certain area (time) of the forecast below which there is a big noise, above which the probability of a positive forecast is low.

It is like with EURUSD. The forecast seems to have come true - the price reached 1.6. But on the way.........

 

Here's what I found out.

Calculated the size of arrays differently in mayna and anelise (I forgot to fix it)

as a result, the high frequencies were lost, and the ones that weren't were applied

with the wrong amplitude. Incorrect frequency determination is caused by the fact that I'm looking for

maxima on the pronormalized periodogram, it is solved by multiplying

the resulting frequency by 0.923. There are no problems with the phase.

 

Here's a theoretical question

yesterday, after the report, the euro fell sharply and broke the channel that has been holding since the first of april.

The idea is that whatever sine wave you're looking for in that channel, it can't break out of the channel,

unless you take a very short period the size of the last decline.

For the sake of interest I decided to strictly follow the indicator readings until my demo account ran out

The indicator showed that it should go up after such a fall

The series normalized by volume or volume squared improve the reaction, speeding up the time by several times


ANG3110, how do you deal with such variations?

or do you give up on these kinds of indicators if you can't find

the right channel?

 
Oh this Fourier .... Did you know that the 0th harmonic is equal to the simple average (SMA) over the same decomposition period (T)?
 
klot:
Oh, that Fourier .... Did you know that the 0th harmonic is equal to the simple average (SMA) over the same expansion period (T)?

Of course, it's the expectation

 

Now I went through the last days with a periodogram built by looking for one period instead of two repeating periods

much better results, the prediction became less inertial or something.

Use of equi-bars has improved the picture even more, the indicator showed not to go buy until this morning

I like this reading better.


I have one more idea - to compare not the selected frequencies, but the entire periodogram, or at least its low-frequency part

I'll test it next week and then I'll post what I've got.

 
m_keeper:

ANG3110, how do you deal with these variations?

or do you give up on this kind of indicator if you can't find

a proper channel?

On larger periods this area, that there could be a collapse was already seen a few days ago - this is a consequence of the rapid rise around March 21. You have to be especially careful in these areas and if you are not sure, it is better to refrain from trading.

In general, the fact that the optimum goes beyond the periodic component (outside the channel) is evidenced by a strongly drifting phase of the fundamental harmonic. Only it is better to define it not simply as -arctan(bk/ak) but by a different way:

calculate the derivative at bar 0 dfx = fx[0] - fx[1]; you still calculate the maximum amplitude

Am = MathSqrt(ak*ak + bk*bk); and phase

faza=MathArcsin(ak/Am);

if (dfx>0 && faza>0) faza = pi - faza;

if (dfx>0 && faza<0) faza = - faza - pi;


If the trend is going down then it is very dangerous to go counter-trend, the end of the sine wave will go counter-trend as it tends to the SMA and you can lose a lot, if you have a small deposit it can wipe everything out. On a trend it is better to use DCT.

In my case on shorter distances, as I have already written, in the form of middle around which the Fourier rotates - the linear regression is underlined, and it too has changed the slope strongly, and although the end is somewhat elevated, but I do not look at its position, but where it shows the reversal.

Another easy way, probably klot was hinting at it, is to build a Fourier around the muving in a separate window like MACD and the projection forward - extrapolation, is also done in the same window. If you want, you can recalculate it in the main window as well, but then you need something to at least roughly extrapolate the end.

As it is, everything twists and turns around something. So there are slower harmonics around which the local ones revolve. And it is also important to have a centering channel like I showed in the graph or another option in the figure below - a reference function with continuation, around which the Fourier function is built.

But I also wrote above that at such moments the market strongly accelerates and though total increases are not so large, they are in the same direction. In general, it is the same non-linearity of space-time, or amplitude-time dependence.

Almost everyone who tried to apply Fourier to the market broke down on those sharp jumps. I think whoever can do it is already a rich man...

 

I'm starting to like the FFT Future indicator! Working on small M5 fluctuations. So far 90% of the positions are PROFIT! The main thing is not to get complacent.

I use values: 9.0/400/430/0.04

- Although, it's not very readable - it's outside the chart.



jpy0408