DAX 5 min automated trading by Andrea Unger

DAX 5 min automated trading by Andrea Unger

Good evening,
this is my first article in this beautiful community, so I hope you will appreciate the content and contribute by giving me suggestions for improvement in my trading!

The strategy based on the 5 min DAX is not mine but comes from a webinar of the famous Andrea Unger; It is based on the breakdown of the maximum or minimum of the first hour of trading (08: 00-09: 00 AM).

The strategy needs the “Dfactor” indicator which is attached at the end of the current post too.

 

 

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. Sofitech • 06/10/2016 #

    Hello and thanks for your article. As i have an import problem on my platform, could you copy/paste the dfactor.itf code in txt here ? So i can create the indicator.

  2. burghy17 (Andrea) • 06/10/2016 #

    Hi sofitech, thanks for your question, here is the code for the Dfactor indicator (really simple)

  3. burghy17 (Andrea) • 06/10/2016 #

    Dfact=0
    dayofw=0

    Dfact=(ABS(Dclose(1)-Dopen(1)))/(ABS(DHigh(1)-Dlow(1)))
    dayofw=Dayofweek

    Return Dfact as \"df\", dayofw as \"dayofw\"

     

  4. gianpiero • 06/10/2016 #

    great code…
    also on Cac40 it works very well during the last month…but if you increase the time horizon tends to lose efficacy.I noticed that works well in the bullish phases, so with a filter as a short moving average could improve.
    maybe during weekend I do some testing
    Ciaooo
     

    • burghy17 (Andrea) • 06/10/2016 #

      Thanks Gianpiero for your comment,
      I’ll wait for your improvement !
      Have a nice Week End
      Ciao
      Andrea

  5. makdec • 06/10/2016 #

    Grande Andrea

  6. davidp13 • 06/10/2016 #

    Hi. For some reason I do not get the same trades as you when I test this. What is your timezone set at as this would impact it dramatically? 

  7. burghy17 (Andrea) • 06/10/2016 #

    Hi davidp13,
    I don’t know for wich reason your backtest is so different from that one I posted here; the Time zone I used for this code is CET (Rome).

  8. alfredo • 06/10/2016 #

    Ciao, ma capita anche a voi che sul 5minuti si interrompe spesso e bisogna farlo ripartire?

  9. burghy17 (Andrea) • 06/10/2016 #

    Ciao Alfredo, il problema è nel codice di gestione del trailing stop , ti posto il codice che uso senza tale funzionalità (il backtest non cambia)
    DEFPARAM cumulateorders = false
    DEFPARAM Flatbefore = 090000
    DEFPARAM Flatafter = 220000

    ncontr=2 //n contratti da comprare o vendere per posizione
    x=1 //moltiplicatore della barra della prima ora
    y=0.5 //dailyfactor da utilizzare

    dailyfact, dayofw = CALL \"Dfactor\"
    //mytrailstop=Supertrend[5,20]

    //fiso valore moltiplicatore per determinare il livello di ingresso e del massimo/minimo della prima ora
    moltipl=x

    //individuo maz e minimo prima ora
    if time = 080000 then
    maxprimaora=High
    minprimaora=Low
    endif
    if time > 080000 and time <= 090000 then
    if High > maxprimaora then
    maxprimaora = High
    endif
    if Low < minprimaora then
    minprimaora = Low
    endif
    endif

    // determino i valori di ingresso Long e Short
    delta = moltipl*(maxprimaora-minprimaora)
    ingressolong=maxprimaora+delta
    ingressoshort=minprimaora-delta

    // determino i valori di STOP LOSS sia long che short
    stoplong = maxprimaora
    stopshort = minprimaora

    //verifico innanzitutto che il daily Factor sia minore di 0,75 e che non sia venerdì
    if time <= 100000 then
    if dailyfact < y and dayofw <> 5 then
    // verifico se ho rotto max o min della prima ora
    if High > ingressolong and not onmarket then
    stopl=stoplong
    buy ncontr contract at market
    SET STOP LOSS stopl
    elsif Low < ingressoshort and not onmarket then
    stopl=stopshort
    sellshort ncontr contract at market
    SET STOP LOSS stopl
    endif
    endif

    endif

    ….

  10. alfredo • 06/10/2016 #

    Grazie Andrea 

  11. alfredo • 06/10/2016 #

    Ciao Andrea, l’ho fatto partire con le modifiche che hai fatto ma mi ha aperto una posizione short oggi con uno stop loss a oltre 7000 punti di distanza, possibile?

    • burghy17 (Andrea) • 06/10/2016 #

      Ciao Alfredo, purtroppo ho notato anche io questo comportamento anomalo che in fase di backtest non mi risultava, devo verificare il motivo ….

  12. miguel33 • 06/10/2016 #

    il codice ha dato buoni risultati di guadagno  in reale sul 4 ore .

  13. burghy17 (Andrea) • 06/10/2016 #

    Ciao Miguel,
    si il codice è buono, ma soprattutto la strategia di Unger è molto robusta, purtroppo non ho molto tempo per dedicarmi alla programmazione, e ci sono ancora delle inesattezze nel posizionamento degli stop loss (i valori sono del tutto sballati) …..

  14. miguel33 • 06/10/2016 #

    Si come strategia è da approfondire per migliorarla . In reale per ora mi ha dato ottimi ritorni di gain ma può avere margini di miglioramento straordinari . Anche se mi ha fatto solo trade long . Allego risultato da quando l’ho inserita in reale. 
    Cerchiamo di migliorarla insieme. 
    Buon lavoro 
    miguel 
     
     

  15. miguel33 • 06/10/2016 #

    PS- non riesco a inserire foto . 

  16. Andrea Unger • 06/10/2016 #

    Salve a tutti, mi è stato segnalato questo post e ringrazio l’autore per il lavoro fatto sulla mia strategia. Ero già in contatto con PRT per avere una versione da far girare sulla loro piattaforma ed allego la versione da loro prodotta che corrisponde quasi in tutto ai risultati che ho con il mio codice originale (ci sono solo un paio di punti da verificare su cui i tecnici di PRT stanno lavorando). Per un utilizzo appropriato della strategia vi consiglierei di prendere visione del webinar gratuito dove viene spiegato il processo attraverso il cui è stato creato quel codice:
    versione italiana:  http://bit.ly/PRTIT-1
    Versione Inglese  http://bit.ly/PRTEN-1
     
    Grazie, ciao
    Hi all, this post was notified to me and I thank its author for the work done on my strategy. I was already in touch with PRT to get a version to use on their platform and I attach last version they produced which corresponds nearly completely with my original code (there are only some minor issues on which PRT experts are currently working). To use the strategy properly I would suggest to attend the free webinar where the process to get to that code is explained:
    Italian version http://bit.ly/PRTIT-1
    English version: http://bit.ly/PRTEN-1
     
    Thanks
    Cheers
    Andrea Unger
     
    DEFPARAM FLATAFTER=215500 // replace closetime condition

    RangeMultiplier=0.95
    BegTime=090000
    EndTime=095500

    MyContracts=1

    SkipDay=dayofweek<>5
    if intradaybarindex=0 then
    maxSetup = 0
    minSetup = 0
    dailyfactor = abs(dOpen(1)-dClose(1))<0.75*(dHigh(1)-dLow(1))
    tradethisday=0
    else
    if barindex=tradeindex then
    tradethisday=1
    endif
    endif

    If dailyfactor and Time >= BegTime and Time <= EndTime and SkipDay and tradethisday=0 then
    if maxSetup=0 then
    maxSetup = dHigh(0) + RangeMultiplier * (dHigh(0) - dLow(0))
    slLong=dHigh(0)
    endif

    if minsetup=0 then
    minSetup = dLow(0) - RangeMultiplier * (dHigh(0) - dLow(0))
    slShort = dLow(0)
    endif

    Buy mycontracts contract at maxSetup stop
    Sell at slLong stop

    SellShort mycontracts contract at minSetup stop
    ExitShort at slShort stop
    endif

    If LongOnMarket then
    Sell at slLong stop
    elsif ShortOnMarket then
    ExitShort at slShort stop
    endif

    set stop loss 1000

     
     

    • burghy17 (Andrea) • 06/10/2016 #

      Grazie Ing. Unger per il suo commento e per il suo post, il codice che ho caricato, un po’ più “elaborato” del suo :-)), in effetti nasce dalla visualizzazione del webinar free relativo alla sua strategia; purtroppo non sono un programmatore professionista pertanto ho qualche difficoltà a tradurre fedelmente le indicazioni da lei fornite in righe di codice per Pro Real Time …. il backtest mi da però dei buoni dati in termini di prestazioni; la sto infatti testando in demo …..
      Buona serata
      Andrea B.

  17. miguel33 • 06/10/2016 #

    Non mi sembra migliore il codice , anzi in backtest dal giugno 2012 mentre il precedente ha un guadagno del 122 % questa ha una perdita del 58% . Cosa mi sfugge se leggo che sono simili ?
    Ho tentato ieri di collegarmi al webinar dell’ ing Unger ma non è stato possibile.
    Grazie e buona giornata .
    miguel
     

  18. Andrea Unger • 06/10/2016 #

    Su quale strumento testi il tutto? A me sul future dicembre (ovviamente non dal 2012) da trade corrispondenti al modello originale

  19. miguel33 • 06/10/2016 #

    Ho fatto il backtest sul DAX cash mini  
    purtroppo con l’ipad non mi da la possibilità di inserire le foto dei test
     

  20. miguel33 • 06/10/2016 #

    dott. Unger e’ possibile avere il codice per la MT4 ?
    Grazie .

  21. volpiemanuele • 06/10/2016 #

    Dott. Unger, ma la versione pubblicata della strategia è quella corretta o i tecnici in seguito alle verifiche hanno apportato delle modifiche?
    Grazie

  22. Francesco78 • 06/10/2016 #

    Ciao a tutti, qualcuno sta ancora usando questa strategia? la ho appena testata e mi pare che da Agosto 2016 non stia performando…

    • Gianluca • 06/10/2016 #

      Pare anche a me che non vada un granchè

  23. Francesco78 • 06/10/2016 #

    gira sull 1hr non sul 5 minuti

  24. calefrago • 06/10/2016 #

    Salve,
    ho scaricato la strategia e ho provato a fare un test ma come risultato da 0, devo cambiare qualche impostazione?

  25. pippo999 • 06/10/2016 #

    Someone still using this strategy? Are there any results available?

  26. Valer Rob • 06/10/2016 #

    Andrea, are you still using expert advisor?

avatar
Register or

Likes

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

+15 more likes

Related users ' posts
juanj To follow new developments or get the latest version of this strategy please visit the forum...
tahar Hello Juan, I wanted to test Universal Strategy via a demo account on PRT but nothing happen...
BravoDelta @juanj wondering if you may help me please. I am looking for a simply strategy to use on the...
Doctrading AH ok, I think the ca3 is the same : ca3 = pB[1] < 0.2 and pB < 0.2 Best regards,
chromosome21 Hello everybody, First, thank you so much for all your advices, I'm a begginer in trading a...
bertrandpinoy bonjour j ai un probleme avec ce code modifié, apparement PRT ne veut pas...avez vous une so...
Miguel1980 Hi gabri, I was not asking you to run any backtest but a PRT screener on any market to find...
gabri Miguel, copy. I just came back from vacation, I will pass you some data soon.
gabri Miguel, I will give you some stocks. I would buy (I probably will) Serneke group AB. I will...
andreag76 Thank you Francesco78 !
juanj What happened after August 21?
jpgcreatestrading Hi Manel, i have found this same issue, some strategies (but not all) that are written with ...
Wilko I am not familiar with the screener function, but I am quite certain it should be quite simp...
Gubben @Wilko have you had a look at this again since MTF support? Heard you talk on Börssnack btw..
Wilko @Gubben not really. It was something I posted to show that simpler is usually better. Hope y...
DANY overfit
fatlung Excuse me. I would like to the time zone applied to this strategy.
UkCoopDownUnder Hi, ProOrder does not recognise, "avfullnessthreshold" any ideas, thanks
Francesco78 Hi CKW, yes I do run it live, and so far I had no problem, which kind of errors?
JohnScher Hello Francesco. Are you still active with the Threeliner? I also follow that, that you ...
fatlung Hi Francesco May I know the time zone applicable to this strategy?
gackeen Scusa Pier, scusate tutti, sono nuovo. Ho caricato il file e mi viene restituito il messaggi...
JR1976 HI Nicolas , I tried to copy paste but not import directly and the code works well I hav...
mcosta This code doesn't work on 10.3 platform(IG), neither with copy/paste nor with itf import, an...
Wing There's a few threads on the forum about backtest and live trades being different at times. ...
ET I agree with verdi55. As it is now, the code will only test for a breakout on the upside (li...
Philipjonasson are u still active Wing?
jens_kittner This strategy was posted 2 years ago. I tested it today and it works perfect with the new da...
giustim Hallo I am not able to use it on daily TF What have I to change? Thanks a lot
pac.ros Ciao Francesco, ti scrivo per un aiuto a proposito della strategia di Hofmann che anch'io ho...
nwesterhuijs Thanks, only saw it just now.
juanj For the latest version and discussions see the Ichimoku thread here: https://www.prorealcod...
Louwrens Hi Juanj. Thanks for this. I am tying it as we speak. It does not trade that often, which is...
poonsl2828 Hi! Francesco I have test it on GBP/USD but it only have a trade on 9 Jun which i backtes...
ullle73 why not use 1h chart? has 95% hitrate
ullle73 i see most of positions are only 1 pip before exit?
Nicolas Thanks for sharing your automated trading strategy idea. Even if you accumulate loosing orde...
Maz Ok. Potential here to build onto this. Have opened a forum thread for further discussion: h...
juanj @OGOSNELL, IG recently changed their quote prices for Bitcoin and this caused the strategy t...
juanj Okay, so I revisited this strategy today and it appears to have started working again on the...
Bobbi Bonjour et merci pour votre partage ! J'ai constaté qu'en 1 seconde, on avait quelque cho...
ALE
8 years ago
CSR strategy DAX 1 D
CSR strategy DAX 1 D
17
Strategies
Jesper I tried it on dax 1D and I did not get any trades. Shifted to 10H and it started working. Wo...
rgrgrgr I have the same problem
avatar
crazytrader Is this working?
Francesco78 Hi Pepmartorell, please let's continue the discussion on the forum thread so that we can sha...
Francesco78 Hi Pepmartorell, please let's continue the discussion on the forum thread so that we can sha...
Jusmih1 Hi there, i am looking at your Strategy however when you put in automatic trading mode its ...
reb Hello Marc your strat seems very intersting, will take a look Reb
897148 What exactly is meant by Total price? Is r1 =28 in your example the no of days for "Total P...
juanj
8 years ago
nonetheless Hi juanj , thanks for posting this. I'm with IG and have been trying to run it on US 500 but...
bertrandpinoy bonjour je test le robot sp500 Optimizer stategy. Je ne vois pas le SL dans le code??? merci
phoentzs Hello Juanj, I really like this concept. I especially like the possibility of a reversal whe...
Maz Nice idea thanks for sharing. I think you forgot to simulate spread thought, in the back tes...
Maz https://www.prorealcode.com/topic/ftse-is-lying-strategy-discussion/
Maz Have added a basic framework for further optimization and left some screen shots and source ...
imokdesign Hi Everybody, when I look at the strategy I felt the need to implement a Moneymanagement-Sy...
Inertia newlevel then multiplier=multiplier+1 oldlevel=newlevel newlevel=strategyprofit+startequi...
Inertia Hi Bjoern, I was playing around with your code this morning (EUR/USD 5'). Thank you to the...

Top