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
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!
KumoNoJuzza Bonjour, @rominet44 pourrais tu expliquer à quoi sert le filtre: M8=average[11](close) // ...
Nicolas la moyenne mobile 11 période actuelle est ascendante ou descendante, on teste sa valeur vis ...
Patrice210 bonjour STANKO, effectivement la première ligne apparait en anomalie et je ne comprend pas v...
snucke i dont think you understod the question. i did not ask about the band pass indicator. i as...
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...
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
wally Hola soy nuevo en el mudo robots. Alguien seria tan amable de poner el archivo itf.file ya q...
Darren Nash I found this works well on the DOW
thomas2004ch Hi John, Is your strategy suitable for daily SPY? Regards
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
JohnScher I've been looking for this for a long time! A very big thank you to you.
Nupsator hi, looks very interesting, i imported the indicator and inserted it into a 1h chart. Unfort...
Ciccarelli Franco Lo trovo interessante, ma non riesco a scaricarlo. Chi mi può aiutare?
klaus_reum Many thanks for that great tool. nevertheless, I am struggling with the time range. I tried ...
ipbvba idem ne fonctionne pas sur V11 (meme avec real time data), import OK mais aucune courbe dans...
Ciccarelli Franco I'm new to the Market, I imported the code, but I don't see anything, there is an empty box ...
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