DI TEMA Trendfollowing strategy on DAX 5 min

DI TEMA Trendfollowing strategy on DAX 5 min

Please find below a simple strategy based on a combination of the DI and TEMA indicators.

It performs quite well on the DAX 5 minutes (7:00-22:00 trading), for 100.000 bars, spread 5 pips.

Conditions to OPEN positions (see settings in the code)

1 TEMA trend turn into positive (for long) or turns into negative (for short)

2 the DI increases, but starts from below zero (Long) or decreases, but starts from above zero (short)

The only CLOSE conditions are  a Trailing stop loss, whereby the Trailing stop is reduced after 12 trading bars.

I tried it on several indices in different timeframes, I only got good results for the DAX, 5 minutes bar.

Disadvantage of this strategy is the long TTM, Time in the Market, of at least 65 %, obviously also overnight.

As a spread I have taken into account 5 pips, which should include 3 pips for interest to be paid (estimation 4% x exposure 12.000 Euro for 1 contract x 65% in the market / 120 trades per year)

This strategy requires a bit different settings for 2019 alone (for better results) compared to the settings set in the code for the whole period of 100.000 bars. I am (obviously!) looking for automated setting adjustments during different structures of market movements, any suggestions are more then welcome.

Any suggestions for improvement welcome !

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. fatcat • 05/10/2019 #

    Thanks Jan. But unfortunately I cannot confirm your backtesting results! Much worse!

  2. Jan Wind • 05/10/2019 #

    Hallo Fatcat,

    1. Most important: Did you set the trading hours to 7:00 to 22:00 CET, not including the nightly hours ? (Dutch/German time, UK time one hour earlier)
    Go to Options –> Platform Options –> Time Zones and Trading Hours –> (Adjust) trading hours

    2. The results shown are based on a IS 66% / OOS 34%, you can simulate this with varying the TEMA variable (28/30). The results IS/OOS are better than non IS/OOS testing, with the same variable settings, which is weird (I would expect the same results for running the code for 100.000 bars with or without running an IS/OOS, if the only optimised variable TEMA appears to be 28 in both runs)
    Maybe someone can explain or have experienced the same thing ?

    3. The results from half March till May 2019 are not that good, which negatively influence the performance

    Hope it helps you further
    KR Jan

  3. fatcat • 05/10/2019 #

    Sorry, but not working with trading hours 07:00 – 22:00 CET either. Are you sure it is exactly the code matching the results? Can anybody confirm the trading results? Thx!

    • Jan Wind • 05/10/2019 #

      fatcat,
      sorry to hear. Today I did run the code for 100.000 bars (from 17 dec 2017 till 31 may 2019) with no IS/OOS , just run the code and the results are OK

      1 Euro contract on the DAX, with a spread of 5 (!) points to cover the spread plus interest costs for positions overnight
      Period 13 dec 2017 till 31 may 2019
      Exposure +/- 12.000 Euro (1 Euro Dax contract)
      Total Gain 3.566 Euro
      Winning 63%
      Gain/Loss 1,46
      TTM 64%
      Transactions 167

      The last 5 months are showing negative results, however the last trades are winning again.

      Not sure why it does not work with you

      Again I want to mention that Walk Forward (IS/OOS) result with exactly the same setting give much better result, which is WEIRD (4.302 Euro instead of 3.566 Euro)
      I only vary the TEMA value with a variable tt, which can have the value 28 and 29, and run an IS/OOS with 66% IS 34% OOS (just 1 Walk Forward), with appears an optimal setting of TEMA of 28
      KR Jan

  4. nfulcher • 05/10/2019 #

    Please could someone explain how the following code is calculated:-

    iDI = TEMA[3](DI[DI2](close)) //default TEMA 14

  5. oakenstream • 05/10/2019 #

    Jan, I find sometimes that the priceexit variable is never set. It seems to happen when the price immediately goes the wrong way, in my cases always in a short. I cant figure it out, any ideas?

    if tradeprice(1)-MINPRICE >= Factor * trailingstop*pointsize then //if the MFE is higher than the trailingstop then
    priceexit = MINPRICE + Factor * trailingstop*pointsize //set the exit price at the MFE + trailing stop price level
    endif

    ..I tried to use the add code button but it failed for some reason.

  6. Matt66612 • 05/10/2019 #

    I do not understand the first time I launch the backtest I got the same result as you.
    but after impossible to find the same result on the other backtest

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
ferros bonjour , super votre indicateur!!!! est-il possible de l'avoir en histograme +1 /-1 por en...
IV Mcm V2 is coming
SudhirRN is this code working for on tradingview plartform?
Nicolas No. All our codes are made to be used with ProRealTime trading platform: https://www.proreal...
Fabian Hi IV Mcm, have you drawn the rectangles (Dinamic, Range) by yourself in the chart or are...
IV Mcm Myself to illustrate ;)
oraclus Bonjour indicateur très intéressant existe t il un screener qui détecte les actions qui donn...
IV Mcm Ce n'est pas le but de cet indicateur, mais avec un peu d'entraînement vous pourriez le code...
Yantra Thank you for sharing your good work!
Nicolas le code est déjà sur cette page, inutile de fournir un autre format ?! Les fichiers itf sont...
Novice-Surfer Hello IV Mcm, You are my leader ! Your work is incredibly precise, thank you very much f...
Mikolajek Merci pour votre excellent travail !
mickey992 salut merci pour ton partage et ton travaille
patapouf Hi Vivien René I just discovered your “Ordered trend-following stocks Screener”. Great work...
afanitro424 its not plotting on chart but instead as it's own histogram directly below chart? How to fix...
Nicolas by adding the indicator on the chart :)
Nicolas Oui c'est possible. Merci de ne pas poster des demandes qui sont hors sujets. Pour les deman...
Igor Merci pour cet itf. Question : comment faire pour instruire un screener ?
Nicolas tester le croisement du Close avec la première valeur de l'indicateur : "TrailingStop", faci...
Dunstan I would like to get guidance_ How do I access and attach this indicator to my MT5 platform...
Nicolas You can't, use prorealtime, it's way better
jc84 Thank you very much for this indicator , not provided by PRT I was actually working at thi...
Nicolas Oui le code est correct et il fonctionne, j'ai de bons résultats sur la liste NASDAQ par exe...
pincherman Bonjour :-) J'ai coller le script dans prorealtime pour jouer avec le supertrend et j'ai un...
Nicolas Vous l'avez sans doute collé au mauvais endroit, dans l'éditeur de code pour les stratégies,...
IV Mcm Bonjour, Je ne reconnais pas cette ligne dans le code, essayer de télécharger directement le...
Manu L. Bonjour, Possible de créer un screnner multiframe Mois dans Ichimoku semaine dans Ichimok...
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 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...
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...
Nicolas remplacer les valeurs de coloured(0,255,0) par coloured(r,g,b) et ajouter ces noms de variab...
mohamed merci Nicolas!
sacram14 Merci Nicolas pour ce set-up que je ne connaissais pas ! J'ai tenté de reprendre le code pou...
Sapo Thank you very much. as always your indicators are extremely effective. kind regards Vonasi.
mitsu21 Hi, it looks nice. I'll try it tomorrow thank you for your share kind regards bruno
kj1988 Thank you Vonasi for sharing this indicator. Very useful as a comfirmation to the price act...
Nicolas Just add it on the price series.
yomisadiku Hello Nicolas, Can I use high and low price at lines hh=max(hh,close) and ll=min(ll,close) ...
Nicolas Yes you can do that, the impact will be that the trailing stop line will be much close to th...

Top