Dax Daily Open Long – timeframe 4 hours

Dax Daily Open Long – timeframe 4 hours

A simple code with differently weighted averages and a stop by repulse.
Supplemented by the seasonal pattern multiplier and a re-invest strategy.
If necessary, the latter can also be omitted, but it still remains a gain that achieves a higher performance than the Dax itself.

Time conditions should be adapted to your timezone. Timeframe = H4.
You can also do without the fixed TP and SL. The insurance can stay.

kind regards

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. Vonasi • 01/03/2018 #

    JohnScher has requested that I post my very slightly modified version of his strategy that gives better profits and a higher win/loss ratio on here but unfortunately I am unable to post code for some strange reason. Please go to
    https://www.prorealcode.com/topic/wanted-small-code-snippet/#post-57152
    where you can find the new code. You may wish to adjust the SET Target %Profit to 3.75 instead of the 3 that it is as this is a more optimized number.

  2. AVT • 01/03/2018 #

    What does the last sentence mean: The insurance can stay. (A typical german is over-insured, but a “Robot insurance” is really the final straw). Thx.

  3. JohnScher • 01/03/2018 #

    The “insurance” is against the general dangers such as the sudden appearance of a black hole in the middle of the earth or simply against an exploding nuclear power plant.

  4. Kv6 • 01/03/2018 #

    I’m trying to make a probacktest in the suggested 4H timeframe and don’t perform any operations…

  5. JohnScher • 01/03/2018 #

    @Kv6

    Try this code, see below.

    Please pay attention to the correct time settings.
    The trade starts at 09:00 GMT+1 or 08:00 GMT.
    Correspondingly then the closes
    09.00/13.00/17.00/21.00 GMT+1
    08.00/12.00/16.00/22.00 GMT

    Here in the code i use GMT+1

    Then it should work.

    If it doesn’t work, please use ScreenShots.

  6. JohnScher • 01/03/2018 #

    // MainCode: DailyOpenLong
    // Dax 1 Euro
    // TimeFrame 4H
    // created by JohnScher
    // with SaisonalPatternMultiplier from Pathfinder-Systems
    // with Re-Invest-Strategie

    //……………………………………………………..
    // Start
    //……………………………………………………..

    defparam cumulateorders = false

    // saisonal pattern muliplier

    ONCE January1 = 3 //0 risk(3)
    ONCE January2 = 0 //3 ok
    ONCE February1 = 3 //3 ok
    ONCE February2 = 3 //0 risk(3)
    ONCE March1 = 3 //0 risk(3)
    ONCE March2 = 2 //3 ok
    ONCE April1 = 3 //3 ok
    ONCE April2 = 3 //3 ok
    ONCE May1 = 1 //0 risk(1)
    ONCE May2 = 1 //0 risk(1)
    ONCE June1 = 1 //1 ok 2
    ONCE June2 = 2 //3 ok
    ONCE July1 = 3 //1 chance
    ONCE July2 = 2 //3 ok
    ONCE August1 = 2 //1 chance 1
    ONCE August2 = 3 //3 ok
    ONCE September1 = 3 //0 risk(3)
    ONCE September2 = 0 //0 ok
    ONCE October1 = 3 //0 risk(3)
    ONCE October2 = 2 //3 ok
    ONCE November1 = 1 //1 ok
    ONCE November2 = 3 //3 ok
    ONCE December1 = 3 // 1 chance
    ONCE December2 = 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 25
    c2 = TEMA [4] (close) > ExponentialAverage [4] (close)
    c3 = Repulse [3] (close) > 0.3

    IF TradingDayLong and TradingTimeLong Then
    If c1 and c2 and c3 THEN
    buy position*saisonalpatternmultiplier CONTRACT AT MARKET
    Endif
    ENDIF

    // set stop loss
    IF time = 090000 or time = 130000 or time = 170000 or time = 210000 then
    If Repulse[3](close)< -0.3 Then
    sell at market
    Endif
    ENDIF

    // set target profit set stop loss
    //set target %profit 3
    Set stop %loss 5
    // end maincode

  7. Kv6 • 01/03/2018 #

    Line 111: I replaced “IF CurrentDayOfTheMonth 25” with “IF CurrentDayOfTheMonth <= 25 THEN"
    In the end, when I try to validate, the error shown in the screenshot comes out.

  8. JohnScher • 01/03/2018 #

    Are you sure you changed in my code the line 111?

  9. JohnScher • 01/03/2018 #

  10. JohnScher • 01/03/2018 #

    Add PRT code – function don´t work correct on my personal computer
    i try againe

  11. JohnScher • 01/03/2018 #

    next try

    doesn´t work
    so here it is

    // MainCode : DailyOpenLong
    // Dax 1 Euro
    // Timezone GMT
    // TimeFrame4H
    // created by JohnScher
    // with SainsonalPatternMultiplier from Pathfinder-Systems
    // with Re-Invest-Strategie

    //……………………………………………………..
    // Start
    //……………………………………………………..

    defparam cumulateorders = false

    // saisonal pattern muliplier

    ONCE January1 = 3 //0 risk(3)
    ONCE January2 = 0 //3 ok
    ONCE February1 = 3 //3 ok
    ONCE February2 = 3 //0 risk(3)
    ONCE March1 = 3 //0 risk(3)
    ONCE March2 = 2 //3 ok
    ONCE April1 = 3 //3 ok
    ONCE April2 = 3 //3 ok
    ONCE May1 = 1 //0 risk(1)
    ONCE May2 = 1 //0 risk(1)
    ONCE June1 = 1 //1 ok 2
    ONCE June2 = 2 //3 ok
    ONCE July1 = 3 //1 chance
    ONCE July2 = 2 //3 ok
    ONCE August1 = 2 //1 chance 1
    ONCE August2 = 3 //3 ok
    ONCE September1 = 3 //0 risk(3)
    ONCE September2 = 0 //0 ok
    ONCE October1 = 3 //0 risk(3)
    ONCE October2 = 2 //3 ok
    ONCE November1 = 1 //1 ok
    ONCE November2 = 3 //3 ok
    ONCE December1 = 3 // 1 chance
    ONCE December2 = 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 25
    c2 = TEMA [4] (close) > ExponentialAverage [4] (close)

    IF TradingDayLong and TradingTimeLong Then
    If c1 and c2 THEN
    buy position*saisonalpatternmultiplier contracts at market
    Endif
    ENDIF

    // condition to exit
    IF time = 080000 or time = 120000 or time = 160000 or time = 200000 then
    If Repulse[3](close)< -0.3 Then
    sell at market
    Endif
    ENDIF

    // set target profit set stop loss
    //set target %profit 3
    Set stop %loss 5
    // Stop Loss as an insurace e.g. an exploiting nuclear power plant
    // end maincode

    // end

    all right?

  12. Mags67 • 01/03/2018 #

    Sorry don’t get your system to work. Miss definition of c1, december etc.

    Pls try again!

  13. Yannick • 01/03/2018 #

    Hello It doesn’t work for me also

  14. JohnScher • 01/03/2018 #

    this one runs

    // MainCode : DailyOpenLong
    // Dax 1 Euro
    // TimeFrame4H
    // created by JohnScher
    // with SainsonalPatternMultiplier from Pathfinder-Systems
    // with Re-Invest-Strategie

    //……………………………………………………..
    // Start
    //……………………………………………………..

    defparam cumulateorders = false

    // saisonal pattern muliplier

    ONCE January1 = 3 //0 risk(3)
    ONCE January2 = 0 //3 ok
    ONCE February1 = 3 //3 ok
    ONCE February2 = 3 //0 risk(3)
    ONCE March1 = 3 //0 risk(3)
    ONCE March2 = 2 //3 ok
    ONCE April1 = 3 //3 ok
    ONCE April2 = 3 //3 ok
    ONCE May1 = 1 //0 risk(1)
    ONCE May2 = 1 //0 risk(1)
    ONCE June1 = 1 //1 ok 2
    ONCE June2 = 2 //3 ok
    ONCE July1 = 3 //1 chance
    ONCE July2 = 2 //3 ok
    ONCE August1 = 2 //1 chance 1
    ONCE August2 = 3 //3 ok
    ONCE September1 = 3 //0 risk(3)
    ONCE September2 = 0 //0 ok
    ONCE October1 = 3 //0 risk(3)
    ONCE October2 = 2 //3 ok
    ONCE November1 = 1 //1 ok
    ONCE November2 = 3 //3 ok
    ONCE December1 = 3 // 1 chance
    ONCE December2 = 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 25
    c2 = TEMA [4] (close) > ExponentialAverage [4] (close)

    IF TradingDayLong and TradingTimeLong Then
    If c1 and c2 THEN
    buy position*saisonalpatternmultiplier CONTRACT AT MARKET
    Endif
    ENDIF

    // set stop loss
    IF time = 090000 or time = 130000 or time = 170000 or time = 210000 then
    If Repulse[3](close)< -0.3 Then
    sell at market
    Endif
    ENDIF

    // set target profit set stop loss
    //set target %profit 3
    Set stop %loss 5
    // end maincode

    // end

  15. JohnScher • 01/03/2018 #

    Why do i have problems to insert a code with “add prt code” ??

  16. Yannick • 01/03/2018 #

    Hello
    The problem of the code might the time of the candle if you modifiy by TradingtimeLong = time > 075900 and time<095000 For GMT/UTC +1 (Europe).
    i have also a problem with add prt code

  17. Yannick • 01/03/2018 #

    TradingDayLong = dayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayofweek = 5
    TradingtimeLong = time > 075900 and time 25
    c2 = TEMA [4] (close) > ExponentialAverage [4] (close)

    IF TradingDayLong and TradingTimeLong Then
    If c1 and c2 THEN
    buy position*saisonalpatternmultiplier CONTRACT AT MARKET
    Endif
    ENDIF

    // set stop loss

    If Repulse[3](close)< -0.3 Then
    sell at market
    Endif

    // set target profit set stop loss
    set target %profit 3
    Set stop %loss 5
    // end maincode

  18. Marlon • 01/03/2018 #

    Hey JohnScher,
    your code works fine, but my results aren’t as good as yours. Even if I use the same timeframe as you.
    What is wrong with my code? I just copied it.
    Did I miss something?

  19. DarioMazza • 01/03/2018 #

    Bha… this code dont work. gg

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
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.
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...
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?
Francesco78 I did a little bit of work on that and now the results looks better and more stable. Please...
Francesco78 I did a little bit of work on that and now the results looks better and more stable. Please...
Khaled Hi Francesco , thank you for sharing your hard work. Any idea why all orders are executed at...
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...
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 ...

Top