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
Jan
5 years ago
Kovit Hi guys, please could someone help with a bit of Ichimoku code that will improve performance...
Kovit lol I should be more exact with my wording, more accurately I was looking for an indicator t...
jm121212 how can we change the default settings?
nfulcher Please could someone explain how the following code is calculated:- iDI = TEMA[3](DI[DI2]...
oakenstream Jan, I find sometimes that the priceexit variable is never set. It seems to happen when the ...
Matt66612 I do not understand the first time I launch the backtest I got the same result as you. but ...
darbes Hi How does it go on live ? JC
antonio73 Balmora74, io vedo che funziona anche su timeframe ad 1 minuto con piccole ottimizzazioni, t...
Juananantoniorodriguez hola buenas, a este sistema automático, Cómo se le podría poner un stoploss de beneficio sim...
Exalaxe Hey, i just noticed you optimized this strategy. Could i see your new version, please?
Andrea.1981 sorry i add my code but it not enter why i dont know
Andrea.1981 this is code simply stop , and you can see another version for stop / Codice principale...
AntoGH how did you backtest it ?
PastaPesto @AntoGH , I dont know if you are asking me, but my backtest was made in an IS of 4 years bet...
Ridder @PastaPesto Do you still running this and how is the results? Thanks
avatar
unkown ;-) sfido chiunque a riuscirci!
avatar
unkown infatti basta leggere i post degli altri....
nicola papangelo ciao Francesco vorrei contattarti su facebook o in privato. Grazie
Francesco78 @nicola onestamente non ricordo se lo avessi scelto anchored or ananchored.
debs83 Is this strategy standing for DAX please?
Nicolas Title says that it is for Hang Seng
juanj @Holy Grail, glad you like it. Would you perhaps mind sharing your results here: https://www...
CaptainCaveman I am reluctant to say this buy I was a member of Dr Elder trading group for a while . The fa...
micquan The design is too complex and the performance is low.
Janfi Hello, I'm new to ProRealCode and I do not understand the following summation[n](indicator...
Kaci It seems he's just checking that the previous MACD is < 0 for maximum one period ? I'...
Daniel Martin Hi do you know how have and entry after the second cross? There is crosses below 0 and cross...
Maik2404 wie kann ich den Code bekommen Paul?
jens_kittner Works with US Crude at 1h as well!
Jean-Claude REGIS Je préconise de regarder les graphiques H1 et M15 pour visualiser la tendance de fond et d'...
Maik2404 es sind leider nur long Positionen und keine Short zu erkennen.
Maik2404 Vytautas: es bleibt aber nur bei long Auslösungen
ullle73 this one is not a winner, have backtested it on almost all pairs, does not have an edge
Paul the last update can be found in topic Strategy DayOpen Straddle for DAX on page 14.
bertrandpinoy l instruction GRAPH pose problème sur PRT... pas vous? cordialement
Nicolas Supprimer simplement les lignes avec GRAPH pour passer en ProOrder, trading live.
Nicolas Thanks for the update David!
sublime06 quelle parametre utilisé vous pour obtenir ces resultat ? merci
ullle73 you still use tihs one David?
Juan Salas Hi FULVIO09, Nice piece of work. It seems to work very well. Does only work for INDEXES??...
Johann Hi @FULVI09, I understand the instructions however I'm not too sure how to determine the "p...
Player8520 Hello, It doesn't work with me either. However, I changed AA to 180 on line 15, added th...
TraderFelix
6 years ago
Bebbo Thank you for your contribution. I have tested your system on some instruments and I like i...
bertrandpinoy bonjour j ai tente l installation mais PRT m indique que ce code ne peut etre utilisé qu en ...
Nicolas en effet, il faut utiliser l'éditeur de code ProBacktest, il ne s'agit pas d'un indicateur m...
odin i use it on daily Chart only. i use it on stock market for long only startegies. i´m no fan ...
noisette Hi Odin, Thank you for the code. I made sone test with M1 timeframe and results have to be ...
Onega Sorry, a quick question I cannot see on forum please ?...Using ProScreener, how can we get t...
Xusto Hello, Fully Agree, I will update it with your advice. Btw Can would you like share you co...
Niklas johansson hägglund do you now if it's possible to use this strategy with this code in tradingview also?
Alexander9 This code for metastock ?, can for amibroker . Thanks
Leo Does it opens pending orders?... maybe they were not trigger.
Mattzi Dont know, all i can see is that it opened an order yesterday in backtest but not live. Th...
Jean-Christophe Hello Leo, when running the strategy from 29/12/2015 to 31/08/2018 on ProRealTime Premium, I...
Petersson Kristian Hi when I do back test I get 0 results, what do I do wrong? Trade Well Chris
JohnScher Yes i did before, see library/strategys/repulse and dpo https://www.prorealcode.com/proreal...
JohnScher Don't know what you're doing wrong. Import ITF and observe time zone settings. This should...

Top