Hodrick-Prescott filter (HP)

v11
Hodrick-Prescott filter (HP)

The Hodrick–Prescott filter (also known as Hodrick–Prescott decomposition) is a mathematical tool used in macroeconomics, especially in real business cycle theory, to remove the cyclical component of a time series from raw data. It is used to obtain a smoothed-curve representation of a time series, one that is more sensitive to long-term than to short-term fluctuations. (source Wikipedia: https://en.wikipedia.org/wiki/Hodrick%E2%80%93Prescott_filter)

Be aware that this indicator is continuously rechecking the complete history to redraw the curve to be perfectly in line with the data serie. So it is repainting the past and should not be used “as is” for live trading.

Compatible only with PRT v11 and onwards.

 

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. juanj • 09/28/2020 #

    Could be useful in identifying Elliott Waves

  2. willi • 09/28/2020 #

    Guten Morgen,

    ich habe den Indikator importiert, bekomme aber leider nichts angezeigt. Liegt es vielleicht daran, das ich nur die Demoversion 11.1 benutze?

    Danke Willi

    • Nicolas • 09/28/2020 #

      Nein, es sollte genauso funktionieren mit Demo oder Real Account. Haben Sie es auf die Preisliste angewendet?

  3. willi • 09/28/2020 #

    Ich habe meinen Fehler gefunden: Das lambda war für meine eingestellte Zeiteinheit zu groß gewählt, mit einem kleineren Wert bekomme ich eine Anzeige.

    Danke Willi

  4. Fabian • 09/28/2020 #

    Hi Nicolas,

    do you plan to release this indicator in version 10.3 as well or is this not practicable due to the usage of arrays?

    • Nicolas • 09/28/2020 #

      No because it needs arrays! 🙂

  5. RicLg • 09/28/2020 #

    Hi Nicolas,
    Can we get the Value of this drawsegment?
    i do not understand how this code works
    Thank you .

    • Nicolas • 09/28/2020 #

      The last value is $output[i], so return $output[i]
      Be aware that the indicator is repainting continuously.

  6. RicLg • 09/28/2020 #

    Merci Nicolas pour le retour.
    En effet on récupère “the Last value” du dernier Point de traçage, après la création d’une variable, AllValuPoint=$output[i] entre les ligne 63 et 64
    Est il possible de récupérer Toutes les valeurs du traçage de ce drawsegment?
    Merci Nicolas

    • Nicolas • 09/28/2020 #

      c’est exactement ce que je fais entre les lignes 58 et 64 pour pouvoir tracer la ligne complète

  7. Italo Fabian • 09/28/2020 #

    Nicolas,

    Ces matrices sont-elles des vecteurs unidimensionnels ou multidimensionnels?

    Depuis maintenant,
    Reconnaissant!

  8. Denis • 09/28/2020 #

    Bonjour Nicolas et RicLg,
    Merci Nicolas pour cet indicateur intéressant et merci RicLg pour la suggestion.
    Toutefois, même en insérant une instruction suggérée par RicLg, je n’arrive pas à faire renvoyer toutes les valeurs qui dessinent le segment, ce qui empêche qu’une alerte se déclenche.
    Auriez-vous une idée de ce qui bloque le renvoi de ces valeurs ?
    Merci par avance de votre aide

avatar
Register or

Likes

avatar avatar avatar avatar
Related users ' posts
DimKar Dear sir , thank you very much for sharing !!!! it is awesome ...!!! Please can you tell me...
Nicolas Change line 62 with: drawcandle(flup,fldn,flup,fldn) coloured(169,169,169,80) bordercolor(16...
DimKar Thank you very much from Greece sir , have a nice day ....!!!! Really i do not have words...
3agl3 voglio l indicatore
ottimo Thank you Nicolas, great indicator, N. 1
tikigai Merci Nicolas! First Happy new Year 2020. Very good indicator BUT (yes the french "oui, m...
Nicolas Whats prorealtime version? Did you try in version prior to v11? indicator's call and loop ca...
Nicolas Yes, that's how it goes when using loops..
JosephFelix Hi, Could I please have help with adding these indicators 'on price'? Every indicator that I...
Nicolas Just add it on price by clicking the wrench on the left upper side of the price chart.
Marcos Alvarez Dominguez Hello Nicolas, is it possible to stablish a bullish screener for this indicator when the cen...
Nicolas Please open a topic in the screener section to ask for this specific query.
zaher123 Hello, the indicator doesn't show up anything on the screen, any suggestions please?
Nicolas Apply it on the price chart. The indicator plot just one single line. There are two in the...
jamesoc Hi Nicolas, do you happen to know if there is an indicator that can be applied to charts, to...
gustavobp Buenos dias Nicolas, al agregar tu indicador no me reconoce la variable Price ni en la linea...
tradingpro salve io faccio spread trading e volevo sapere come impostare un profitto da chiudere in a...
Nicolas Per favore non fare domande generali, non correlate al post. Usa invece il forum.
Bard Incredible, that is the clearest depiction of the trend I've ever seen Nicolas. (I just chan...
Appsoluxions Hi Nicolas, do you have the MT4 version of the indicator? I am not sure if these kind of que...
Nicolas Hi, don't have one sorry. But you can still ask for private coding through our programming s...
Appsoluxions Cool. Thanks for the response.
rama I want to use this indicator in trading system, it says zig zag is obsolete and not supported
Nicolas Right, due to its repainting behavior, the zigzag is not allowed in automated trading with r...
rama I noticed it changes as time progress, I am 7 as the average, how many period it wont chang...
Gordon101 Hi when I added your Guppy indicator to my chart it went below the chart beside the oscilla...
Nicolas Add it on the price by using the wrench located on the left upper side of your price chart.
Gordon101 Thanks Nicolas, worked a treat.
Rafa And the PriceMAPeriod? aren´t the same?
Nicolas The PriceMAPeriod is the period to make the average of all the last X medianprice found.
Rafa Thanks a lot Nicolás. Have a nice day
ak5hay2 Works like crazy on bitcoin. Use different timeframes. Thanks a lot Doc!!!
richyowen Hi, great code thanks. Very new to this forum. Is there a way to add a 100point target on an...
lisamitch50 Morning all, Just backtested on quite a few instruments, worked well on backtesting, but tel...
swapping merci gabri, on va le mettre à l'essai ;)
Leo Hi all, I posted a new version of this indicator ( I just add arrows to spot the local maxi...
Trading_En_El_Ibex35 Muchas Gracias por compartir este interesante indicador. Un saludo
xavieralava hola gracias leo
Khaled Thanks, but if I may ask what's EMA Period? The price which reverses the EMA[20] is not the ...
Francesco78 EMA is not a moving average, it is just the name we called the quantity defined above
Khaled My bad. Thank you so much!
rejo007 hello david, i'll try it could you tell me wich strategy do you use in real? thanks
David Somogyi Hello, I have a couple of DAX strategies of breakout and mean reversion. I'll try to post...
Roberto Blázquez Hi David, I just saw your strategy and it's good!!! I'm going to try it from today in real a...
Thomas007 Is there any way to build something similar for FX? I wonder what would be the replacement f...

Top