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
Nicolas
11 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?
Nicolas Je ne rencontre pas ce problème avec le NASDAQ par exemple, ce serait plus simple d'ouvrir u...
YvesRobert Bonjour Nicolas, en effet ca marche, je me suis trompé, j'ai bien tout le tracé. C'est parce...
oliTR Bonjour, les conditions longCond et shortCond ne contiennent-elles pas une condition qui s'a...
JohnScher Short variant, see at https://www.prorealcode.com/topic/late-lunch-trade-dax40-strategy/
DANY Hi JohnScher, Thanks a lot for your contribution. Consider this release to avoid overfit...
JohnScher Thank you so much for exploring the Late Lunch Strategy. For discussion and in answer to yo...
BenJuice JohnScher, merci de partager ta stratégie. Je suis nouveau dans ce domaine, sur ton code q...
JohnScher As a percentage of the price, here 2%. StopLoss as well as TargetProfit. SL and TP come ...
Wilko I absolutely love the simplicity of this mean-reversion strategy. Well done!
Patrice210 bonjour STANKO, effectivement la première ligne apparait en anomalie et je ne comprend pas v...
KumoNoJuzza Hi guys, Thanks @Stanko and everyone for your contributions. I have been playing around ...
Stanko Hi KumoNoJuzza, thanks for the post. I also tried your code with Dax and the performance is ...
snucke i dont think you understod the question. i did not ask about the band pass indicator. i as...
thomas2004ch Hi, Is this startegy suitable for daily SPY? Regards
ebous64 Je cherche à traiter des effets de bords avec un encadrement ajustable des variables. Vous a...
Jiacky
2 years ago
Kalman Filter
Kalman Filter
0
Indicators
JohnScher Postscript: It's running in the live right now. One position after the other is opened. ...
ullle73 nice!! how's it been since your last post on going live? :)
thomas2004ch Hi, Is this strategy suitable for daily SPY? Regards
wally Hola soy nuevo en el mudo robots. Alguien seria tan amable de poner el archivo itf.file ya q...
Darren Nash I found this works well on the DOW
thomas2004ch Hi John, Is your strategy suitable for daily SPY? Regards
Stenozar Hi Sever, how can I visualize the coloured areas?
Sever Hi Stenozar, You need to add the color zones yourself , just go to Add Color Zone To set ...
atlante hi nicolas this indicator have 2 wrong borderline and islalastbarupdate. thank you can you h...
Nicolas That'"s because you are not using PRT v11? Just remove lines 59 to 62
Kanamax Hi Roberto, sorry for my confusing previous posts (forget them). My request is very simple,...
robertogozzi Please start a new topic in ProOrder support.
robertogozzi There you go: myMagicTrend = CALL “Magic Trend custom”[20, 14, 1, 5] alpha = 105 b = 0...
johann8 exactly :) Thank you all for the help!
max_92 Ciao Roberto, ho scaricato l'indicatore e come ti avevano già scritto sopra anch'io vedo la ...
cdc.andersson Hello, I´m trying to paste the code and start testing but can´t get it to work in PRT. Shoul...
Lupo32 Thank You Aaron
superfalcio I'm having no more issue on the new Prorealtime release 11.1

Top