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
BaderBader Good day davidelaferla, Thank you for making your strategy available to the community, I do...
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 ...
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...
thomas2004ch What are the values for nbx, nby, pbx, pby, ptsup, stplos, stptg, tp, vsmax, vsmin?
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
Darren Nash I found this works well on the DOW
thomas2004ch Hi John, Is your strategy suitable for daily SPY? Regards
gatowman Hi, ich bin leider Anfänger, habe den Code zwar importiert, aber scheinbar läuft er nicht au...
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
FXmike hey my friends, thank you for this great code. my problem is he make no trade open. backtest...
FXmike Can i put a Action that my start contract is smaller than 1 ? 0.3 or 0.5 ? In wich Position...
phoentzs I wrote the code for M15 back then and also variants in H1 and M1. Everything works so far....
Jan Wind Thanks for sharing ! The Gain/Loss ratio is a bit low, 1,16, hardly offset the risks take...
drive whats the period ?
Lucas0000 Hola. estoy buscando un programador en proorder, para hacer un programa basado en el Q-trend...
Ludwig Bonjour Merci pour le code, je souhaite intégrer un break even et mette en place un réinves...
superfalcio hello, this strategy is pretty interesting, anyway on index after diferent suggestion and im...
Fralex Hello everyone I optimized the original “LongOnly-DAX-4H-TMA-Channel” algorithm over a pe...
Dom Hello, hello....je commence le trading et découvre par la même occasion le codage....et ce n...
Nicolas Merci, ça fait plaisir !
Be-n Bonjour tout le monde ! Dans l'indicateur de tendance, j'ai du mal à saisir la nuance entre ...
YvesRobert @robertogozzi. It's done. Thank you
YvesRobert Hello Roberto, some questions about your strategy. 1 - Do the 2 lines SET TARGET pPROFIT T...
robertogozzi 1. The 2 lines SET TARGET pPROFIT TP and SET STOP pLOSS SL are always executed, each bar. Bu...
avatar
Anonymous Hi robertogozzi - thank you very much for sharing this strategy. I have performed various ...
robertogozzi Thank you samsampop.
Dotan Hello guys I really appreciate this coding effort but can I use this code for Mt5 Forex Trad...
Gubben So far so good. After a long drawdown it was winning four times in five weeks. Since 24 jul...
pat95162 Salut Pourquoi je n'ai pas les même résultats que vous
UkCoopDownUnder Any hints for us, on which variables we should be optimising ? As of November 2020, the cu...
Peter I recognized a possible problem with the timeframe / Defparam variables. As far as I know, t...
superfalcio Hello Peter, it is long time i have been watching this strategy, very good and interesting ...
Peter I indeed do have different modified strategies in the market. In the past my variants perfor...
JJ Tec Hola. Me gustaría contactar contigo para ver la estrategia..
nilsla1981 Has someone already tested in real ?
Lucas0000 Hola. estoy buscando un programador en proorder, para hacer un programa basado en el Q-trend...
JOKAMAURICE Thank you but I don't really understand. The values don't fit with what I see on my chart. I...
Alberto Aguilera Hi! Thanks for your strategy Anyone can check it with 200 bars?
TempusFugit Hi, this simple system for DOW and only shorts has worked quite well, maybe because of its q...
phoentzs Unfortunately, I never pursued this strategy further. Maybe I should take a look with what ...

Top