Pivot Trade hlco/4

Viewing 15 posts - 16 through 30 (of 55 total)
  • Author
    Posts
  • #188430 quote
    robertogozzi
    Moderator
    Master

    In Zeile 51 habe ich einen Stop Loss von 400 Pips hinzugefügt.

    Ich habe Zeile 24 VOR Zeile 25 verschoben.

    Für den Rest scheint es mir in Ordnung zu sein:

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
     
    ONCE Distance = 6 * PipSize     //6  pips is the distance required by the broker
    IF Not OnMarket THEN
    Flag = 0
    ENDIF
     
    REM BERECHNUNG  Low/High
     
    if OpenDayOfWeek = 1 and TIME>= 000001 AND TIME<= 220000 THEN
    H3 = DLow(2)
    H4 = DHigh(2)
    H5 = Dopen(2)
    H6 = DClose(2)
    endif
    if OpenDayOfWeek = 2 or 3 or 4 or 5 and TIME>= 000001 AND TIME<= 220000 THEN
    H3 = DLow(1)
    H4 = DHigh(1)
    H5 = Dopen(1)
    H6 = DClose(1)
    endif
    
    PP=(H3+H4+H6+H6)/4
    R1=(2*PP) - H3
    S1=(2*PP) - H4
     
    //TF = 1
    //if Time = 220000 AND OPENDAYOFWEEK <6 AND OPENDAYOFWEEK >0 then
    //DayClose = Close
    //DayHigh = Highest[(1320/TF)](close[1])
    //DayLow = Lowest[(1320/TF)](close[1])
    //ENDIF
    //PP= (DayHigh + DayLow + DayClose+DayClose) / 4
    //R1 = PP + (PP - DayLow)
    //S1 = PP - (Dayhigh - PP)
     
    IF OnMarket THEN
    IF Time = 220000 THEN
    IF PositionPerf > 0 THEN
    SELL      AT Market
    EXITSHORT AT Market
    ELSE
    Flag = 1
    ENDIF
    ENDIF
    ENDIF
    IF Flag = 1 AND abs(close - TradePrice) >= Distance THEN
    SELL      AT TradePrice LIMIT
    EXITSHORT AT TradePrice LIMIT
    SET STOP pLOSS 400
    ENDIF
     
    // Bedingungen zum Einstieg in Long-Positionen
     
    L1 = (close > S1)       // Range unten
    L2 = (close < R1)       // Range oben
    L3 = (close < PP)       // Bedingung Long
    S3 = (close > PP)       // Bedingung Short
    ELL = (close >= PP)      // Tradeziel Long
    ELS = (close <= PP)      // Tradeziel Short
     
    c0 = opentime=070000     // Tradestart open 0700
     
     
    IF  NOT LongOnMarket and L1 and L2 AND L3 and c0 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
     
    // Bedingungen zum Ausstieg von Long-Positionen
     
    IF LONGOnMarket AND ELL THEN
    SELL AT MARKET
    ENDIF
     
    // Bedingungen zum Einstieg in Short-Positionen
     
    IF  NOT ShortOnMarket AND L1 and L2 AND S3 and c0 THEN
    SellShort 1 CONTRACT AT MARKET
    ENDIF
     
    // Bedingungen zum Ausstieg von Short-Positionen
    IF ShortOnMarket AND ELS THEN
    EXITSHORT AT MARKET
    ENDIF
    //graphonprice TradePrice
    //graph PositionPerf > 0
    //graph Flag coloured(255,0,0,255)
    #188431 quote
    Razz
    Participant
    Master

    Guten Morgen

    Nein der Code hat noch einen Entscheidenen Fehler schauen Sie sich bitte das Bild mal an mit dem Trade und lesen Sie den Text der dabei steht

    vielleicht wird Ihnen was noch nicht richtig klappt .

    Danke für Ihre Hilfe

    #188492 quote
    robertogozzi
    Moderator
    Master

    Du musst mir schreiben, was du für falsch hältst. Versuchen Sie, Text zu verwenden.

    #188504 quote
    Razz
    Participant
    Master

    Ok Ohne das Bild anzuschauen wird es schwierig

    zb.

    Dax 1 Minute Timeframe

    Kauf am 9.2.22  um 07:00

    Um 22:00 am 9.2.22 ist der Trade nicht im Gewinn also soll Take Profit auf den Kaufkurs um 07:00 am 9.2.22 verschoben werden.

    Funktioniert aber nicht der Trade wird am 10.2.22 um 03:01 auf dem Tagespivot des 10.2.22 geschlossen was falsch ist .

    Ich hoffe es wird klarer

    #188515 quote
    robertogozzi
    Moderator
    Master

    Jetzt verstehe ich, was du willst. In der Praxis muss es, wenn es Verluste hat und NICHT um 22:00 Uhr geschlossen hat, jedes Schließungs- oder Stop & Reverse-Signal ignorieren, bis es die Gewinnschwelle erreicht.
    Das scheint mir korrekt zu funktionieren:

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
     
    ONCE Distance = 6 * PipSize     //6  pips is the distance required by the broker
    IF Not OnMarket THEN
    Flag = 0
    ENDIF
     
    REM BERECHNUNG  Low/High
     
    if OpenDayOfWeek = 1 and TIME>= 000001 AND TIME<= 220000 THEN
    H3 = DLow(2)
    H4 = DHigh(2)
    H5 = Dopen(2)
    H6 = DClose(2)
    endif
    if OpenDayOfWeek = 2 or 3 or 4 or 5 and TIME>= 000001 AND TIME<= 220000 THEN
    H3 = DLow(1)
    H4 = DHigh(1)
    H5 = Dopen(1)
    H6 = DClose(1)
    endif
     
    R1=(2*PP) - H3
    PP=(H3+H4+H6+H6)/4
    S1=(2*PP) - H4
     
    //TF = 1
    //if Time = 220000 AND OPENDAYOFWEEK <6 AND OPENDAYOFWEEK >0 then
    //DayClose = Close
    //DayHigh = Highest[(1320/TF)](close[1])
    //DayLow = Lowest[(1320/TF)](close[1])
    //ENDIF
    //PP= (DayHigh + DayLow + DayClose+DayClose) / 4
    //R1 = PP + (PP - DayLow)
    //S1 = PP - (Dayhigh - PP)
     
    IF OnMarket THEN
    IF Time = 220000 THEN
    IF PositionPerf > 0 THEN
    SELL      AT Market
    EXITSHORT AT Market
    ELSE
    Flag = 1
    ENDIF
    ENDIF
    ENDIF
    
    Difference = abs(close - TradePrice)
    IF Difference < Distance THEN
    Difference = Distance - Difference
    ELSE
    Difference = 0
    ENDIF
    IF Flag = 1 THEN
    IF LongOnMarket THEN
    SELL      AT TradePrice + Difference LIMIT
    ELSIF ShortOnMarket THEN
    EXITSHORT AT TradePrice - Difference LIMIT
    ENDIF
    ENDIF
     
    // Bedingungen zum Einstieg in Long-Positionen
     
    L1 = (close > S1)       // Range unten
    L2 = (close < R1)       // Range oben
    L3 = (close < PP)       // Bedingung Long
    S3 = (close > PP)       // Bedingung Short
    ELL = (close >= PP)      // Tradeziel Long
    ELS = (close <= PP)      // Tradeziel Short
     
    c0 = opentime=070000     // Tradestart open 0700
     
     
    IF  NOT LongOnMarket and L1 and L2 AND L3 and c0 and Flag = 0 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
     
    // Bedingungen zum Ausstieg von Long-Positionen
     
    IF LONGOnMarket AND ELL AND Flag = 0 THEN
    SELL AT MARKET
    ENDIF
     
    // Bedingungen zum Einstieg in Short-Positionen
     
    IF  NOT ShortOnMarket AND L1 and L2 AND S3 and c0 and Flag = 0 THEN
    SellShort 1 CONTRACT AT MARKET
    ENDIF
     
    // Bedingungen zum Ausstieg von Short-Positionen
    IF ShortOnMarket AND ELS AND Flag = 0 THEN
    EXITSHORT AT MARKET
    ENDIF
    //graphonprice TradePrice
    //graph Flag coloured(255,0,0,255)
    //graph positionperf*positionprice/pipsize as "Profit"
    #188537 quote
    Razz
    Participant
    Master

    Hallo Danke Ja das sieht gut aus , was müste jetzt im Code noch geändert werden damit er weiterhin jeden Tag um 07:00 handelt wenn die Bedingungen erfüllt sind .

    Geht sowas überhaupt ?

    Danke für alles und Ich wünsche Dir ein schönes Wochenende

    #188613 quote
    robertogozzi
    Moderator
    Master

    Getan:

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = true // Kumulieren von Positionen deaktiviert
     
    ONCE Distance = 6 * PipSize     //6  pips is the distance required by the broker
    IF Not OnMarket THEN
    Flag = 0
    ENDIF
     
    REM BERECHNUNG  Low/High
     
    if OpenDayOfWeek = 1 and TIME>= 000001 AND TIME<= 220000 THEN
    H3 = DLow(2)
    H4 = DHigh(2)
    H5 = Dopen(2)
    H6 = DClose(2)
    endif
    if OpenDayOfWeek = 2 or 3 or 4 or 5 and TIME>= 000001 AND TIME<= 220000 THEN
    H3 = DLow(1)
    H4 = DHigh(1)
    H5 = Dopen(1)
    H6 = DClose(1)
    endif
     
    R1=(2*PP) - H3
    PP=(H3+H4+H6+H6)/4
    S1=(2*PP) - H4
     
    //TF = 1
    //if Time = 220000 AND OPENDAYOFWEEK <6 AND OPENDAYOFWEEK >0 then
    //DayClose = Close
    //DayHigh = Highest[(1320/TF)](close[1])
    //DayLow = Lowest[(1320/TF)](close[1])
    //ENDIF
    //PP= (DayHigh + DayLow + DayClose+DayClose) / 4
    //R1 = PP + (PP - DayLow)
    //S1 = PP - (Dayhigh - PP)
     
    IF OnMarket THEN
    IF Time = 220000 THEN
    IF PositionPerf > 0 THEN
    SELL      AT Market
    EXITSHORT AT Market
    ELSE
    Flag = 1
    ENDIF
    ENDIF
    ENDIF
     
    Difference = abs(close - TradePrice)
    IF Difference < Distance THEN
    Difference = Distance - Difference
    ELSE
    Difference = 0
    ENDIF
    IF Flag = 1 THEN
    IF LongOnMarket THEN
    SELL      AT PositionPrice + Difference LIMIT
    ELSIF ShortOnMarket THEN
    EXITSHORT AT PositionPrice - Difference LIMIT
    ENDIF
    ENDIF
     
    // Bedingungen zum Einstieg in Long-Positionen
     
    L1 = (close > S1)       // Range unten
    L2 = (close < R1)       // Range oben
    L3 = (close < PP)       // Bedingung Long
    S3 = (close > PP)       // Bedingung Short
    ELL = (close >= PP)      // Tradeziel Long
    ELS = (close <= PP)      // Tradeziel Short
     
    c0 = opentime=070000     // Tradestart open 0700
     
     
    IF  L1 and L2 AND L3 and c0 and (Flag = 0 OR (Flag AND LongOnMarket)) THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
     
    // Bedingungen zum Ausstieg von Long-Positionen
     
    IF LONGOnMarket AND ELL AND Flag = 0 THEN
    SELL AT MARKET
    ENDIF
     
    // Bedingungen zum Einstieg in Short-Positionen
     
    IF  L1 and L2 AND S3 and c0 and (Flag = 0 OR (Flag AND ShortOnMarket)) THEN
    SellShort 1 CONTRACT AT MARKET
    ENDIF
     
    // Bedingungen zum Ausstieg von Short-Positionen
    IF ShortOnMarket AND ELS AND Flag = 0 THEN
    EXITSHORT AT MARKET
    ENDIF
    //graphonprice TradePrice
    //graph Flag coloured(255,0,0,255)
    //graph positionperf*positionprice/pipsize as "Profit"
    Razz thanked this post
    #192897 quote
    Razz
    Participant
    Master

    Hallo robertogozzi

    Ich habe mich nochmal mit dem Handelssystem beschäftigt und eines der Probleme ist Zeile 57 +Zeile 59 (PositionPrice).
    ein Beispiel am 28.4.22 geht das System um 7:00 Short Tradeprice 13836,6 der Trade ist um 22:00 im Minus wird also nicht geschlossen soweit alles richtig.
    Der Trade soll erst geschlossen werden wenn der Preis wieder beim Tradepreis 13836,6 ist . Nun am 29.4 geht das System wieder Short
    Tradeprice 14147,5 dieser Trade erreicht am gleichen Tag um 20:47 sein Ziel dann schließt das Handelssystem beide Positionen was ja so nicht gewollt ist .
    Haben Sie dafür eine Lösung / Erklärung oder ist sowas nicht Programmierbar ?

    Im vorraus Vielen Dank

    #192990 quote
    robertogozzi
    Moderator
    Master

    Ich bin mir nicht sicher, ob ich das richtig verstehe.
    Ich habe ein paar Korrekturen vorgenommen, sehen Sie, ob es jetzt in Ordnung ist.

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = true // Kumulieren von Positionen deaktiviert
     
    ONCE Distance = 6 * PipSize     //6  pips is the distance required by the broker
    IF Not OnMarket THEN
    Flag = 0
    ENDIF
     
    REM BERECHNUNG  Low/High
     
    if OpenDayOfWeek = 1 and TIME>= 000001 AND TIME<= 220000 THEN
    H3 = DLow(2)
    H4 = DHigh(2)
    H5 = Dopen(2)
    H6 = DClose(2)
    endif
    if OpenDayOfWeek = 2 or 3 or 4 or 5 and TIME>= 000001 AND TIME<= 220000 THEN
    H3 = DLow(1)
    H4 = DHigh(1)
    H5 = Dopen(1)
    H6 = DClose(1)
    endif
     
    R1=(2*PP) - H3
    PP=(H3+H4+H6+H6)/4
    S1=(2*PP) - H4
     
    //TF = 1
    //if Time = 220000 AND OPENDAYOFWEEK <6 AND OPENDAYOFWEEK >0 then
    //DayClose = Close
    //DayHigh = Highest[(1320/TF)](close[1])
    //DayLow = Lowest[(1320/TF)](close[1])
    //ENDIF
    //PP= (DayHigh + DayLow + DayClose+DayClose) / 4
    //R1 = PP + (PP - DayLow)
    //S1 = PP - (Dayhigh - PP)
     
    IF OnMarket THEN
    IF Time = 220000 THEN
    IF PositionPerf > 0 THEN
    SELL      AT Market
    EXITSHORT AT Market
    ELSE
    Flag = 1
    ENDIF
    ENDIF
    ENDIF
     
    Difference = abs(close - PositionPrice)
    IF Difference < Distance THEN
    Difference = Distance// - Difference
    ELSE
    Difference = 0
    ENDIF
    IF Flag = 1 THEN
    IF LongOnMarket THEN
    IF close > PositionPrice THEN
    SELL      AT PositionPrice + Difference STOP
    ELSE
    SELL      AT PositionPrice + Difference LIMIT
    ENDIF
    ELSIF ShortOnMarket THEN
    IF close > PositionPrice THEN
    EXITSHORT AT PositionPrice - Difference LIMIT
    ELSE
    EXITSHORT AT PositionPrice - Difference STOP
    ENDIF
    ENDIF
    ENDIF
     
    // Bedingungen zum Einstieg in Long-Positionen
     
    L1 = (close > S1)       // Range unten
    L2 = (close < R1)       // Range oben
    L3 = (close < PP)       // Bedingung Long
    S3 = (close > PP)       // Bedingung Short
    ELL = (close >= PP)      // Tradeziel Long
    ELS = (close <= PP)      // Tradeziel Short
     
    c0 = opentime=070000     // Tradestart open 0700
     
     
    IF  L1 and L2 AND L3 and c0 and (Flag = 0 OR (Flag AND LongOnMarket)) THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
     
    // Bedingungen zum Ausstieg von Long-Positionen
     
    IF LONGOnMarket AND ELL AND Flag = 0 THEN
    SELL AT MARKET
    ENDIF
     
    // Bedingungen zum Einstieg in Short-Positionen
     
    IF  L1 and L2 AND S3 and c0 and (Flag = 0 OR (Flag AND ShortOnMarket)) THEN
    SellShort 1 CONTRACT AT MARKET
    ENDIF
     
    // Bedingungen zum Ausstieg von Short-Positionen
    IF ShortOnMarket AND ELS AND Flag = 0 THEN
    EXITSHORT AT MARKET
    ENDIF
    //graphonprice PositionPrice
    //graph Flag coloured(255,0,0,255)
    //graph positionperf*positionprice/pipsize as "Profit"
    graphonprice PositionPrice + Difference
    graphonprice PositionPrice - Difference
    graph Difference
    JohnScher and Razz thanked this post
    #193006 quote
    Razz
    Participant
    Master

    Hallo robertogozzi

    Danke für Ihre Hilfe , nein leider ist das Problem nicht gelöst .
    Solange der Handel an einem Tag Angefangen und beendet wird ist alles ok .
    Aber sobald eine Position nicht bis 22:oo in den Gewinn läuft wird Sie einfach nicht zum Kaufkurs geschlossen sondern zb. mit dem Nachfolgenden Trade oder einfach so .
    Ich kann das leider nicht besser umschreiben Ich denke es ist ein generelles Problem bei diesem System kann es halt auch vorkommem das Trades Monate offen bleiben und nur mit Ihrem Kaufkurs geschlossen werden sollen .
    Und Ich Denke das kann ProRealtime wohl nicht verarbeiten .

    Vielen Dank für Ihre Hilfe und Ihre Wertvolle Zeit

    #193016 quote
    JohnScher
    Participant
    Veteran

    einer der Fehler liegt darin, dass PRT den TP und den SL vom Trade 1 am Tag 1 nicht halten kann, wenn TP oder SL nicht erreicht wurde.

    Wird am Tag 2 ein Trade 2 eröffnet nimmt PRT den SL und TP von Tag 2 für den Trade 1 vom Tag.

    PRT verschiebt also die SL und TP und hält ihn nicht fest.

     

    Micha´s Setup kann hier nicht überprüft werden, vgl. auch hier

    again a question to the pivot

     

    Ich überlege manchmal einen Schritt zurück zu machen und im MT4 oder MT5 jemanden zu finden der es programmieren kann,.

    lg in die Runde dort

    Razz thanked this post
    #193023 quote
    Razz
    Participant
    Master

    Guten Morgen JohnScher

    Werde Ich Micha ausrichten wenn er aus dem Urlaub zurück ist .

    Danke für Deine Antwort ja sowas hab Ich mir auch schon gedacht .
    Dann werde Ich das wohl weiter von Hand machen müssen 😉
    Finde es ja super das Micha und Ivo es Teilen und kommentieren .
    Warum bist Du nicht mehr im Forum ?
    Bei Michas Drehpunkten warst Du damals dabei ?
    Habe hier unter den Indikatoren einen gefunden der mit den richtigen Einstellungen ähnlich funktioniert.

    Freue mich auf jedenfall über Deine Antwort
    und wünsche Dir noch einen schönen Tag

    #193233 quote
    Nicolas
    Keymaster
    Master

    Ich bin mir nicht sicher, wie das System funktionieren sollte, aber was ich bisher verstanden habe, ist, dass Sie die Order zum Breakeven (Schließen zum Handelseröffnungspreis) setzen möchten, wenn sie am Ende des Tages Verluste macht, und dies tun keinen Trade mehr eröffnen, bis diese Verlustorder endgültig geschlossen ist? Bitte bestätigen

    #193247 quote
    Razz
    Participant
    Master

    Hallo Nicolas Danke für Ihre Nachfrage .

    1. Trades die bis 22:00 im Gewinn sind sollen geschlossen werden .
    2. Trades die im laufe des aktuellen Handelstages 400 Punkte im Minus sind sollen geschlossen werden
    3. Trades die weder ins Ziel gelaufen sind noch Bedingung 1 oder 2 erfüllen sollen geschlossen werden sobald der Kurs der jeweiligen Tradeeröffnung erreicht wird ( das kann auch Wochen später sein )
    es soll aber in dieser Zeit normal weitergehandelt werden.
    4. Falls 3. programmierbar ist wird es entweder einen Zeitstopp geben oder eine Bb Punkt 3 so umsetztbar ist (Ich vermute eher nicht so wie es auch JohnScher im Post 05/10/2022 at 9:47 PM geschrieben hat )

    Im vorraus Vielen Dank

    #193266 quote
    Razz
    Participant
    Master

    Hallo JohnScher

    Ich soll Viele Grüße von MichaBL und Seniorzocker ausrichten .
    Sie würden sich wohl freuen mal wieder was von Ihnen zu lesen .

    Ich bin gespannt ob Nicolas noch eine Lösung für das Problem findet

    Ich wünsche Ihnen ein Gute Zeit

Viewing 15 posts - 16 through 30 (of 55 total)
  • You must be logged in to reply to this topic.

Pivot Trade hlco/4


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
Razz @razz Participant
Summary

This topic contains 54 replies,
has 7 voices, and was last updated by robertogozzi
3 years ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 02/07/2022
Status: Active
Attachments: 9 files
Logo Logo
Loading...