Fast Fourier Transformation indicator

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Fast Fourier Transformation indicator

Postby uglock » Wed Dec 08, 2010 1:10 am

Fast Fourier Transformation applied to the pattern recognition.

I’ve created an indicator that helps recognize repeated waves on the chart. The basic idea used for the indicator is that price changes are cyclic. Since there are a lot of “random” changes in the price we cannot just match one of the periods to another. We need somehow filter the small changes and keep only the main trend of price. I’ve used the Fast Fourier transformation (FFT) to get the main trend of price and filer the random noise.

Let’s use the FFT and try to find some pattern and predict the price moves.
This is the current H1 chart of EUR/USD.
patterns.png

We could see the two similar price moves. Let’s apply the FFT indicator. I’ve used the initial settings – 256 periods to analyze and no shift of waves.
fft_initial.png

Here you can see three “waves”: green, blue and red. The green wave is the representation of analyzed price movement – the last 256 periods of chart. The red wave is the copied green wave to the past, the blue one – to the future. The past wave could be shifted by a number of periods from the green wave.

After the FFT is applied we have to change the base point of the green wave to match the end of the trend.
fft_change_base_point.png
uglock
FXCodeBase: Confirmed User
 
Posts: 13
Joined: Fri Feb 05, 2010 1:20 am

Re: Fast Fourier Transformation indicator

Postby uglock » Wed Dec 08, 2010 1:12 am

After the base point is changed we could see that there are two repeated price movement and the third wave has started. We could predict that the EUR/USD will fall down until 12/13, when the price will go back. So, it is a good point to enter short and exit the market somewhere near 12/13.
fft.png


If the price will not follow the blue wave it is safe to just exit the market and try to predict another wave :)

If you cannot recognize any pattern on the chart, try to change the number of periods to analyze in the indicator settings. Also it may indicate that market is not predictable at the moment (e.g. on news events).

PS sorry for my bad English. Please let me know if you have any questions.
Attachments
fft.lua
(13.39 KiB) Downloaded 1362 times
uglock
FXCodeBase: Confirmed User
 
Posts: 13
Joined: Fri Feb 05, 2010 1:20 am

Re: Fast Fourier Transformation indicator

Postby Apprentice » Wed Dec 08, 2010 5:23 am

Excellent work.
Harmonic Selector Added.
To be able to Display only a Single Harmonic.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Fast Fourier Transformation indicator

Postby a135711 » Fri Dec 10, 2010 3:43 am

great piece of work

would it be difficult to emphasize the points of inflection with a vertical line originating at the inflection and terminating at the tangent of the previous inflection?

thanks
a135711
 
Posts: 39
Joined: Fri Apr 30, 2010 12:01 pm

Re: Fast Fourier Transformation indicator

Postby uglock » Fri Dec 10, 2010 11:43 am

Thank you!

Could you please draw an exaple of line you want to see. I'm sorry, I'm not clearly understand how it should be displayed.
uglock
FXCodeBase: Confirmed User
 
Posts: 13
Joined: Fri Feb 05, 2010 1:20 am

Re: Fast Fourier Transformation indicator

Postby a135711 » Fri Dec 10, 2010 12:57 pm

Image

here is a picture showing the tangent lines. a line is drawn at each intersection of any 2 harmonic curves and at each point the curve changes direction(inflection). the lines should span the entire CURRENT period only.

also,
you have provided the option for the user to select up to 10 harmonic curves.

it would be extremely useful if one could select which ones of these 10 harmonic curves are visible and which ones are not visible on the chart.

it would also be really useful if i could select a color for each visible harmonic curve as well as a line type for horizontal lines as either dashed, dotted, solid, or dotted dashed, line thickness.
a135711
 
Posts: 39
Joined: Fri Apr 30, 2010 12:01 pm

Re: Fast Fourier Transformation indicator

Postby Apprentice » Fri Dec 10, 2010 3:27 pm

Request added to the developmental cue.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Fast Fourier Transformation indicator

Postby vstrelnikov » Thu Dec 23, 2010 4:58 pm

Attachment in the top post updated. (debug output removed)
vstrelnikov
 
Posts: 59
Joined: Tue Jul 06, 2010 8:31 pm

Harmonic Indicator

Postby cigarguy » Tue Jan 22, 2013 10:27 pm

Great indicator but got this msg when I attempted to change NO to Yes for target lines;

An error occurred during the calculation of the indicator 'HARMONIC PATTERN'. The error details: [string "Harmonic Pattern.lua"]:599: Index is out of range.

Hope this can be fixed shortly.
Thanks, Cigarguy
cigarguy
 
Posts: 6
Joined: Wed Aug 24, 2011 10:34 am

Re: Fast Fourier Transformation indicator

Postby Apprentice » Wed Jan 23, 2013 8:48 am

Can you specify which indicator you use, post it here.
Do you mean the Harmonic Pattern Indicator posted here.
viewtopic.php?f=17&t=4994&hilit=Harmonic+Pattern
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Next

Return to Custom Indicators

Who is online

Users browsing this forum: Google [Bot] and 53 guests