Machine learning in trading: theory, models, practice and algo-trading - page 2305

 

While I'm fiddling with the Fourier, I've sketched an example

Top:

   for(int i=0;i<total;i++)
     {A[i]=cos(2.*M_PI/8.*i)+cos(2.*M_PI/32.*i)+cos(2.*M_PI/16.*i)+4.*xor.Rand_Norm();
     }

Bottom:

   for(int i=0;i<total;i++)
     {A[i]=cos(2.*M_PI/8.*i)+cos(2.*M_PI/32.*i)+cos(2.*M_PI/16.*i)+4.*xor.Rand_Norm();
     }
   MathCumulativeSum(A);


 
Rorschach:

While I'm fiddling with the Fourier, I've sketched an example

Top:

Bottom:

can you decipher what this means?

Absolute zero in DSP, cosines and sines
 

Interesting picture


 
Maxim Dmitrievsky:

can you decipher what this means?

Absolute zero in DSP, cosines and sines

I don't even know what to comment on. On the top figure are the increments and their cumulus, on the bottom their spectra. For the increments 3 sines on the spectrum is clearly visible.

 
Rorschach:

I don't even know what to comment on. On the top figure are the increments and their cumulus, and on the bottom figure are their spectra. For the increments there are 3 sines on the spectrum.

Well, how do you make a profit out of it?

 
Maxim Dmitrievsky:

Well, how do we get profit out of it?

On the spectrum of increments we see 3 peaks, we create a filter for them, extrapolate it, profit

 
Rorschach:

On the spectrum of increments we see 3 peaks, under them we make a filter, extrapolate it, profit

we don't see the period of the peaks, what to count from what

Do you have one on python?

 
Maxim Dmitrievsky:

you can't see what's counting from what

but there is on python?

For 1024 samples of the original series, the period of 64 will be at 1024/64+1=17 points, with a constant component at the 1st point. The frequencies will mirror relative to 1024/2, meaning there will be two peaks (at the beginning and end)

I don't. There's just a Fourier transform and that's it. I generated the sequence, made the transformation and plotted it.

I didn't test the code:

#include <rndxor128.mqh>
#include <Math\Alglib\fasttransforms.mqh>
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
#property indicator_label1  "Label1"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1

int OnInit()
  {
   SetIndexBuffer(0,Label1Buffer,INDICATOR_DATA);
   ArraySetAsSeries(Label1Buffer,1);
   PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0.);
   EventSetMillisecondTimer(50);
   return(INIT_SUCCEEDED);
  }

void OnTimer()
  {RNDXor128 xor;
   xor.SRand(3);
   CFastFourierTransform fft;
   ArrayInitialize(Label1Buffer,0.);
   double A[];
   int total=1024;
   ArrayResize(A,total);
   ArraySetAsSeries(A,1);
   ArrayInitialize(A,0.);
   for(int i=0;i<total;i++)
     {A[i]=cos(2.*M_PI/8.*i)+cos(2.*M_PI/32.*i)+cos(2.*M_PI/16.*i)+4.*xor.Rand_Norm();
     }
   //MathCumulativeSum(A);
   
   complex spec[];
   fft.FFTR1D(A,total,spec);
   for(int i=0;i<total;i++)
     {Label1Buffer[i]=sqrt(spec[i].re*spec[i].re+spec[i].im*spec[i].im)*2./total;
     }

   ChartRedraw();
   EventKillTimer();
  }
 
Rorschach:

Interesting picture

what are the classes in this picture?

 
mytarmailS:

what are the classes in this picture?

In the left column, two classes (blue and red)

Reason: