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
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.
Iván
1 month ago
cjr30 Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
groelandes Gracias!!
WhyAskOZ i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...
Iván
1 month ago
Madrosat Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Iván Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
Iván
2 months ago
Fgats quelques explications en Français ici : Some explanations in French here : https://www.p...
Nicolas Merci pour cette contribution, j'apprécie ! :)
Fgats Merci Nicolas pour ces encouragements et merci aussi pour le commentaire en Anglais accompa...
Alai-n I really like it when you develop ideas around price movement! I am much less a fan of all t...
elcortijoverde Muy buen trabajo.Intuitivo y claro.Gracias por tu dedicación y aportación.
Nicolas
8 months ago
B-Xtrender
B-Xtrender
7
Indicators
Fgats I suspected something like this but in the PRT documentation I couldn't find anything to exp...
616248 Bonjour Nicolas, Peux tu nous expliquer le principe de fonctionnement ? Ou nous mettre un...
Nicolas Le lien vers l'article IFTA de l'auteur est dans le post déjà :)
JS
8 months ago
Trendilo
Trendilo
0
Indicators
Nicolas
8 months ago
Anthony2A Bjr, j ai des erreurs sur la ligne 69, 74, 78 et 80. sur drawcandle drawtext et endif. si ...
Lucas0000 Hello, Congratulations on this programming, it seems incredible to me, I am new to this but ...
plbourse Hello, I am trying to use this singal (in fact I have converted it to an indicateur giving B...
BriceE Bonjour Nicolas, Je suis a la recherche d'indicateurs pour me donner la meilleure indicatio...
Nicolas
10 months ago
Maxime Baudin Well done Nicolas, creative!
Stenozar Hi Nicolas, please can you explain how to read/use this indicator? thanks!
FXtonio @RICOU en 1 minutes avec un filtre de tendance ZLSMA 200 et eventuellement un rsi 7 , 69% de...
JC_Bywan For people interested in the screener: https://www.prorealcode.com/topic/screener-buy-sell-m...
octum Gracias NJicolas. Las lineas 35 y 36 dan fallo. (¿Es adrede para iniciados?) Puedes co...
Nicolas Yes, Magic if the variable that contains the value of the line, you can test if it goes up o...
dadah1987 Bonjour Nicolas, merci pour cet indicateur. Utilisant pour l'instant la création simplifié p...
Nicolas Merci d'ouvrir un sujet sur le forum avec une description complète du système.
GustavoLoboOrenstein Is it possible to add histogram with only increasing bars?

Top