Help with Fourier - page 14

 

Is it possible to make a complete Fourier series on a 1000 bar history to draw one or two maximal harmonics without overdrawing?

Files:
 
nikost:

Is it possible to make a complete Fourier series on a 1000 bar history to draw one or two maximal harmonics without overdrawing?

Of course you can.)
 
alsu:
Of course you can, what are the questions?
Maybe someone has already solved this problem, if you don't mind giving me a link.
 
nikost:

Is there a Spectrometr_Separate indicator in the base, is it possible to make a complete Fourier series on a history of 1000 bars to draw one or two maximal harmonics and not to re-draw?


What is a complete row?

It is 1000 bars. There is a parameter in the indicator properties window.

It does not want it to redraw. How do you imagine it? The last several bars are analyzed and the indicator draws the same situation on these bars.

 
Integer:


What is the complete series?

1000 bars. There is a parameter in the indicator properties window.

To avoid redrawing. How do you see it? It analyses the last several bars and draws them as they are.

If the amplitude changes, the harmonic drawn will also change (with a different colour). Let's say 1 harmonic was at its maximum in red, then the 4th harmonic will be blue and not continuous.
 
nikost:
If the amplitude changes, the colour of the harmonic also changes, so let's say the maxima of the 1st harmonic are red and the maxima of the 4th are blue.

What should I draw so that it is not redrawn? The trace of the end of the maximum harmonic - it won't do anything, there is still a phase. Looking at the history, at the way the indicator works now we can see both amplitude and phase. To the right of the line - you can see which harmonic has the maximum amplitude.
 
I looked at code of Spectrometr_Separate.mq4, the FFT is slow ("straightforward") and a little awry - for example, two Pi is set as 6.28, i.e. accuracy is lost after the second digit
 
alsu:
I looked at code of Spectrometr_Separate.mq4, there the FFT is slow ("in the frontal direction") and a little crooked - for example, two pi is set as 6.28, i.e. accuracy is lost after the second digit


The FFT has a fixed window. We will be very glad if the code base will have an FFT code with an arbitrary window size someday:)

Try to set exact pi, will the picture change much?

 
Integer:


The FFT has a fixed window size. We'd be very happy if the codebase would someday have an FFT code with an arbitrary window size:)

Try to put exact pi, will the picture change much?

It's not FFT there, but ordinary discrete by definition.

Visually, the picture may not change much, but when calculating, a difference of half a percent in pi can easily lead to the same difference in the price scale, and this is not a dick. Errors in algorithms have a very nasty property to multiply.

 
alsu:

It is not an FFT, but a normal discrete by definition.

The FFT has a fixed window size, there is no possibility to set an arbitrary window size. There are FFT algorithms with an arbitrarily sized window. Write it down, put it in cadebase, everyone will be happy.

P. No one will prevent you from substituting 6.28 for 2*3.1415926535898932384626433832323279502884197169399375105820974944592307816406286208998628803482534211706791482808651328230664709384460955058223172
535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339
360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611
738193261179310511854807446237996274956735188575272489122793818301194912983367336244065664308602139494639522473719070217986094370277053921717629
317675238467481846766940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902
196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445945534690830264252230825334468503526193118817101000313
78387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066............................................................

Reason: