HPT Heikin Ashi Smoothed

v10.3
HPT Heikin Ashi Smoothed

This trend following indicator is another attempt to filter the noise of the price by using Heikin Ashi candlesticks construction. This one double smoothed the price information by using 2 set of moving average. Of course, it is lagging but it has the capabilities to reduce considerably the market noises. It can also be used to find turning point of the market or a good way to jump into a trend. Someone ask me recently to convert it to prorealtime, so here it is.

The indicator embed 2 external variables (“long” and “short”) that can be used to be imported into trading strategies to launch BUY or SELL orders on market.

 

 

 

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. Ozons • 04/25/2017 #

    Merci Nicolas pour cet indicateur. Comment puis-je le modifier pour le tracer sous forme d’histogramme linéaire ?
    Exemple : si Candle est bleu => histogramme bleu =1 , si Candle est rouge => histogramme rouge = 1
    Merci Nicolas
     

  2. Ozons • 04/25/2017 #

    //PRC_HPT Heikin Ashi Smoothed | indicator//25.04.2017//Nicolas @ http://www.prorealcode.com//Sharing ProRealTime knowledge//translated from MT4 indicator code//—settingsMaPeriod=6MaPeriod2=2//—end of settingsonce maOpen=Openonce maClose=Closeonce maLow=Lowonce maHigh=Highif barindex>0 thenmaOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriodmaClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriodmaLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriodmaHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriodhaOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2haClose=(maOpen+maHigh+maLow+maClose)/4haHigh=Max(maHigh, Max(haOpen, haClose))haLow=Min(maLow, Min(haOpen, haClose))if (haOpen<haClose) thenExtMapBuffer7=haLowExtMapBuffer8=haHighelseExtMapBuffer7=haHighExtMapBuffer8=haLowendifExtMapBuffer5=haOpenExtMapBuffer6=haCloseM1=weightedaverage[MAperiod2](ExtMapBuffer7)M2=weightedaverage[MAperiod2](ExtMapBuffer8)//ExtMapBuffer3=weightedaverage[MAperiod2](ExtMapBuffer5)//ExtMapBuffer4=weightedaverage[MAperiod2](ExtMapBuffer6)endifIf M1>M2 THENBAISSE = 1ELSEBAISSE = 0ENDIFIf M1<M2 THENHAUSSE = 1ELSEHAUSSE = 0ENDIFRETURN HAUSSE as “HAUSSE”, BAISSE as “BAISSE”

  3. Stenozar • 04/25/2017 #

    Hi Nicolas, I tried to put the indicator but candles result mashed. How can I solve this problem?
    Thanks
     

  4. supertiti • 04/25/2017 #

    Bonjour Nicolas,
    les signaux sous forme d’histogrammes dans ton code ont 1 bougie de retard !?
    Le code de Ozons donne le même timing que les HA
    As tu une idée d’où vient ce décalage ?
    bonne journée

  5. supertiti • 04/25/2017 #

    Pour ceux qui veulent jouer avec les moyennes mobiles :
    // HA HPT Smoothed PRT indicator 25.04.2017
    // Nicolas @ www.prorealcode.com Sharing ProRealTime knowledge
    // translated from MT4 indicator code

    once maOpen=Open
    once maClose=Close
    once maLow=Low
    once maHigh=High

    if barindex>0 then
    maOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriod
    maClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriod
    maLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriod
    maHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriod

    haOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2
    haClose=(maOpen+maHigh+maLow+maClose)/4
    haHigh=Max(maHigh, Max(haOpen, haClose))
    haLow=Min(maLow, Min(haOpen, haClose))
    if (haOpen<haClose) then
    r=247 //0
    g=255 //191
    b=0 //255
    ExtMapBuffer7=haLow
    ExtMapBuffer8=haHigh
    else
    r=0 //255
    g=191 //10
    b=255 //0
    ExtMapBuffer7=haHigh
    ExtMapBuffer8=haLow
    endif
    ExtMapBuffer5=haOpen
    ExtMapBuffer6=haClose

    //ExtMapBuffer1=weightedaverage[MAperiod2](ExtMapBuffer7)
    //ExtMapBuffer2=weightedaverage[MAperiod2](ExtMapBuffer8)
    //ExtMapBuffer3=weightedaverage[MAperiod2](ExtMapBuffer5)
    //ExtMapBuffer4=weightedaverage[MAperiod2](ExtMapBuffer6)

    ExtMapBuffer1= average[MAperiod2,m](ExtMapBuffer7)
    ExtMapBuffer2= average[MAperiod2,m](ExtMapBuffer8)
    ExtMapBuffer3= average[MAperiod2,m](ExtMapBuffer5)
    ExtMapBuffer4= average[MAperiod2,m](ExtMapBuffer6)
    endif
    DRAWCANDLE(ExtMapBuffer3,ExtMapBuffer2,ExtMapBuffer1,ExtMapBuffer4) coloured(r,g,b)

    // short = ExtMapBuffer7[1]>ExtMapBuffer8[1] and ExtMapBuffer7[2]<ExtMapBuffer8[2] and ExtMapBuffer7[0]>ExtMapBuffer8[0]
    // long = ExtMapBuffer7[1]<ExtMapBuffer8[1] and ExtMapBuffer7[2]>ExtMapBuffer8[2] and ExtMapBuffer7[0]<ExtMapBuffer8[0]

    RETURN customclose as \" customclose \" // , long as \"long signal\", short as \"short signal\"

    // Variables :
    // MaPeriod = 6
    // MaPeriod2 = 2
    // m = timeserie
     

  6. Stenozar • 04/25/2017 #

    Hi Nicolas, can you help me with this indicator?
    Thanks,

  7. leyoy • 04/25/2017 #

    Merci pour le partage, super indicateur :)Petite question : j’utilise une moyenne mobile simple … le soucis c’est qu’elle apparait derrière l’indicateur HPT Heikin Ashi Smoothed alors que j’aimerais qu’elle soit en premier plan. Est-ce possible de la faire passer devant sur PRT ?Merci par avance pour vos réponses. 🙂

    • Nicolas • 04/25/2017 #

      Placer d’abord l’indicateur puis la moyenne mobile sur le prix, ça devrait la placer devant. 

  8. leyoy • 04/25/2017 #

    Merci Nicolas … des fois on se complique les choses ! Ca marche nickel 🙂

  9. finplus • 04/25/2017 #

    Bonsoir. Merci pour code très intéressant. Juste une petite chose : j’utilise également l’indicateur trouvé sur ce site “better bollinger bands”. or, il se trouve qu’avec le heikin ashi smoothed, en phase de hausse, les cours se retrouvent sous la courbe centrale et en phase de baisse, les cours se retrouvent sur la courbe centrale. Serait il possible alors d’essayer d’aménager en conséquence l’indicateur “better bollinger bands” afin de trouver une certaine cohérence avec le heikin ashi smoothed? Merci d’avance.
     

    • Nicolas • 04/25/2017 #

      Forum svp, avec des images pour bien expliquer merci 🙂 

  10. finplus • 04/25/2017 #

    oui bien sûr j’ouvre le sujet immédiatement.
     

  11. denmar • 04/25/2017 #

    Hi Nicolas
    Any chance you could please modify the code slightly for me? I would like it if the longer term MA was smoothed (6 periods) and if you could suppress the wicks ie only plot the body.  Thank you.
     

  12. leyoy • 04/25/2017 #

    Salut Nicolas, j’ai un petit soucis d’affichage : quand je lance PRT tout le graph est condensé et je suis obligé à chaque fois de jouer avec les bords du graph pour le remettre correctement.C’est du au long/short signal de ton indicateur représenté par un trait (trait blanc sur le screenshot) : du coup l’ecran de PRT prend en compte le graph + ce trait qui est tres tres tres bas par rapport au prix et donc on a ce condensé au lancement ou au changement d’unité de temps.
    Possible de corriger ça ?
    Lien image : http://hpics.li/df46769
    Merci beaucoup 🙂

    • Nicolas • 04/25/2017 #

      Dans les paramètres du prix, tu choisis une mise à l’échelle verticale basée sur le prix uniquement.

    • leyoy • 04/25/2017 #

      oh yes … ca marche nickel, je ne connaissais as cette fonctionnalité de PRT. Encore merci 🙂

  13. ade1 • 04/25/2017 #

    Hullo Nicolas,
    when i put the indicator on my chart ,it comes as an indicator below the chart like RSI or MACD.How do i put it on the price chart.
    Many thanks
    Adrian

    • Nicolas • 04/25/2017 #

      Apply it on price instead with the wrench on the upper left side of the price chart.

  14. ade1 • 04/25/2017 #

    thankyou

  15. Gennadiy • 04/25/2017 #

    Thank you, very much, Nicolas, for this wonderfull Indicator! I have a question. I have added colored lines to see “ExtMapBuffer1” and others. And i saw, that the short-candle doesn’t have “low”, that should be becouse of “ExtMapBuffer1”-Line. Shold something be added to the code?

  16. Gennadiy • 04/25/2017 #

    Here is my code: RETURN long as “long signal”, short as “short signal”, weightedaverage[MAperiod2](ExtMapBuffer7) as “ExtMapBuffer1”, weightedaverage[MAperiod2](ExtMapBuffer8) as “ExtMapBuffer2”, weightedaverage[MAperiod2](ExtMapBuffer5) as “ExtMapBuffer3”, weightedaverage[MAperiod2](ExtMapBuffer6) as “ExtMapBuffer4”

  17. Gennadiy • 04/25/2017 #

    Here is the link to the image: http://ipic.su/img/img7/fs/Candle.1503737934.png

  18. cfta • 04/25/2017 #

    Nicolas, what adaptions do we need to make to use this indicator in a strategy code, how do we set the contiditions? I have tried a few variants using “long signal” and “short signal” and also tried to change the code to return indicator with a 1 or -1 value but don’t manage to make it work.

    In addition if using the code for a strategy we can delete all the lines relating to drawing candles instructions to speed up calculations but which ones should we remove?

    • Nicolas • 04/25/2017 #

      you can remove line 48. Using returned variables ‘long signal’ and ‘short signal’ should work in a strategy. When one is true, it returns 1, while it returns 0 if not.

    • cfta • 04/25/2017 #

      Thanks Nicolas 🙂 It turned out I needed to remove line 48 but also a few more, earlier I removed either too many or too few but now I got it right and adapted it to a histogram version returning either 1 or -1 (I didn’t figure out how to use “long signal” and “short signal” most likely due to my lack of knowledge). Anyway here is the adapted code in case anyone finds it useful;

  19. cfta • 04/25/2017 #

    //PRC_HPT Heikin Ashi Smoothed | indicator
    //25.04.2017
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge
    //translated from MT4 indicator code

    //—settings
    //MaPeriod=6
    //MaPeriod2=2
    //—end of settings

    once maOpen=Open
    once maClose=Close
    once maLow=Low
    once maHigh=High

    if barindex>0 then
    maOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriod
    maClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriod
    maLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriod
    maHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriod

    haOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2
    haClose=(maOpen+maHigh+maLow+maClose)/4
    haHigh=Max(maHigh, Max(haOpen, haClose))
    haLow=Min(maLow, Min(haOpen, haClose))
    if (haOpenExtMapBuffer8[1] and ExtMapBuffer7[2]ExtMapBuffer8[0] then
    indicator1=-1
    endif

    if ExtMapBuffer7[1]ExtMapBuffer8[2] and ExtMapBuffer7[0]<ExtMapBuffer8[0] then
    indicator1=1
    endif

    RETURN indicator1

  20. Alexandre AMARY • 04/25/2017 #

    Bonjour,
    Je ne comprends pas pourquoi les bougies rouges n’ont jamais de mèche basse, contrairement aux mèches bleues qui elles disposent de mèches hautes et basses.
    Est-ce normal ?
    D’avance merci pour tes éclairages !
    Et merci pour ce superbe indicateur
    Alexandre

    • Nicolas • 04/25/2017 #

      En effet, déjà discuté et modifié dans ce topic: https://www.prorealcode.com/topic/heiken-ashi-smoothed-code/

    • ALAM • 04/25/2017 #

      Merci Nicolas, j’ai bien trouvé la version corrigée de l’indicateur. Un grand merci pour ton partage de connaissances sur cette plateforme.
      Alexandre.

  21. Alexandre AMARY • 04/25/2017 #

    Pardon…
    “contrairement aux bougies bleues”

  22. jwebster2 • 04/25/2017 #

    HI Nicholas….Can I use this indicator on 30sec/1min timeframes? Also do you have a simple Heikin Ashi chart I can import into IG pro real time to use in the low time frames for scalping ?

  23. jwebster2 • 04/25/2017 #

    Hi Nicholas.. please ignore previous comment .. as I have located it… !

  24. Yvan63 • 04/25/2017 #

    Bonsoir,
    Je ne comprends pas comment la variable HaOpen prend sa première valeur vu que ExtMapBuffer5 n’a pas de valeur au début du programme ?

  25. laitus • 04/25/2017 #

    Bonjour Nicolas et collègues, ¿est-il possible d’appliquer la HAS non pas sur le prix mais, par exemple sur une moyenne mobile? Je sais que sur une plate-forme, vous pouvez mais je ne le trouve pas sur celle-ci. Merci d’avance.

  26. PhilipSchultz • 04/25/2017 #

    Hi Nicolas, do you know if I Can backtest this indicator. For example. When it turns blue, enter long. And for red enter short?

    • Nicolas • 04/25/2017 #

      By learning to code, or by asking for other people to do it for you in the forums.

  27. bearbull • 04/25/2017 #

    As per PhilipSchultz question above, has anybody managed to add code for when it turns blue, enter long. And for red enter short?…..I would be very interested in this additional code to the HeikinAshi smooth

  28. Ybr35 • 04/25/2017 #

    Bonjour Nicolas, lorsque je lance l’indicateur, il m’est indiqué que je dois définir les variables MAPERIOD et MAPERIOD2….pourrais-tu m’aider à ce ce sujet? Merci beaucoup.

    • Nicolas • 04/25/2017 #

      L’idéal est de télécharger le fichier itf joint sur cette page et de l’importer dans la plateforme pour bénéficier du code complet.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+10 more likes

Related users ' posts
manchokcity can we have it in mql4 platform? or how or which platform do we use it?
camporan I don't use MetaTrader so I won't be able to do the translation myself. Sorry!
Alexander9 This can for amibroker ? . Thanks
riz001 thnk u
geroniman bonjour Nicolas, j ai un indicateur le Tiger . J aiemrai placer des fleches buy et sell dire...
Nicolas Merci de formuler les demandes sur le forum. ça n'est pas le bon endroit et hors sujet ici ! ;)
avatar
Anonymous Hi robertogozzi - thank you very much for sharing this strategy. I have performed various ...
robertogozzi Thank you samsampop.
Dotan Hello guys I really appreciate this coding effort but can I use this code for Mt5 Forex Trad...
LucioleLucide Clean view, thanks for sharing
dertopen hi where i can found the window for candle configuration?
paolosab69 Ciao! . I have seen the pictures that explain this metod but i don't understand when is mome...
Alberto Aguilera Hi! Thanks for your strategy Anyone can check it with 200 bars?
TempusFugit Hi, this simple system for DOW and only shorts has worked quite well, maybe because of its q...
phoentzs Unfortunately, I never pursued this strategy further. Maybe I should take a look with what ...
robertogozzi It surely CHANGES even when currently outside time range, as the lookback periods change as ...
SkippyTrader Thanks Roberto, but shouldnt the values in the outside time range not be different? As it sh...
robertogozzi Actually it is a constant (I tested them on a 1-hour TF, 9am to 5pm) and outside that time r...
coscar Ottimo lavoro. come sempre!
luxrun Nello studio di Sepiashvili viene descritto anche un altro indicatore, il Q-indicator, che è...
funkystuff Salut Balmora, Ton indicateur est plutôt intéressant :) Penses-tu qu'il soit possible de l'...
brian gilbert Hello, can you explain to me what are "pipsize" and "ATAN"? What functions do they have and ...
Bodaris Bonjour, Je suis débutant 1 mois :p pipsize ressemble à la fonction pointsize et ATAN...
darbes Hi How does it go on live ? JC
antonio73 Balmora74, io vedo che funziona anche su timeframe ad 1 minuto con piccole ottimizzazioni, t...
Juananantoniorodriguez hola buenas, a este sistema automático, Cómo se le podría poner un stoploss de beneficio sim...
Maik2404 wie kann ich den Code bekommen Paul?
jens_kittner Works with US Crude at 1h as well!
Jean-Claude REGIS Je préconise de regarder les graphiques H1 et M15 pour visualiser la tendance de fond et d'...
Leo I don't know, I just copy paste the strategy. The optimisation of the values I wrote them in...
bertrandpinoy hello Leo I'm spending time on your strategy code. do you agree to try to include this code ...
bertrandpinoy //version a: ajout filtre MM defparam cumulateorders=false // --- paramètres taille =...
capgros Bonjour @Nicolas, Thanks a lot for this tool, it is very useful for me. I would like to s...
Hans63 Would you add the possibility to color also the Heikin Ashi and bar chart?
Nicolas That's possible, please open a new topic in the indicator forum explaining what you need exa...
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...
mit_ose Bonjour, J'ai d'excellents résultats avec cet indicateur simple et efficace; Merci beaucoup;
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.
Nicolas
6 years ago
BSTrend
v10.3
BSTrend
10
Indicators
Florian Legeard C’est à dire sur le prix et non sur le temps ? Merci
Rohit82189 bstrend repaints
Nicolas No, it doesn't repaint.
cfta Hi Fulvio, many thanks for sharing this clever indicator, much appreciated. As Pepsmile ment...
cfta Sorry adding the PRT to code didn't work in the above comment so I guess we will have to set...
juanj Something appears to be wrong with this formula as graphing t shows t to almost never be wit...
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...
Nicolas
7 years ago
Maxime Baudin Interesting, Thank you! :)
franck-david Bonjour Nicolas , actuellement je me forme grace a vos videos tres tres bien expliques mer...
Nicolas Merci. ça n'est pas le lieu pour poser ce genre de question :) Merci d'utiliser le forum Pro...

Top