Predicting the future with Fourier transforms - page 8

 

That's not what I meant. How did you build the picture? Did you just feed ZZ instead of Close?

If you sketched something separate, please put it here. I'll experiment.

"PS price went up to 1.6018 today, just to the predicted level".
Exactly. But that's the prediction. And the prediction is coming true. At a certain interval. But "there was no promise to feed on the way" :)

And I only look at ZZ because of the stops.

 

m_keeper

Actually that curvature has been pretty well visible since the day before yesterday.

But with me, it's not the extreme Close that connects the middle line, it's the deviation from the regression that builds it.

I use other methods as well, but linear regression is basic for shorter distances.



      af_LR(T,i0);

      for (n=0; n<T; n++) 
      {
        dcn=Close[n+i0]-b-a*n;
        sum_cos+=dcn*MathCos(k*n*w); 
        sum_sin+=dcn*MathSin(k*n*w);
      }
     
void af_LR(int p,int i)
{ 
   double sx=0,sy=0,sxy=0,sxx=0;
    if (p<2) p=2;
               
   for (int n=0; n<p; n++) 
   {
      sx+=n; 
      sy+=Close[n+i]; 
      sxy+=n*Close[n+i]; 
      sxx+=n*n; 
   }   
   a=(sx*sy-p*sxy)/(sx*sx-p*sxx);
   b=(sy-aa*sx)/p;
}

For longer distances, I'll put a special centering function underneath:

 

Sorry, probably off topic, but I have a fairly reliable medium term EA sold oira from 1.5954 with a stop at 1.6165, target (usually a few figures) open. The time is 14.00 MSK. Close pose/reversal by reverse signal, trawl.

ZS By the way, and the euro yen was sold the day before yesterday.


Let's see :)


Completing as I go:

=========================================

23/04 17.30 MSK: 80p profit on EURUSD, stop at 1.6075 EURJPY is also in profit 85p.

24/04 09.00 MSK: 100p profit on EURUSD, stop at 1.6033 EURJPY profit 80p

24/04 13.00 MSC: EURUSD 240p Profit, stop at 1.5921, EURJPY 125p Profit

24/04 19.00 MSC: EURUSD 300p profit, stop at 1.5858, EURJPY profit 155p

24/04 22.00 Moscow time zone: EURUSD 298p profit, position closed by EA from market reversal, EURJPY in market

 

My setup is to look for repetition of several periods in a row (I always use 2), so I didn't really look at short periods.

In addition, the PeriodStep was set high and high frequencies were not considered.

Here was the prediction.


But if I add high frequencies


There is some decline, but it will pass on the way to the real decline, but it won't show strong increase either.


When operating with a different number of periods, the amplitudes do not match,

It looks like a bug in the algorithm, I think I even know where.


I'll fix it later, now I'll prepare the input data

 

Here are a couple of indicators


One counts EquiVolume bars on smaller bars

The second one has the volume changed to


return((iHigh(NULL,SubPeriod,shift)-iLow(NULL,SubPeriod,shift)+MathAbs(iOpen(NULL,SubPeriod,shift)-iClose(NULL,SubPeriod,shift)))*ObrPoint);

the graphs look better, let's see what it does

 

"there is a decrease, but it will pass when approaching a real decrease, but it will not show a strong increase either
When working with a different number of periods the amplitudes do not coincide much".


Or maybe we should somehow relate the number of forecast bars to the frequencies used?

 
vaa20003:

"there is a drop, but it will pass on the way to the real drop, but it will not show a significant increase either.
When working with a different number of periods the amplitudes do not coincide much".


Shouldn't we somehow correlate the number of forecast bars with the frequencies used?

Now I'm testing the algorithm, feeding a sine wave to the input, trying to get it at the output

While I've been spreading and refining it, I've picked up a few bugs.

the frequency is not found accurately, the amplitude is counted incorrectly,

When setting the frequencies manually the highest frequency is repeatedly lost.


it's too early to make conclusions about what should be connected to what.


until the output is what it should be there will not move on

 
m_keeper:

Here are a couple of indicators


One counts EquiVolume bars on smaller bars

The second one has the volume changed to


the graphs look better, let's see what it does

I don't think it will do much. In order to linearize the trend at least to some extent, we can try to calculate the average price increments for a long enough period, i.e. the length of the price path over time, and find the average price increment per bar: sum+=MathAbs(Close[i]-Close[i+1]); dcs=sum/T; Time scale is recalculated into points. And then the specific increments are recalculated into relative increments. This is used to build a Fourier function and then it is recalculated back to the traditional chart scale. That is, the market is either accelerating or decelerating. As a result, half-periods of sinusoids are not equal in duration.

Using the method I've described, we can try to calculate the average speed and recalculate the increments, and then where it was slowing down, it will seem to speed up; and where it was speeding up, it will seem to slow down. And in the first approximation, it would balance out.

But of course this is very approximate.

 
ANG3110:
m_keeper:

Here are a couple of indicators


One counts EquiVolume bars on smaller bars

The second one has the volume changed to


the graphs look better, let's see what it does

I don't think it will do much. In order to linearize the trend at least to some extent, we can try to calculate the average price increments for a long enough period, i.e. the price path length over time, and find the average price increments per bar: sum+=MathAbs(Close[i]-Close[i+1]); dcs=sum/T; and then convert specific increments into related ones. This is used to build a Fourier function and then it is recalculated again in the traditional chart scale. It means that the market is either accelerating or decelerating. As a result, half-periods of sinusoids are not equal in duration.

Using the method I've described, we can try to calculate the average speed and recalculate the increments, and then where it was slowing down, it will seem to speed up; and where it was speeding up, it will seem to slow down. And in first approximation, it would balance out.

But of course this is very approximate.

For some reason, I think so too. But this is purely from observing different indicators, in a worker-peasant way. If an indicator is ahead, then behind, then in line with the price... it's hard to trust him :)

 

to ANG3110

Tezka, could you knock on the ICQ (339661094), if it's not difficult. Thoughts wander in my head, but the feeling that you have already passed it.

And I don't want to litter the thread.