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?

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

  1. fatlung • 07/23/2019 #

    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 • 07/23/2019 #

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

  3. robertogozzi • 07/23/2019 #

    TZ is UTC+2 (also called CET)

  4. robertogozzi • 07/23/2019 #

    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 • 07/23/2019 #

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

  6. Gaspare • 07/23/2019 #

    Ciao Roberto……ottimo
    si potrebbe avere un TS simile per tradare anche i cfd future americani?
    MINI SP 500 NASDAQ WALL STREET
    Grazie

  7. 25sonalgo • 07/23/2019 #

    grateful if anyone could provide 200k backtest results! thx

  8. robertogozzi • 07/23/2019 #

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

  9. avatar
    Anonymous • 07/23/2019 #

    Hi robertogozzi – thank you very much for sharing this strategy. I have performed various back tests and found that, for my preference, running it on a 5 minute time-frame generates a good number of orders. I also tested the TP for the long and short. For Long I use 75 points and for shorts I use 20, as Governments are manipulating markets to the upside through Quant Easing, the down periods are “bailed out” by central banks now.

    Am now running live on an IG spread betting account, accounting for their DAX spreads and will let you know.

    Thanks once again, super grateful.
    S.

  10. robertogozzi • 07/23/2019 #

    Thank you samsampop.

  11. Dotan • 07/23/2019 #

    Hello guys I really appreciate this coding effort but can I use this code for Mt5 Forex Trading, or does it only apply to Dax and PRC

avatar
Register or

Likes

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

+9 more likes

Related users ' posts
Xenotrax A première vue, sa à l'air d'être un indicateur très puissant sur de petites temporalités, j...
merri Bonjour Nicolas, Comment transformer cet indicateur en bot sur PRT ?
Nicolas Cela a déjà été fait, voir ce sujet: https://www.prorealcode.com/topic/strategia-con-lindica...
Nicolas change the last line with: return v coloured(r,g,b) style(line,2), v+band coloured(168,168,1...
Paolo.B Thanks ... works as i wanted.
Kanamax Bonjour Nicolas, comme Paolo.B je souhaiterais utiliser cette indicateur au sein d'un code. ...
Paris On est bien d accord que l indicateur repeint ....
Nicolas naturellement si la bougie du timeframe supérieur n'est pas terminé
ThePenntChemist Does this show 5min time frame?
zilliq Thanks @Nicolas. I tried to use it as Trend in a proorder system, but don't know why, it doe...
Suzu Yuk He is right. MT and mavgMT are not defined and causing errors.....
RakeshPoluri I have a question about the bands on the candles. Is it bollinger bands or something else?
Nicolas I think that's 2 Bollinger Bands
Emperor.it "style(line,2)" C'è una guida ai parametri che si possono modificare ? Tipo stile della lin...
IV Mcm https://www.prorealcode.com/programming-with-prorealtime/
IV Mcm Good job !
Daniele Maddaluno Écrivez-moi où vous préférez you can easily find me on LinkedIn
AK27 C'est payant visiblement sur linkdin je peux pas vous envoyer, discord vous avez ?
Nicolas C'est dans ce sujet: https://www.prorealcode.com/topic/trendline-une-approche-du-trading/ M...
Pensera Bonjour Nicolas, comment est-il possible de backtester cet indicateur? cela fait une erreu...
Nicolas Oui bien sûr, il doit y avoir pas mal de sujets dans le forum à ce propos.
Nicolas Il doit s'agir d'un mauvais copier/coller. Je suggère de télécharger le fichier itf contenu ...
Bard Hello @Nicolas, I can get this to display in a separate indicator panel but not on Price as ...
Stenozar Hi @Nicolas, how can I put the bands on price? Thanks, Stefano
Guillaume Mcm I gave the above message fix ;)
Tradingrob Is it possible to put the itf-file in the right way here in Prorealcode? so the right 'trend...
Guillaume Mcm Update link ;) https://www.prorealcode.com/topic/trend-histogramme-cci-mise-a-jour-suite-...
Screw27 Hi man, I installed the indicator and i don't know why but my graph it is so big
HelixKing sounds interesting I'll take a look
Godo Bonjour Souhait Sam, Après de nombreux essais pour le mettre en format afin d'utiliser ce c...
Nicolas Il faut supprimer celles qui existent dans la fenêtre d'optimisation et les créer en dur dan...
crusoe76 hi there, anyone can help making this strategy work, i have a message saying replace variabl...
Screw27 Salut nicolas j'aimerais savoir tes résulats grace a cettte methode
eva.g.forsgren It dose not work, I get a strap instead of candels???????????????????????????????????????????
Nicolas That indicator is the one below the chart. The indicator to put on the price chart is this o...
pyhrus P.S : IG , que j'ai contacté ,m'indique que la version V11 , ne sera pas disponible avant un...
Hasardeur Dear Nicolas, is there someting at the arry to modify in order to run the trend at the actu...
MALIMALO Dear Nicolas, just try touse your indicator with backtest but it's not working. is anybody...
Vonasi There are actually two ways to calculate standard deviations and I seem to have used the ver...
segie Can something similar be done with Supertrends?
Vonasi Not sure I fully understand what you are asking for. Are you asking for MTF Supertrend level...
Kris75 very interesting; thanks !
ribes65 Bonjour Nicolas, Merci pour votre travail. Est-il envisageable de créer un screener pour ...
Nicolas Bien sûr, merci de formuler une demande dans le forum des screeners pour prorealtime. En res...
ipbvba Est il possible de le transformer en indicateur (pour ne plus avoir les lignes mais uniqueme...

Top