Indicators: Fourier extrapolation of price - page 3

 
ANG3110:

The period should be tied to time, so that it would be recalculated when switching timeframes. Otherwise, the picture is not quite clear and really contradictory.

For example, in hours T = hr * 60.0 / Period().

And fitting of the series is better to carry out in resonance with the past data, like a quick scan and choose the variant by minimum RMS or maximum correlation, then the forecast is more likely to coincide with the real picture.

Thanks for the tips. I tried something similar, only the minimum RMS was dictated on the last bars.
 
gpwr:
Thanks for the tips. I tried something similar, but the minimum RMS was dictated on the last bars.

Actually, it is not easy to accurately represent the trajectory to match the subsequent data. Usually 3-5 harmonics give a better result, more is already lying a lot. And it is enough to achieve on the previous data that the current period would more or less coincide with the reversal points, at least roughly. Then the continuation is more likely to coincide. And as experience shows, it is not necessary to remove harmonics for better fitting to the previous data, otherwise the past picture will be beautiful, and the subsequent one will not coincide at all.

Well, and also very much depends on what is decomposed into harmonics. I tried different ways - and regression in the form of a trend component and all kinds of muwings with the search for coincidences on the previous data and from the five most coincident curves summed up with weight coefficients of their continuation in the same proportions, and the sum extrapolated. Roughly, in general, it turned out. But it is very dangerous to trade on such predictions - the error is still very high.

 

who is interested in how to use Fourier, look at this thread https://www.mql5.com/ru/forum/127331 there are sources on matkad and how to do what there with explanations (I posted it). I recommend everyone to first learn how to forecast something simple, like the function posted there, and then move on to market forecasting, then you will understand what you are doing and why....

 

Hi gpwr,

Can you plesae advise what code I can possibly use to extract the past and future values from this indicator.  Say 5 future readis and 5 past readings from the current bar.  I have tried using Create indicator and try to get the values from the arrays ... no luck.  What I get does not equate in value and direction with what is shown on the graph.  I have tried it on different Time frames including daily, 4hrs, 30mins and 5 mins.

Your help is highly appreciated. 

Emmy 

 
Prival:

If you are interested in how to use Fourier, look at this thread https://www.mql5.com/ru/forum/127331. There are sources on matkad and how to do what there with explanations (I posted it). I recommend everyone to first learn how to forecast something simple, like the function posted there, and then move on to market forecasting, then you will understand what you are doing and why....

Yes, Sergey, such "woe of wit" happens very often. But there are certain reasons for it. In order to study something, you need to programme it all. And programming often takes a lot of effort and mental energy, so there is nothing left for research and understanding of processes. When programmes convenient for research are already made, then you can find a deeper state and try to investigate the question of interest.

The law of speculation, buy cheaper, sell more expensive and cosine-sine functions fit it as well as possible. But to fit them into resonance and into all kinds of distortions both in amplitude and frequency is a very difficult task. One person probably can't manage it sufficiently.

Although I had sketches of an Expert Advisor, which auto-tuned only one sinusoid according to the maximum correlation, and on some market section made ca. 20 trades in a row at 30-100 pips. And then the picture changed and additional tracking measures were needed. But it is labour-intensive. I was so tired then that I was like a squeezed lemon for several days. A whole bunch of bodybuilders' clubs could probably live on such amount of intellectual energy for a long time, or if it is ordered to a programmer, I think the cost would be several thousand and he would hardly do something normal.

 
What if we try to predict not the price itself, but, say, the behaviour of such indicators as Stohastic_x8 (reducing the number from 8 to 3-4) or WPR-multi? Somehow it seems to me that forecasts of SIGNALS by these indicators (convergence-divergence of lines) could be much more effective, especially when coinciding on several timeframes at the same time.
 
Prival:

No, it's not lost. Except there's this huge rock there, and everything crashes against it. As an electronics guy, you'll understand. I'll try to make it coherent.

1. If we assume that the price is continuous (analogue signal), it does not depend on whether the quotes come to us or not. Let's say it's Saturday or Sunday, the demand for euro or dollar has not gone anywhere....

2. Then the quotes coming to us are nothing but the work of ADC. And ADC in its worst manifestation.

3. Remember the work of ADC, there are quantisation noise and sampling noise. For example, in Sergienko A.B. Digital Signal Processing 2002. The whole chapter No.7 is devoted to the effects that appear at quantisation, for example, many people think that there is no noise. And in fact

It is there, if it is there, it must be processed. If there were only quantisation noise. That would be great, but there's one more thing that any electronic engineer runs like hell from, that's...

4. sampling noise, and there is some, ticks do not come to us with the accuracy of a quartz oscillator, hence the sampling rate is a random variable. Try to predict a simple sine wave that is digitised with a variable delta tee... Now just think about it, bars give us the illusion of a constant delta tee that is not really there. And 95% of all algorithms assume that delta te is constant, otherwise everything falls apart like a house of cards....

Many practicing traders do not go below the period M5, they intuitively feel that there the error - relative sampling error (relative to the beginning - end of the bar) becomes large, the higher the time frame, the less this error has an impact. I somehow calculated that if no special measures are applied, the lower limit is somewhere around 3 minutes, further the noise increases a lot....

I see the only way out, ticks, approximation, and slicing with the required delta te, but without ticks history, it is almost unrealistic to build a reliable automaton... the slightest failure, and again sit copying ticks, until you accumulate to make a decision... and the time is already lost, you have already been undressed... or are being undressed....

Fourier itself is a wonderful tool for building adaptive filters, but you need to understand very well what is going on there, how and why, even this https://www.mql5.com/en/code/120 was invented for a reason, it is digital, it is DSP, a whole field of knowledge, skills and abilities. Without it, there would be no computers, no mobile phones, no televisions

H.Y. it all turned out to be long, but you can't describe it in 2 words. Maybe I'm wrong. I have just written to Niroba https://www.mql5.com/ru/forum/120788/page380 and now I will repeat it for myself.

I think - therefore I exist. At all times "thinking" inevitably meant "dissenting", doubting, making choices. Good luck with your "dissent".


I've been racking my brain about the highlighted part:

Why is delta te not a constant? If we take the bar opening price as a tick, the time until the next bar opening is constant - 60 sec (if M1), at such a low frequency, as far as I understand, it doesn't make much difference when a tick was recorded on the server, in 60 sec, 60.2 or 59.8 sec, in any case the time deviation of 1-2% is not significant, and collecting ticks will not significantly improve accuracy.

Time will not be a constant if we take min/max prices for a tick, because we do not know when the price was reached.

 
mrProF:

I've been racking my brain about the highlighted one:

Why delta te is not a constant? If we take the bar opening price as a tick, the time until the next bar opening is constant - 60 sec (if M1), at such a low frequency, as far as I understand, it doesn't make much difference when a tick was recorded on the server, in 60 sec, 60.2 or 59.8 sec, in any case the time deviation of 1-2% is not significant, and collecting ticks will not significantly improve accuracy.

Time will not be a constant if we take min/max prices as a tick, because we don't know when the price was reached.

We were talking about real ticks....
 
Interesting:
It was about real ticks....
The bar opening price is a real tick, such price was really such at this moment of time.
The speech was about the falsity of candlestick readings below M3.
 

There's something about it.