Indicators: Fourier extrapolation of price

 

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

Fourier extrapolation of price

 
Hey, for some reason the indi won't display in mt5 under indicators.  I did compile the indi, and restarted mt5.  All the other indis work except the two extrapolation indis you posted in the codebase.
 
Saidar:
Hey, for some reason the indi won't display in mt5 under indicators.  I did compile the indi, and restarted mt5.  All the other indis work except the two extrapolation indis you posted in the codebase.
Not sure why this happens, unless you use Windows 7, where the "real" path to MQL5\Indicators is somehere in C:\Documents and Settings\User_Name\...
 
Yes I use Windows 7, will have a look
 

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 

 

Hey, interesting indicator. I'm liking the mathematical aspect of actually using a projection model on the charts. I'm not too experienced with code yet, so I'm wondering how you'd go about setting the model to "go back" and do the prediction curve it -would- have made a certain number of ticks ago (say, 100). That way it could be applied to various charts and give an idea of how much the reality varies from the model, maybe use that to identify some characteristics of a market where the model works well, etc.

 
Saidar:
Yes I use Windows 7, will have a look

you may want to run mt5 in portable mode:

terminal.exe /portable

you will get indicator working in the current mt5 directory - useful for pendrive installation 

 

modification for making it back-shift in time for testing its prediction capability:

at line 32 insert:
input int     TimeShift = 10;       // how many bars shift back, useful for evaluating predictability of indicator

at line 54 replace: 
  PlotIndexSetInteger(0, PLOT_SHIFT, Nfut);
with:
  PlotIndexSetInteger(0, PLOT_SHIFT, Nfut - TimeShift);

at line 55 insert:
  PlotIndexSetInteger(1, PLOT_SHIFT, -TimeShift);

at line 87 replace: 
  if(CopyRates(NULL, 0, 0, Npast, rates) <= 0) return(0);
with:
  if(CopyRates(NULL, 0, TimeShift, Npast, rates) <= 0) return(0);

 

Thank You



 
Thanks
 
Please how do I get the indicator??