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?

New! PRC is also now on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Vonasi • 199 days ago #

    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 • 199 days ago #

    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 • 199 days ago #

    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 • 197 days ago #

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

  5. JohnScher • 197 days ago #

    @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 • 197 days ago #

    // 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 • 196 days ago #

    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 • 196 days ago #

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

  9. JohnScher • 196 days ago #

  10. JohnScher • 196 days ago #

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

  11. JohnScher • 196 days ago #

    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 • 194 days ago #

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

    Pls try again!

  13. Yannick • 192 days ago #

    Hello It doesn’t work for me also

  14. JohnScher • 190 days ago #

    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 • 190 days ago #

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

  16. Yannick • 188 days ago #

    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 • 188 days ago #

    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 • 151 days ago #

    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 • 126 days ago #

    Bha… this code dont work. gg

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Nicolas Thank you Xusto. Thank you a lot for your contribution :) Since your code is a Pathfinder'...
Xusto Hello, Fully Agree, I will update it with your advice. Btw Can would you like share you co...
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...
JohnScher Yes, the strategy works overnight. Open and Closes are at 09.00/13.00/17.00 and 21.00 o´clo...
JohnScher Oh, I did not optimize the strategy. You are welcome to put a modified code according to ...
JohnScher Hello. I have updated the code littel bit. On the one hand I switched to GMT+1. On t...
Daniel da Costa Thanks Doc! Where can you find a service for Dax with a 1 point spread?
Doctrading Hello. I suggest you : ProRealTime CFD, or IG. Best regards,
JanWd Hey Doctrading, I tried your code, optimising the A and V and the RSI period, see below. ...
vlongobardo67 Ciao Fulvio, ho scaricato ed importato il file. m,a se lo faccio girare sul miniDax non ...
FULVIO09 Attualmente non c'è sufficiente volatilità : la condizione "C0 = AverageTrueRange[1500](Clos...
vlongobardo67 Ma io intendevo in backtest ! Scusa non l’ho menzionato.
Dominik // Stops und Targets SET STOP pLOSS 0 SET STOP PTRAILING 45 SET TARGET pPROFIT 55
beeb Hallo Dominik, das mit dem deutsch schreiben kommt mir sehr gelegen. Komme auch aus Deutschl...
vlongobardo67 hi Beeb, I imported the file in my platform but is does open any order. What is wrong , wha...
Vonasi Thanks for the compliments ALE. If you use any results from it in a strategy then please sha...
CKW this is Awesome tool. thanks Vonasi
Vonasi ....and thank you for the compliment CKW.
Vonasi There is another very minor bug fix. The indicator description when you hover over the speec...
Reiner great work:-)
Vonasi Thanks Reiner. that is compliments indeed from the seasonality expert. I have a second vers...
ALE
7 months ago
ALE P01 , it’s the first patner of the indicator, I hope to add others in future.
ALE We can discuss about the strategy here: https://www.prorealcode.com/topic/scalping-indicator/
settival CIAO ALE CREDO DI AVER SETTATO PER BENINO LO SCALPING INDICATOR MA NON VISUALIZZO I SEGNALI ...
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
8 months 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 ...
tecknozic Bonjour Inertia, cette sais-tu si cette stratégie fonctionne sur un compte IG à "risque limi...
Inertia Bonjour tecknozic.... Je ne sais pas... Désolé. Bonne chance ;)
teddy58 This system is the only one running on my PC, which i didn´t developed my myself. My forcast...
JM David, Thanks a lot and next week I begin the test of this strategy in real... You have ot...
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...
verdi55 Running a single Renko strategy with a fixed box size is usually not a good idea, because th...
Fabrizio_T Hi, have you tested on the period 30 julay - 30 September 2015?
grzemariusz Hi I use your strategy but i don't know how to implement position size to the code thanks f...
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...
dkinse Hey, Yes it´s running in 30 m timeframe. I had it running and it made two trads in januar...
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...
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
1 year ago
CSR strategy DAX 1 D
CSR strategy DAX 1 D
14
Strategies
ALE Thanks as always Nicolas
Toto le Heros It looks very interresting. I have one question related to the following result in ProbackTe...
StefanStrand I tried running this on IG ProRealTime and get the following error message, why could this b...

Top