It's glitchy
It's glitchy
Thank you. I see why it's doing that. I fixed the code. We have to wait until they publish it.
It's just that with each new bar we need to reinitialise the prediction array so that the history doesn't accumulate.
And then the filling has gone forward and this bar remains filled from the last bar, and no one resets it.
It's just that with each new bar you need to reinitialise the prediction array so that the history doesn't accumulate.
Otherwise, the filling has gone forward and this bar remains filled from the last bar, and no one resets it to zero.
Yes, that's right. While we are waiting for the publication of a new version of the indicator, we need to make such a change in the old one.
Instead of
if(prev_calculated==0)remove if(...)
{
ArrayInitialize(xm,EMPTY_VALUE);
ArrayInitialize(ym,EMPTY_VALUE);
}
ArrayInitialize(xm,EMPTY_VALUE);
ArrayInitialize(ym,EMPTY_VALUE);
Thank you. I see why it's doing that. I fixed the code. We have to wait until they publish it.
Rosh:
Не вижу новой версии индикатора, публиковать нечего. Вы что-то меняли?
Yes, I did. Now I see that both extrapolators (Fourier and AR) have new code versions. Thank you. I don't need to do anything else.
The indicator is interesting but very contradictory!
At 30M
and already on H1:
You are right to point out that it is contradictory. Predictions change depending on the length of history, on which the Fourier series is fitted. When moving from M30 to H1 while maintaining Npast, this is exactly what happens. You can try to reduce Npast by 2 times during such a transition to preserve the history length.
By the way, the change of predictions depending on the history length is inherent in all extrapolators I have encountered. Therefore, the length of history (Npast) should be chosen taking into account some criteria. For example, on one of the mql4 forums, someone suggested to add Fourier series only to prices moving inside the channel (the moment of price entry into the channel gives the beginning of the history and the value of Npast). You can also try to add missing bars for Saturdays and Sundays and other holidays, so that the Fourier series fits into the calendar time. You can also try to apply this series to ticks. Prival seemed to do it and he was convinced of the correctness of this tick approach.
Prival, do you still have interest in Fourier series?
Prival, have you lost interest in Fourier series?
No, I haven't lost it. But there's one huge rock there, and everything breaks against it. You, as an electronic engineer, will understand me. I'll try to put it in sequence.
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 is quantisation noise and sampling noise. For example, in Sergienko A.B. Digital Signal Processing 2002. The effects that manifest themselves at quantisation is devoted to whole chapter ¹7, for example, many people think that there is no noise. But in fact
It is there, if it is there, it should be processed. If there were only quantisation noise. That would be great, but there's another 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 believe that delta te is a constant, otherwise everything falls apart like a house of cards....
Many practicing traders do not go below the M5 period, 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 greatly....
I see the only way out, ticks, approximation, and slicing already with the necessary delta te, but without history of ticks, it is almost unreal 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 great 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, is digital, it is DSP, a whole field of knowledge, skills and abilities. Without it, there would be no computers, no mobile phones, no TV sets.
H.Y. It turned out to be long, but I 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".

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Fourier extrapolation of price:
This indicator fits a trigonometric model to prices and extrapolates it in the future.
This indicator uses the Quinn-Fernandes algorithm to find the harmonic frequencies. It fits harmonics of the trigonometric series one by one until the specified total number of harmonics H is reached. After fitting a new harmonic, the coded algorithm computes the residue between the updated model and the real values and fits a new harmonic to the residue.
Author: Vladimir