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
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
hartgeld Hallo Atxeel, sehr interessanter Code, habe das installiert und funktioniert. Danke! Kannst ...
atxeel Hallo hartgeld, die Ziele sind schlicht, bspw. die Range beträgt 10 Punkte, dann ist das Zie...
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'...
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.
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...
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
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...
osupero https://www.screencast.com/t/2fCW8fkGsOeZ....solo posiciones largas por ahora
osupero https://www.screencast.com/t/MIaSZ2PRg
ALZ Hi JohnSher, Nice but not the same result Do you have the last itf of it ? Good result i...
dertopen HI Wwhy you said avoiding bear market? Don't you think that we can use this code for short...
maurizio dove si trova lo screener?
macdopa Thanks...
ak5hay2 Works like crazy on bitcoin. Use different timeframes. Thanks a lot Doc!!!
richyowen Hi, great code thanks. Very new to this forum. Is there a way to add a 100point target on an...
lisamitch50 Morning all, Just backtested on quite a few instruments, worked well on backtesting, but tel...
FULVIO09 Attualmente non c'è sufficiente volatilità : la condizione "C0 = AverageTrueRange[1500](Clos...
vlongobardo67 Ma io intendevo in backtest ! Scusa non l’ho menzionato.
ciniselloftse salve fulvio .il trading sistem e sempre profittevole?
reb Hello have you used this strat since last year ? live or Back test ? What are the results ?
beeb Yes last Year. But only back test
drysheep Hi all, did anyone test this strategy recently? As i dont get a single trade in the backt...
Yannick TradingDayLong = dayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayof...
Marlon Hey JohnScher, your code works fine, but my results aren't as good as yours. Even if I use ...
DarioMazza Bha... this code dont work. gg
ALE
6 years ago
settival CIAO ALE CREDO DI AVER SETTATO PER BENINO LO SCALPING INDICATOR MA NON VISUALIZZO I SEGNALI ...
graff.laetitia Hello, I'm sorry to bother you, I'm new to trading, I managed to download the indicator but ...
Alby118 i can get it to work? dax 1 min. upload indicator on the4 chart. thank you
Yannick Hello There is a mistake in trailing stop code, I think that this should fix the problem s...
Paul About the trailing-stop the way it's coded. That works for backtesting only, just look at th...
Jonny sorry paul, but system says that is not possible to put many stop order combined...what have...
BC
6 years ago
TempusFugit Thanks Bin, nice code, I can use several ideas of the way you build it
DarioMazza Thanks Bin, great concentration, i understand the first idea, but may u indicate me the asse...
Bin Hi Mazza This robot is optimized for DAX30.
Van Salt Hi Bianca, the indicator shows you some interesting cluster-zones from long- and shortterm f...
Vinci1966 Questo indicatore è molto interessante. Mi sono permesso di apportare alcune modifiche nell'...
Vinci1966 // VAN SALT´s <> Version 20171105 // This Indicator draws the Shortterm and Longtern ...
TempusFugit Masala, thanks for your contribution. I don´t like the offmarket spreads neither ;) I unders...
Uveus Tempus, me da un error al validar el codigo, sobre la variable N. Al crear el indicador me ...
TempusFugit Hi Uveus, I am guessing you inserted the code of the indicator into the system code, is ...
teddy58 This system is the only one running on my PC, which i didn´t developed my myself. My forcast...
xpiga Hi! Is this system still working good? Anyone has it in the live account? It looks great. T...
Paul_Going Dutch Proformence will be beter with other starting hours and closing hours @Inertia
rejo007 hello david, i'll try it could you tell me wich strategy do you use in real? thanks
David Somogyi Hello, I have a couple of DAX strategies of breakout and mean reversion. I'll try to post...
Roberto Blázquez Hi David, I just saw your strategy and it's good!!! I'm going to try it from today in real a...

Top