HLHB Trend Catcher – DAX mtf

HLHB Trend Catcher – DAX mtf

I coded this strategy after reading this website https://www.babypips.com/trading/forex-hlhb-system-explained, where the logic is best described.

Basically it enters LONG when a Fast Ema crosses over a Slow Ema AND Rsi crosses over its mid line. The reverse for SHORT trades.

I used the same settings for Ema’s (5 and 10), while I changed Rsi periods from 10 to 8 because the optimization granted better results. I also optimized TP’s and SL’s.

I coded it on DAX 1-minute default TF and 1-hour TF for signals.

Many inner workings are commented and easy to understand and change.

I will describe what I think deserves a deeper insight:

  • Line 10 sets the default TF (1-minute).
  • Line 12 allows to choose how the Trailing Stop code should behave (0 will use CLOSE to check prices, 1 will use HIGH/LOW).
  • Lines 21-157 allow to choose trading hours, days and months.
  • Lines 160 and 161 are the basic conditions for Long/Short trades.
  • At line 163 TF 1-hour is started, that’s where the signals are returned.
  • Lines 184-190 set data to be used as signals (two Ema’s + Rsi).
  • Lines 192-195 prepare the setup for LONG tradses, while lines 196-200 prepare the seup for SHORT trades.
  • The 1-hour TF has finished its tasks and it’s time to resort again to the default TF (1-minute) at line 202.
  • Lines 203-210 are used to avoid entering again after a signal, if a trade is exited before the next hour begins (the signal is still set, but entering at such a late time may cause SL to be hit).
  • lines 211-230 enter trades and set flag TradeON to 0, to finish what lines 203-210 have started.
  • The last snippet starts at line 233, it’s the TRAILING STOP. Lines 233-343 set the reference to either CLOSE or HIGH/LOW according to one of the first options encountered earlier:
    TRAILSTART         is the number of pips after which trailing starts.
    BASEPERCENT     is the base percentage of profits to be secured when Trailing begins.
    STEPSIZE                is the number of pips needed to increment SL.
    PERCENTINC        is the percentage that BASEPERCENT needs to be incremented each STEPSIZE pips. So that if BASEPERCENT     is 10% initially, after each STEPSIZE chunk will be incremented by this PERCENTINC, if it is 20%, then BASEPERCENT     will rise to 12% the first time, then another 20%, rising to 14.4% the second time and so on… as profits grow.
    PRICEDISTANCE is the minimum distance the broker requires for an instrument when a pending order is entered (I use 7 for DAX, despite it is actually slightly lower).

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?

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

  1. fatlung • 54 days ago #

    Hi robertogozzi, may i know the timezone for this stratety.
    Besides, it would be great if somebody could test it for a longer period.

  2. fatlung • 54 days ago #

    it also seems the take profit for long vs short side is a bit unbalanced. Do you know why?

  3. robertogozzi • 54 days ago #

    TZ is UTC+2 (also called CET)

  4. robertogozzi • 54 days ago #

    I think because DAX is mainly in an uptrend recently.
    I added options to trade both LONG and SHORT positions, you may choose not to go SHORT.

  5. winnie37 • 53 days ago #

    wonderful, thanks a lot Robertogozzi :-). Yes, if we could backtest on 200k, it would be nice !

  6. Gaspare • 48 days ago #

    Ciao Roberto……ottimo
    si potrebbe avere un TS simile per tradare anche i cfd future americani?

  7. 25sonalgo • 42 days ago #

    grateful if anyone could provide 200k backtest results! thx

  8. robertogozzi • 35 days ago #

    No GraHal, there’s no topic open. It would be great if you could start one and post that link here. Thank you.

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
osupero Buenisimo Sr Nicolas, seria posible que sólo marcara por encima o por debajo de una media mo...
osupero https://www.screencast.com/t/1FD7s0YdZ......DE NUEVO MIL GRACIAS
capgros Bonjour @Nicolas, Thanks a lot for this tool, it is very useful for me. I would like to s...
10 months ago
JvdG I meant of course: since ld56 is one of the constituents of ld48;
Nicolas You are right about ld56. Since this is a translation from another programming language, I d...
Florian Legeard C’est à dire sur le prix et non sur le temps ? Merci
eugenio buongiorno paolo , volevo farti i complimenti x il lavoro fatto , funziona molto bene sul 3 ...
Modes68 muy buena estrategia, gracias por compartirla thank yoy for your estrategy, I like me
xpiga Good morning! How do we adjust the code to the different timeframes? You said something ab...
bala Hi Kris, I have imported the screen. I don't see any instrument loaded under this screen....
Kris75 Hi Bala, you need first to install ZeroLagMACDWeek indicator and then add on it the diverg...
berga Hi, thank you very much for this very useful screener. I would like to get another very clos...
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...
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...
1 year ago
Bebbo Thank you for your contribution. I have tested your system on some instruments and I like i...
bertrandpinoy bonjour j ai tente l installation mais PRT m indique que ce code ne peut etre utilisé qu en ...
Nicolas en effet, il faut utiliser l'éditeur de code ProBacktest, il ne s'agit pas d'un indicateur m...
Vonasi Discussion on this indicator/filter can be found here: https://www.prorealcode.com/topic/121...
pableitor Hola Domenec, un indicador muy original y util que ciertamente añade mucha informacion a la ...
Domenec Hola Pableitor porque aqui lo que pretendo es programar un nuevo codigao mas ajustado para q...
Juanjo Hola Domenec. He visto en los videos que hablas continuamente de mercado de futuros con grá...
Nicolas Thank you Xusto. Thank you a lot for your contribution :) Since your code is a Pathfinder'...
Xusto Hello, Fully Agree, I will update it with your advice. Btw Can would you like share you co...
Niklas johansson hägglund do you now if it's possible to use this strategy with this code in tradingview also?
Petersson Kristian Hi when I do back test I get 0 results, what do I do wrong? Trade Well Chris
JohnScher Yes i did before, see library/strategys/repulse and dpo https://www.prorealcode.com/proreal...
JohnScher Don't know what you're doing wrong. Import ITF and observe time zone settings. This should...
Geronima Ortiz I watched the video three times, but I can not put the npips parameter as a variable. I do...
Geronima Ortiz I think the video is for an old version of prorealtime, the images do not correspond at all ...
Nicolas indicator1 = CALL “PRC_StopReversal”[npips, 1] and define npips in the optimization window ...
osupero https://www.screencast.com/t/QmSXRbBR
osupero https://www.screencast.com/t/2fCW8fkGsOeZ....solo posiciones largas por ahora
osupero https://www.screencast.com/t/MIaSZ2PRg
Caribeengeek Bonjour j’avais vu que vous proposiez d’écrire des codes pour ceux qui s’y connaisse pas Mai...
Caribeengeek Les devises unité
Nicolas Merci d'utiliser le forum pour les demandes de programmation personnalisée
winnie37 Merci Nicolas. J'ai un bug d'affichage quand j'utilise ton indicateur. La bougie en cours ...
ullle73 nicolas, can you somehome make this to be in the background of the price chart?
Toto le Heros Thanks Nicolas. I read somewhere that in the calculation, we should round the value of the A...
Nicolas aADX = round(adx[10])
1 year ago
Rainbow Oscillator
Rainbow Oscillator
Maxime Baudin Interesting, thanks! Combine this indicator with the bollinger bands there is enough to make...
JanWd Hey Doctrading, I tried your code, optimising the A and V and the RSI period, see below. ...
Glen Marquis This will work as there is plenty of room for the Target before the Stop, yet the Stop would...
magicT I did a copy and paste of this code and PRT 10.3 returns a synthax mistake: OneTradePerD...
FULVIO09 Attualmente non c'è sufficiente volatilità : la condizione "C0 = AverageTrueRange[1500](Clos...
vlongobardo67 Ma io intendevo in backtest ! Scusa non l’ho menzionato.
ciniselloftse salve fulvio .il trading sistem e sempre profittevole?