Hodrick-Prescott Filter

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

Hodrick-Prescott Filter

Postby Apprentice » Mon Dec 27, 2010 12:00 pm

HPF.png

The Hodrick-Prescott filter is a mathematical tool used in macroeconomics, especially in real business cycle theory to separate the cyclical component of a time series from raw data.

It is used to obtain a smoothed non-linear representation of a time series, it is more sensitive to long-term than to short-term fluctuations.
HPF.lua
(3.73 KiB) Downloaded 2505 times


The indicator was revised and updated
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Hodrick-Prescott Filter

Postby Apprentice » Mon Dec 27, 2010 3:41 pm

When used in combination with a 50 period EMA of HPS gives good Entry / Exit signals.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Hodrick-Prescott Filter

Postby Blackcat2 » Tue Dec 28, 2010 5:43 pm

Looks good :) I'm currently testing it...

BTW, what do you means by "50 period EMA of HPS"? Do you mean when this indicator combined with 50 EMA or is there another indicator called HPS?

Thanks :)
Blackcat2
FXCodeBase: Initiate
 
Posts: 118
Joined: Wed May 19, 2010 12:42 am

Re: Hodrick-Prescott Filter

Postby Apprentice » Wed Dec 29, 2010 7:48 am

HPFEMA.png


Instead you are using closing price, to calculate the EMA.
Use the EMA based on the HPF data stream.

This is only a recommendation.

Basically there are no big differences.
But since this was designed to determine long-term cycles,
EMA has a little too much noise.

DATA.PNG


Here you can see how to choose an alternative data source for EMA.

If 50 EMA have too much Lag for you use lower value,
for example 10 or even 5 period EMA.

The classic EMA with this period gives a lot of false signals,
EMA of HPF with period 5 almost never given false ones.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Hodrick-Prescott Filter

Postby Blackcat2 » Wed Dec 29, 2010 7:36 pm

Thanks Apprentice...

Much appreciated :)
Blackcat2
FXCodeBase: Initiate
 
Posts: 118
Joined: Wed May 19, 2010 12:42 am

Re: Hodrick-Prescott Filter

Postby laners303 » Thu Jan 13, 2011 11:46 pm

Hey Apprentice,

if the HPF was an option in the MA ADVISOR strategy, and you could adjust the EMA as you suggested it would be an unreal strategy :D

Laners303
laners303
 
Posts: 10
Joined: Tue Oct 12, 2010 10:03 am

Re: Hodrick-Prescott Filter

Postby ALEX678 » Sat Jan 15, 2011 5:20 am

This HPF 50 with EMA 50 is the great indicators, ther is a signal with this two indicators combined? :D
ALEX678
 
Posts: 1
Joined: Sun Jan 09, 2011 1:57 am
Location: Follonica Gr Italy

Re: Hodrick-Prescott Filter

Postby Apprentice » Sat Jan 15, 2011 6:06 am

The answer to both post, HPF is primarily an analytical tool, not for trader,
I will see whether this is justified.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Hodrick-Prescott Filter

Postby craige » Sun Jan 16, 2011 3:51 am

HELLO GUYS

I found HPF is a great indicator in the long term which it is able to predict the trend

two questions

1. which time frame is suitable for HPF in order to use its advantage in the long term, M15、H1、H4、D1?
2. is the HPF indicator a lagging indicator? or how long it lags when used in different time frame?

thanks for your reply
craige
 
Posts: 51
Joined: Thu Dec 23, 2010 9:54 pm

Re: Hodrick-Prescott Filter

Postby laners303 » Sun Jan 16, 2011 11:05 pm

Hey Craige,

I set it up just as Apprentice said with the 50 HPF and the 50 EMA. On the hourly time frame since the 3 of june last year it collected 9978 pips excluding spreads and slippage etc. In that 6 month period there was 37 trades and only three of them were losers, but thats without stoplosse's. there is a small bit of lag but when u get the signal the move is in motion so there is no major pullback's.Thats what I have found the best so far,

all the best man,
Laners303
laners303
 
Posts: 10
Joined: Tue Oct 12, 2010 10:03 am

Next

Return to Custom Indicators

Who is online

Users browsing this forum: No registered users and 216 guests