Download MetaTrader 5

Indicators: Fourier extrapolation of price

To add comments, please log in or register
All activity at MQL5.community is clearly visible. Have a look at the Wall!
Automated-Trading
Admin
99084
Automated-Trading 2010.07.05 14:14 

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

Franco
374
Franco 2010.07.06 21:34  
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.
Vladimir
5899
Vladimir 2010.07.06 22:07  
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\...
Franco
374
Franco 2010.07.07 10:39  
Yes I use Windows 7, will have a look
Emmyo
16
Emmyo 2010.07.23 22:08  

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 

 

 

Jacob Funk
92
Jacob Funk 2011.01.19 18:43  

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.

investeo
4098
investeo 2011.01.19 22:10  
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 

okx
12
okx 2011.06.16 20:20  

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);

MathQuant
73
MathQuant 2013.01.20 16:09  

Thank You



To add comments, please log in or register