Dax survivor long/short mean reverting/breakout

Dax survivor long/short mean reverting/breakout

Dear all

I have tested a slight variation on the them of my previously described strategy on short TF.

This time I took a very long timeseries, used Daily timeframe and modified the exit strategy in term of number of bars, all is optimized with Reiner’s seasonal parameters

Although the return of 180%  with a drawdown of  ~20k on a such a long timeseries is not great, I though it was worth posting because of the ability of this strategy to survive all the 1998/2001/2008 shocks and because it’s relative smoothness.

Any idea to reduce the drawdown even more would be greatly appreciated.

Best Regards

Francesco

 

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. Cosmic1 • 04/29/2017 #

    Hi Francesco, thanks for your hard work. I have been playing around with your strategy but can’t get an IN/OUT /WF sample to work. The best I can get is either a slight decline, flat or very slight profit on the out sample for the last period and no where near 50% efficiency. Did you test in this way, what are your views?

  2. Francesco78 • 04/29/2017 #

    Hi Cosmic1
    Thank you for your comments.
    what I did is to optimize the code for different time frames, we could optimized in order for the strategy to work for the last 2 years or 5 years, but in my opinion by doing so we will get an insufficient number of trades in order to make the sample statistically significative.
    From what I remember I agree with you, if you do WF from the beginning of the time series then the last period is flat or slightly negative, if instead you make the optimization starting from more recent time, i.e. 2007 in that case you get an upward slope.
    Id be happy to discuss further.
    Best Regards
    Francesco 
     

  3. keemax73 • 04/29/2017 #

    Ciao Francesco78, i tried to put your strategy in real mode but did not generate any movement.
    What am I doing wrong ?
    Thank you.

  4. Francesco78 • 04/29/2017 #

    Hi Keemax, I dont have it on real at the moment, in any case the strategy is very long term and dont generate a big number of trade so it is reasonable that you dont have any signal if you put it just for few days, I suggest to do a backtesting starting from the day you you have chosen to put in on real and see if there is a discrepancy from back test and real.
    I hope that helps.
    Francesco 

  5. Francesco78 • 04/29/2017 #

    I did a little bit of work on that and now the results looks better and more stable.
    Please let me know what you think!
    Regards
    Francesco 

  6. Francesco78 • 04/29/2017 #

    I did a little bit of work on that and now the results looks better and more stable.
    Please let me know what you think!
    // DAX(mini) - IG MARKETS
    // TIME FRAME 1Day
    // SPREAD 1.0 Point

    DEFPARAM CumulateOrders = False

    //DEFPARAM FLATBEFORE =090000
    //DEFPARAM FLATAFTER =210000
    golong = 1
    goshort = 1
    exitafternbars =1 // the strategy has an exit strategy of the type n bars

    // variables optimized
    adxvallong = 28 // set the adx value for long position under which the strategy is mean reverting and above which the strategy is breakout
    atrmaxlong = 250//set the max vol accetable for long position
    adxvalshort = 20// set the adx value for short poistions under which the strategy is mean reverting and above which the strategy is breakout
    atrmaxshort = 250//set the max vol acceptable for short positions

    along= 30//number of cons bar for a long trade
    mlong = 1// sets the atr multiplier to enter into a mean reverting strategy for long positions
    nlong = 1.2//sets the atr multiplier to enter into a breakout strategy for long positions

    ashort=7//number of cons bars for a short trade
    mshort = 1//sets the atr multiplier to enter into a mean reverting strategy for short positions
    nshort = 2//sets the atr multiplier to enter into a breakout strategy for short positions
    //

    vollongok = atr<atrmaxlong
    volshortok = atr<atrmaxshort
    brekoutlong = marketregimeindicator>adxvallong
    meanreversionlong = marketregimeindicator <adxvallong
    brekoutshort = marketregimeindicator>adxvalshort
    meanreversionshort = marketregimeindicator<adxvalshort
    adxperiod = 17
    atrperiod = 13
    marketregimeindicator = adx[adxperiod]
    atr = AverageTrueRange[atrperiod]

    positionshort = round(1000/atr) //define the size of short positions
    positionlong = saisonalpatternmultiplier*round(1000/atr/2.16666) // define the size of long positions

    // define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade)
    ONCE January1 = -3//3 //0 risk(3)
    ONCE January2 = 2//0 //3 ok
    ONCE February1 = 3 //3 ok
    ONCE February2 = -3//3 //0 risk(3)
    ONCE March1 = 0//3 //0 risk(3)
    ONCE March2 = 3//2 //3 ok
    ONCE April1 = 3 //3 ok
    ONCE April2 = 3 //3 ok
    ONCE May1 = 3//1 //0 risk(1)
    ONCE May2 = 1 //0 risk(1)
    ONCE June1 = -2//1 //1 ok 2
    ONCE June2 = 3//2 //3 ok
    ONCE July1 = -2//3 //1 chance
    ONCE July2 = 1 //3 ok
    ONCE August1 = 3 //1 chance 1
    ONCE August2 = 3 //3 ok
    ONCE September1 = 2//3 //0 risk(3)
    ONCE September2 = 0 //0 ok
    ONCE October1 = 3 //0 risk(3)
    ONCE October2 = 3//2 //3 ok
    ONCE November1 =3// 1 //1 ok
    ONCE November2 = 3 //3 ok
    ONCE December1 = 3 // 1 chance
    ONCE December2 = 3//2 //3 ok

    // set saisonal multiplier
    currentDayOfTheMonth = Day
    midOfMonth = 15
    IF CurrentMonth = 1 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = January1
    ELSE
    saisonalPatternMultiplier = January2
    ENDIF
    ELSIF CurrentMonth = 2 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = February1
    ELSE
    saisonalPatternMultiplier = February2
    ENDIF
    ELSIF CurrentMonth = 3 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = March1
    ELSE
    saisonalPatternMultiplier = March2
    ENDIF
    ELSIF CurrentMonth = 4 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = April1
    ELSE
    saisonalPatternMultiplier = April2
    ENDIF
    ELSIF CurrentMonth = 5 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = May1
    ELSE
    saisonalPatternMultiplier = May2
    ENDIF
    ELSIF CurrentMonth = 6 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = June1
    ELSE
    saisonalPatternMultiplier = June2
    ENDIF
    ELSIF CurrentMonth = 7 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = July1
    ELSE
    saisonalPatternMultiplier = July2
    ENDIF
    ELSIF CurrentMonth = 8 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = August1
    ELSE
    saisonalPatternMultiplier = August2
    ENDIF
    ELSIF CurrentMonth = 9 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = September1
    ELSE
    saisonalPatternMultiplier = September2
    ENDIF
    ELSIF CurrentMonth = 10 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = October1
    ELSE
    saisonalPatternMultiplier = October2
    ENDIF
    ELSIF CurrentMonth = 11 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = November1
    ELSE
    saisonalPatternMultiplier = November2
    ENDIF
    ELSIF CurrentMonth = 12 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = December1
    ELSE
    saisonalPatternMultiplier = December2
    ENDIF

    endif

    //long meanreversion
    IF (abs(open-close) > (atr*mlong) and close < open and golong and vollongok and meanreversionlong) THEN
    buy positionlong CONTRACTS AT MARKET
    ENDIF

    // long breakout
    IF (abs(open-close) > (atr*nlong) and close > open and golong and vollongok and brekoutlong) THEN
    buy positionlong CONTRACTS AT MARKET
    ENDIF

    //short meanrevesrion
    IF (abs(open-close) > (atr*mshort) and close > open and goshort and volshortok and meanreversionshort) THEN
    sellshort positionshort CONTRACTS AT MARKET
    ENDIF

    // short
    IF (abs(open-close) > (atr*nshort) and close < open and goshort and volshortok and brekoutshort) THEN
    sellshort positionshort CONTRACTS AT MARKET
    ENDIF

    if exitafternbars then
    IF shortonmarket and BarIndex - TradeIndex >= ashort Then
    exitshort positionshort contracts at Market
    EndIF
    endif

    if exitafternbars then
    IF longonmarket and BarIndex - TradeIndex >= along Then
    sell positionlong contracts at Market
    EndIF
    endif

    p = 6
    l = 7

    set target profit p*atr
    set stop ploss l*atr

    Regards
    Francesco 

  7. Khaled • 04/29/2017 #

    Hi Francesco , thank you for sharing your hard work. Any idea why all orders are executed at 01.00 am (French/Italian time)?
    Thanks
    Khaled

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
stratobast Good afternoon everyone. Thanks Doctrading for your work. I have an issue while using this ...
stratobast My bad guys. I understood what was the problem. The indicator uses highs and lows for the Re...
samwarduk Has anyone tried this on Bitcoin GBP1? The results look amazing but every time mine trie...
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?
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...
ALE
7 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?
JanWd Thank you for the coding, it seems promising. FTSE gives for the short term (5 min) promis...
Jan Wind 21.04.2019: I retested the strategy for the DAX 5 minutes , it works fine for 10.000 bars, b...
bertrandpinoy hello Francesco, are you still working on this strategy?
avatar
bjoern With the same parameters? For me the results are negative
avatar
bjoern Oh ok, with the initial posted parameters it is positive
victormork yes! It's not like you want to put it on live but when I for example take the version I have...
otty82  all right. thanks
mmichael Hello, I noticed that the indicator shows the initial balance of today but also for all the ...
leyoy Bonjour, comment l'adapter sur 15 minutes au lieu de 1 heures ... j'ai changé 090000 par 081...
Derek Nice strategy. Have you tried adding a stop loss since there are a few sharp drawdowns? I ...
Piston_Broke Non so .... da qui la mia domanda iniziale :-)
Piston_Broke Hi Derek. I have tried many different ways to apply SL's to this and similar versions of th...
Nicolas Indeed, if you are not willing to loose, you will always win. Averaging down losers can carr...
David You're always safer going Long especially with averaging down on an index as the probability...
Oskar Bergvall  I noted Davids and Nicolas remarks. Could it be possible to make an indicator for contraria...
Lotar
7 years ago
Nicolas You can send it to contact@prorealcode.com and I'll attach it here. Thanks for your sharing!
Francesco78 Hi Lotar, which variables would you choose to recalibrate it to the present market condition...
Degardin Arnaud unfortunatly in today's market it's not working at all...
Derek Clarification: Automatic rollover will be into the nearest forward but I prefer the farthes...
gatowman Hallo Derek, ich bin neu hier, wo finde ich die beiden Indikatoren? kansst du sie als itf p...
bertrandpinoy BONSOIR j ai tenté votre modification mais PRT ne l accepte pas "erreur de syntax" pouvez vo...
Nicolas it is based on seasonality of DAX.
Luciano Santiago Juárez Hello I am new here I am trying to understand this code IF monthlyMultiplierLong > 0 ...
Luciano Santiago Juárez Sorry the code copied bad the line I dont understand is: ELSIF monthlyMultiplierLong 0 THEN
Wing Yes, investigate as much as you want. For more insight, you can view the linet1, linet2 etc....
CKW Hi Wing, Thanks for your sharing. I am still trying to breakdown & understand your code...
Wing Hello CKW. No, the parameter, 7 in this case, is used when calling the RSI indicator to ide...
Nacho Buenos días Raul, tengo puesto este sistema desde hace unos días en una cuenta demo en la ve...
Dominik Hola Raul ... it looks wonderful :-) Why does it not work if I use less than 100,000 € capi...
Bobbi Hola y gracias por compartir! Descubrí que en 5 minutos teníamos algo muy bueno! Pero no ...
danhei Hi I am tryong to figure out how trist strategy works. I am new to pro real time. Can some...
Plop61 Hello,Thank you for sharing this beautiful strategy.Is it possible to indicate the code for ...
NoName Thank you very much for this fascinating trading system. It is still proving to be extremely...
ALE
8 years ago
pollon Ciao Ale,  anche a me da questo errore  "QQE_QUDAX1HBUY"  "QQE_QUDAX1HSELL"  "UNIV_QUDAX...
reb Hi Ale do you trade these QU strategies?  Are the results same as backtests Thnaks in adv...
avatar
crazytrader Hi anyone that has run this lately?
larouedegann best with this hour IF TIME =081000 THEN plushaut=highest[2](high) plusbas = lowest[2](lo...
CanAny1Trade Hi! I'm trying to put together a similar indicator but struggling. I want to mark the NY Pit...
ALE Hi Pat This code was nothing more than an experiment
pat95162 Hi Ale Do you have same results as me ? The strategy works very well in 2017 and now in 2-...
Nicolas Built on the history means that it suits the history. Always develop ideas in In-Sample peri...
ALE
8 years ago
ALE no, only with TF 15m
enzo_52 Grazie tante, Thanks so much 
JanWd Hallo Ale, First of all, thank you for this strategy. Could you explain what the BLUSTER ...

Top