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
Kris75 Hi Bolsatrilera, I love this indicator! Thanks; => did you develop a strategy around...
KarlBenjamin This "indicator" alone has completely changed my algorithms for the better! Id even go as fa...
ashee CAN YOU SHARE MT4 FILE
coyP Big thanks ! Can you explain me how can I put this ON my graph and not under the graph please ?
Wing There's a few threads on the forum about backtest and live trades being different at times. ...
ET I agree with verdi55. As it is now, the code will only test for a breakout on the upside (li...
Philipjonasson are u still active Wing?
Nicolas We do not offer free assistance for TOS. However, you can send demand for private paid codin...
phanz Hi community. May I know how you use this indicator please? Is it on the zero cross over? ...
sydney43025 Hello, I'm digging up this topic because I uploaded the code on a PRT v11.1 but the indicato...
David Balance thanks for sharing this excellent indicator.  Here are some thoughts.  please ad...
supertiti Il manque 2 slash devant len dans le code dur car la variable ne marche pas bonne journée
majid52026 Hi I want MBXF Timing for mq5 Does anyone have this indicator???
dertopen Hi Nicolas good work for the code translation when i chek the mbfx system site i see in t...
Nicolas Yes, just change the color by yourself in the indicator settings window.
bearbull As per PhilipSchultz question above, has anybody managed to add code for when it turns blue,...
Ybr35 Bonjour Nicolas, lorsque je lance l'indicateur, il m'est indiqué que je dois définir les var...
Nicolas L'idéal est de télécharger le fichier itf joint sur cette page et de l'importer dans la plat...
Nicolas Merci dans ce cas d'ouvrir un sujet dans le forum ProScreener svp.
Andrea Hi Nicolas, thx for your code. Please i need your help to understand this part of your code:...
Nicolas the MA200 is ascending since 20 periods.
Leo Hi Gabri, have you ever try this in a trading system?
gabri Leo, I used to crosscheck this indicator a long time ago. For the trading I was doing at tha...
Nolubok Bonjour Gabri, merci pour l'ensemble de vos publications, serait il possible d'avoir le scr...
David Somogyi Hello, This is merely a filter indicator for measuring high fractality, which helps to av...
bertrandpinoy bonjour ce code fonctionne toujours?
Nicolas Faites un backtest, vous aurez des réponses.
Krallenmann Hallo Nicolas, kannst du mir die Regeln für den Halftrend Indikator sagen? Aus dem Code kann...
davefransman Dear Nicolas, i want set a alert on the "HalfTrend "custom moving average" met Heikin Ashi w...
Nicolas Please post the question in a new forum topic, that would need custom coding I believe.
Sofitech Ce code n'est valable que sur la V10.3 ? sur le 10.2 il y a une erreur de syntaxe dans le fi...
Nicolas Oui en effet, c'est un indicateur "10.3" à cause uniquement de la mise en forme des courbes ...
Nicolas En effet, c'est le cas si on copie/colle le code. Ces 2 variables sont inscrites en externes...
Salocin Hello Nicolas, my french is not that well. It occurs an error which can not be solved by cop...
Nicolas Just download the ITF file and import it into your platform, follow these easy steps: https:...
Nicolas
7 years ago
Holt EMA
Holt EMA
1
Indicators
robertanthonyuk Hi,What do the each colour represent? Rob
Nicolas You'll need to preload bars to get the good calculations of you indicators. I did not test i...
David Nicolas I tried DEFPARAM Preloadbars = 5000 And still the same drawn output of entries/exit...
marcara Hi, Thank you very much for the Moving Average Daily indicator, I am using it as indicator i...
Nicolas Je l'ai converti depuis un code pinescript. De mémoire il s'agit bien d'une variation d'une ...
Captain_Walker @Nicolas, I've copied your code into PRT indicator panel to create it. When I attempt to sav...
Nicolas Download the itf file and import it.
Nicolas Please post any question on forums, thanks.
Lavallette Bonjour Nicolas. J'utilise la version 11 et moi aussi j'ai une ligne horizontale malgré l'a...
Nicolas il faut modifier la ligne 20 avec: if adaptive=1 and averagePeriod > 1 and barindex>(...
dakaodo Hi, Wilko. Acc to the original FRAMA paper by Ehlers, Ehler's own code only takes inputs for...
dakaodo For reference, here is Ehlers' original paper: http://www.mesasoftware.com/papers/FRAMA.p...
dakaodo Here is the code with only SC included, per ETFHQ. pri=customclose //len>=4, even on...

Top