Meine Tranig System ORB + GAP 0800

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #23111 quote
    wreini1982
    Participant
    Junior

    Hallo,

    ich möchte vorab mich für das Forum hier bedanken, es ist wirklich klasse und die prorealtime Software auch, einziges Manko derzeit ist noch, dass die System erst beim nächsten Balken ausgelöst werden, aber daran wird gearbeitet was ich gelesen habe für die zukünftigen Versionen.

    Möchte hier nur kurz meine Code meiner Strategie vorstellen, es ist eine Mischung aus 3 Systemen:

    1. 0800 GAP-Strategie –> passiert darauf das Gap (Lücken) geschlossen werden
    2. Breakout um 9 Uhr herum –> zwei Grenzen eine nach oben und nach unten basierend auf den Hoch und Tief der vorherigen Stunde
    3. Breakout um 16.15 herum –> wie 9 Uhr Strategie nur das 1 1/2 Stunden davor die Hoch und Tief angeschaut werden

    Im backbords Rechnung ist die Strategie erfolgreich mit ca. 50% Trefferquote und CR von 1.5.

    Weiters ist das System mit einer dynamischen Kontraktanzahl Erhöhung versehen um somit den Profit noch zu erhöhen.

    Der Code ist eventuell nicht komplett sauber programmiert, aber möchte ihn hier den Leuten nicht vor enthalten.

    Vielleicht möchte es jemand auch probieren oder hat Verbesserungsvorschläge oder kann Teile aus der Programmierung für sich verwenden.


    //ORB 0801 27012017
     
    // Strategie break out um 0900 und 1600
    // 15 min Chart trading
     
    Defparam cumulateorders = true
    Defparam flatbefore = 075900
    Defparam flatafter = 220000
     
    // dynamische Anpassung contract auf Basis alle 500 Euro + 1 contract ab -1000 (drowndown + 30% Euro System Stop
    // 650 ist auf Basis +150 Euro contract price, 350 Euro Erhöhung drowndown, 150 Euro maximal Verlust Erhöhung
     
    startcontracts = 2 //start of contract system with 4000 Euro Base
    Gewinn = STRATEGYPROFIT
    dyncontracts = round(Gewinn/650)
    //dyncontracts = 0
     
    contractnumber = startcontracts + dyncontracts
     
    if Gewinn < -300 THEN
    contractnumber = 0
    ENDIF
     
    IF Time = 090000 THEN
    haut = highest[2](high)
    bas = lowest[2](low)
    amplitude = haut - bas
     
    ENDIF
     
    if Time > 090000 AND Time <= 094500 THEN
     
    IF close CROSSES OVER haut and not shortonmarket THEN
    buy contractnumber share at haut stop
    ENDIF
     
    IF close CROSSES UNDER bas and not longonmarket THEN
    sellshort contractnumber share at bas stop
    ENDIF
     
    //set stop ploss 0.4*amplitude
    a1 = 0.3*amplitude
    a2 = 4
    b = 0.85*amplitude
     
    if a1 > a2 then
    //set stop ploss a1
    SET STOP TRAILING a1
    ELSE
    //set stop ploss a2
    SET STOP TRAILING a2
    ENDIF
     
    set target pprofit b
     
    ENDIF
     
    IF Time = 161500 THEN
    haut2 = highest[3](high)
    bas2 = lowest[3](low)
    amplitude2 = haut2 - bas2
     
    ENDIF
     
    if Time > 161500 AND Time <= 170000 THEN
     
    IF close CROSSES OVER haut2 and not shortonmarket THEN
    buy contractnumber share at haut2 stop
    ENDIF
     
    IF close CROSSES UNDER bas2 and not longonmarket THEN
    sellshort contractnumber share at bas2 stop
    ENDIF
     
    //set stop ploss 0.4*amplitude
    a3 = 0.7*amplitude2
    a4 = 4
    b = 0.85*amplitude2
     
    if a3 > a4 then
    //set stop ploss a1
    SET STOP TRAILING a3
    ELSE
    //set stop ploss a2
    SET STOP TRAILING a4
    ENDIF
     
    set target pprofit b
     
    ENDIF
     
    //---
     
    // 0801 27012016 15min
     
    if time = 080000 then
    dayclose = close[40]
    dayclose2 = close[1]
    //dayopen = open[0]
     
    delta = dayclose - dayclose2
    endif
     
    IF CURRENTTIME > 074500 and CURRENTTIME < 081500 THEN
    // Bedingungen zum Einstieg in Long-Positionen
     
    IF NOT LongOnMarket AND delta > 25 THEN
    BUY 1 CONTRACTS AT MARKET
    ENDIF
     
    // Bedingungen zum Einstieg in Short-Positionen
    IF NOT ShortOnMarket AND delta < -25 THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    ENDIF
     
    // Stops und Targets: Legen Sie hier schützende Stops und Profit Targets fest
    a = 0.3
    b = 0.8
     
    x1 = a*delta
    x2 = b*delta
     
    IF x2 > 4 THEN
    x2=b*delta
    ENDIF
    IF b*delta <= 4 THEN
    x2 = 4
    ENDIF
     
    SET TARGET PPROFIT ABS(x1)
    //SET STOP PLOSS ABS(x2)
    SET STOP TRAILING ABS(x2)
     
    IF time = 084500 then
    exitshort at market
    ENDIF
     
    IF time = 084500 then
    sell at market
    ENDIF
     
    ENDIF

     

     

    ——-
    #23113 quote
    wreini1982
    Participant
    Junior

    Hallo,

    etwas ganz wichtiges habe ich vergessen ist für den DAX im 15 Minuten Chart angedacht.

    MFG

    Wolfgang

    #23124 quote
    Nicolas
    Keymaster
    Master

    Hallo Wolfgang und danke für den Austausch Ihres Codes hier auf Foren.
    Es tut mir leid, aber ich habe keine guten Ergebnisse, wenn Backtesting mit dem neuen Modus “tick by tick”. Ich denke, Sie haben Ihre Tests ohne es gemacht haben, das ist, warum schleppende Stop Gie Ihnen tolle Ergebnisse.

    Dies ist das Ergebnis, das ich mit einem 10.000 € Konto habe.
    Ich würde gerne helfen, wenn Sie irgendwelche anderen Fragen.

    #23266 quote
    wreini1982
    Participant
    Junior

    Hallo,

    danke für deine Antwort, ich habe gesehen, dass es Probleme gibt mit dem System. Die Fehlerquelle nicht tick by tick, was eine super Funktion im 10.3 ist, war mir bekannt, aber scheint beim Backwards rechnen einmal der Fehler sich eingeschlichen zu haben nicht tick by tick zu nutzen.

    Weiter habe ich noch ein paar Anpassung beim Take Profit und Stop loss gemacht und bei der GAP Strategie die Short Position gecanceled.

    leider kann ich nicht so weit retour rechnen auf einmal mit Tick by Tick wie, weil maximal 500 mal das genutzt werden kann zumindest in der Demoversion.

    Ich habe hier auch ein Foto reingestellt für die anderen Users um den Unterschied zwischen tick by tick und ohne sehen zu können.

    Hier das überarbeite System nun:

    //ORB 0801 31012017
    
    // Strategie break out um 0900 und 1615 + GAP um 0800 im 15min Chart wird getraded
    // 31012017: Feedback aus realprocode System funktioniert nicht
    //31012017: Breakout um 1615 optimiert, Rechenzeitraum high low angepasst und take profit und stop loss
    //31012017: 0800 long Position take Profit, stop loss optimiert, short Position gelöst aus System konnte nicht profitable optimiert werden
    //31012017: dynmische Anpassung für jedes der 3 Systemehinzugefügt und nicht wie vorher einen generellen.
    //31012017: Weiters den Verkauf bzw. schließen der Position jedes System an richtige Position gestellt außerhalb der IF und somit am Ende jedes Systems
    
    Defparam cumulateorders = true
    //Defparam flatbefore = 075900
    Defparam flatafter = 234500
    
    // dynamische Anpassung contract auf Basis alle 500 Euro + 1 contract ab -500 Stop des Systems
    // 500 ist auf Basis +150 Euro contract price (3x), 250 Euro Erhöhung drowndown, 60 Euro maximal Verlust Erhöhung
    
    startcontracts = 2 //start of contract system with 1000 Euro Base
    Gewinn = STRATEGYPROFIT
    dyncontracts = round(Gewinn/500)
    //dyncontracts = 0
    
    contractnumber = startcontracts + dyncontracts
    
    if Gewinn < -350 THEN
    contractnumber = 0
    ENDIF
    
    // ORB 090000 15min
    
    IF Time = 090000 THEN
    haut = highest[2](high)
    bas = lowest[2](low)
    amplitude = haut - bas
    
    ENDIF
    
    if Time > 090000 AND Time <= 094500 THEN
    
    IF close CROSSES OVER haut and not shortonmarket THEN
    buy contractnumber share at haut stop
    ENDIF
    
    IF close CROSSES UNDER bas and not longonmarket THEN
    sellshort contractnumber share at bas stop
    ENDIF
    
    //set stop ploss 0.4*amplitude
    a1 = 0.3*amplitude
    a2 = 4
    b = 0.85*amplitude
    
    if a1 > a2 then
    SET STOP TRAILING a1
    ELSE
    SET STOP TRAILING a2
    ENDIF
    
    set target pprofit b
    
    ENDIF
    
    IF time = 160000 then
    exitshort at market
    ENDIF
    
    IF time = 160000 then
    sell at market
    ENDIF
    
    // ORB 161500 15min
    
    IF Time = 161500 THEN
    haut2 = highest[4](high)
    bas2 = lowest[4](low)
    amplitude2 = haut2 - bas2
    
    ENDIF
    
    if Time > 161500 AND Time <= 170000 THEN
    
    IF close CROSSES OVER haut2 and not shortonmarket THEN
    buy contractnumber share at haut2 stop
    ENDIF
    
    IF close CROSSES UNDER bas2 and not longonmarket THEN
    sellshort contractnumber share at bas2 stop
    ENDIF
    
    a3 = 0.15*amplitude2
    a4 = 4
    b = 0.4*amplitude2
    
    if a3 > a4 then
    SET STOP TRAILING a3
    ELSE
    SET STOP TRAILING a4
    ENDIF
    
    set target pprofit b
    
    ENDIF
    
    IF time = 220000 then
    exitshort at market
    ENDIF
    
    IF time = 220000 then
    sell at market
    ENDIF
    
    //---
    
    // 0801 31012016 15min
    
    if time = 080000 then
    dayclose = close[40]
    dayclose2 = close[1]
    
    delta = dayclose - dayclose2
    endif
    
    IF CURRENTTIME > 074500 and CURRENTTIME <= 081500 THEN
    // Bedingungen zum Einstieg in Long-Positionen
    
    IF NOT LongOnMarket AND delta > 35 THEN
    BUY contractnumber CONTRACTS AT MARKET
    ENDIF
    
    // Stops und Targets: Legen Sie hier schützende Stops und Profit Targets fest
    a = 0.25
    b = 0.8
    
    x1 = a*delta
    x2 = b*delta
    
    IF x2 > 4 THEN
    x2=b*delta
    ENDIF
    IF b*delta <= 4 THEN
    x2 = 4
    ENDIF
    
    SET TARGET PPROFIT ABS(x1)
    SET STOP TRAILING ABS(x2)
    
    ENDIF
    
    #27280 quote
    axmichi
    Participant
    Senior

     

    Hallo Wolfgang,

    toller code danke!!

     

    Ich habe eine frage dazu, kann mann den Code der Gap Strategie auch einfach extrahieren, weil ich nämlich genau so eine machen will und mir leider die Kenntnisse fehlen das selbst zu machen. Ich kann auch noch nicht rauslesen, welche zeile zu welcher strategie gehört.

     

    Lieben Gruß

    #29108 quote
    wreini1982
    Participant
    Junior

    Hallo,

     

    entschuldige meine späte Antwort, das ist der Teil der GAP Strategie, aber habe sie am Demokonto laufen lassen war nicht erfolgreich, muss sie aber noch analysieren im Detail, warum genau nicht.

    M15 Dax Mini.

     

    // 0801 31012016 15min
    
    if time = 080000 then
    dayclose = close[40]
    dayclose2 = close[1]
    
    delta = dayclose - dayclose2
    endif
    
    IF CURRENTTIME > 074500 and CURRENTTIME <= 081500 THEN
    // Bedingungen zum Einstieg in Long-Positionen
    
    IF NOT LongOnMarket AND delta > 35 THEN
    BUY contractnumber CONTRACTS AT MARKET
    ENDIF
    
    // Stops und Targets: Legen Sie hier schützende Stops und Profit Targets fest
    a = 0.25
    b = 0.8
    
    x1 = a*delta
    x2 = b*delta
    
    IF x2 > 4 THEN
    x2=b*delta
    ENDIF
    IF b*delta <= 4 THEN
    x2 = 4
    ENDIF
    
    SET TARGET PPROFIT ABS(x1)
    SET STOP TRAILING ABS(x2)
    
    ENDIF
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Meine Tranig System ORB + GAP 0800


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
wreini1982 @wreini1982 Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by wreini1982
8 years, 10 months ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 01/30/2017
Status: Active
Attachments: 3 files
Logo Logo
Loading...