Indicators: The Hodrick-Prescott Filter

 

The Hodrick-Prescott Filter:

The Hodrick-Prescott filter is used in macroeconomics, especially in real business cycle theory to separate the cyclical component of a time series from raw data. It has a zero lag. There is a common disadvantage of such zero lag filters - the recent values are recalculated.

I have tried to apply this filter for the different purposes: for price channels, to use it as the trend changes indicator, etc, but I have found that it hasn't any significant advantages compared with EMA, LWMA or AMA. Also I have found that values of the prices, smoothed by this filter are close to the principal component of the Principal Component Analysis (PCA). It seems that there is a mathematical relashionship between the Hodrick-Prescott filter and PCA. It might be useful, so I publish it here.

Author: Vladimir

The Hodrick-Prescott Filter

 

a good tool for pips for the opening of America before the closing of Europe.

Edward Prescott won a Nobel Prize for it in 2004 for a reason.

But in general, the tool with its overdrawing is not reliable.

 
CoreWinTT:

a good tool for pips for the time of the opening of America before the closing of Europe.

Edward Prescott won a nobel prize for it in 2004.

but in general, the tool with its overdrawing is not reliable.

EURUSD pips? On what timeframe?
 

Very good filter for past known data. It can be used for neural networks, or classifications, where pattern estimation is done.

If used as an indicator or channel, drawing only the position of the end, it resembles the trajectory of the end of linear regression.

Green with yellow - HP filter on past data. Aqua - position of its end. Blue with red - LRMA (position of the end of linear regression).

-

 
gpwr:
Pipsing on EURUSD? On what timeframe?

15 20 30 minutes to build channels according to statistics of deviation of typical price folded by 3-echkom from the main line of hodrick coefficient somewhere from 2x to 1.6.

Accordingly, the indicator is quite heavy, so I take no more than 1500 bars for calculations.

trailing 20 trailing is transferred to no loss and the stop does not move further.

I trawled 21 trailing and put a hundred at +1 point.

Then you can do it differently.

1 trade per day only the main condition is the work of America and Europe together.

If there is a weekend, the stability is lost.

You have to wait until the price scratches the channel and moves towards the main trend.

because I think we know that this is the time of maximum volatility.

and the hodrick will show the 5 minute overbought and oversold zones quite well.

but you also have to minimise the spread of the recalculation.

In general, it is about 3-digit number of smoothing, I don't know how to call this parameter exactly.

but in general it is possible to pips

 
ANG3110:

Very good filter for past known data. It can be used for neural networks, or classifications, where pattern-based estimation is done.

If used as an indicator or channel, drawing only the end position, it resembles the end trajectory of a linear regression.

Green with yellow - HP filter on past data. Aqua - position of its end. Blue with red - LRMA (linear regression end position).

-

well, maybe hodrick nobel got for it, but on current data his readings in such analysis are just useless....

 
If this filter http://en.wikipedia.org/wiki/Hodrick-Prescott_filter is programmed, it doesn't look like it. And it is not clear why it should be redrawn....
 
Prival:
If this filter http://en.wikipedia.org/wiki/Hodrick-Prescott_filter is programmed, it doesn't look like it. And I don't understand why it's redrawn....

Why is your nickname crossed out???

I'm not a great mathematician

as Hodrick, but if you claim that this algorithm is wrong, it would be interesting to consider your version.

And why is your nickname crossed out????

Maybe it means ignore it?

 
CoreWinTT:

Why is your nickname crossed out???

I'm not a great mathematician.

as Hodrick. Well, since you claim that this algorithm is wrong, it would be interesting to consider your version.

And why is your nickname crossed out????

Maybe it means don't pay attention?

It's simple, crossed out means you're banned, there's skype in your profile, if it's important you can use it,

or on the fourth forum, where Prival hasn't been banned yet.

I don't know if the bannered person's private message is working or not, I need to check "we all walk under God, but not everyone will be allowed into paradise".

 

as far as I understand the hodrick preskto method of data processing cannot be non redrawing as new values influence the old ones.

but the filter is still so good, but it is completely useless on history.

 
CoreWinTT:

15 20 30 minutes to build channels according to statistics of deviation of typical price folded by 3-echkom from the main line of the hodrick coefficient somewhere from 2x to 1.6.

accordingly, the indicator is quite heavy, so I take no more than 1500 bars for calculations.

trailing 20 trailing is converted to no loss and the stop does not move further.

I trawled 21 trailing and put a hundred to +1 point

Then you can do it differently.

per day 1 deal per day only the main condition is the work of America and Europe together.

If there is a weekend somewhere, the stability is lost.

It is necessary to wait until the price scratches the channel and moves towards the main trend.

because I think it's well known that this is the time of maximum volatility.

and the hodrick will show the 5 minute overbought and oversold zones quite well.

but you also have to minimise the spread of the recalculation.

In general, it is about a 3-digit smoothing number, I don't know how to call this parameter exactly.

but in general it is possible to pip

Thank you. I'll try your method. I'm busy at work right now. I'll have to switch energy temporarily.

Prival: I took the code from a C++ programme. I didn't write it myself and I'm not sure of its accuracy, though I trust the source. You can redo it so that it doesn't redraw. I already have such an execution somewhere. But I will not show it, as those who are familiar with mql5 can easily change it themselves.