Stopp nachziehen

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #39779 quote
    alexander48
    Participant
    New

    Liebe Freunde,

     

    habe einen automatische Positionseröffnung samt Stopp in ProRealTime programmiert. Wenn nun der Trade +40 DAX-Punkte ins Plus gelaufen ist, möchte ich den Stopp auf den Einstandspreis nachziehen.

    Beispiel:

    Eröffnungskurs 12.000

    Stopp 33

    bei Kurs von 12.040 Stopp ändern auf 12.000

    Wer kennt die Lösung?

    mfg

    #39863 quote
    Despair
    Blocked
    Master
    sl=33
    if close-positionprice>=40 then
       sl=close-positionprice
    endif
    set stop ploss sl

    So z.B..

    #39871 quote
    alexander48
    Participant
    New

    Thank You so much,

    I tried it but it stops still at the old stop

    Here the complete program an DAX 20170403

     

    // Start Long at 080000, close at 17:30h, SL18, TP180, newStopOver40

    // Code-Parameter
    DEFPARAM CumulateOrders = False // cumulation of positions deactivated
    DefParam FlatAfter = 173000 // close all orders and positions at 17:30

    // opening
    c6 = (CurrentTime = 080000)

    // condistion of opening Long
    IF c6 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    // Targets
    SET TARGET PPROFIT 180
    // Stop1
    SET STOP PLOSS 18

    // new stop over +40
    sl=18
    if close-positionprice>=40 then
    sl=close-positionprice
    endif
    set stop ploss sl

     

    whats wrong?

    many thanks

    #39873 quote
    alexander48
    Participant
    New

    also a 2.Variation uses the first stopp:

     

    // Start Long at 080000, close at 17:30h, SL18, TP180, newStopOver40

    // Code-Parameter
    DEFPARAM CumulateOrders = False // cumulation of positions deactivated
    DefParam FlatAfter = 173000 // close all orders and positions at 17:30

    // opening time
    c8 = (CurrentTime = 080000)

    // conditions of opening Long
    IF c8 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    // Targets
    SET TARGET PPROFIT 180
    // Stop1
    SET STOP PLOSS 18

    // new stop over +40
    if high-positionprice>=40 then
    SET STOP LOSS high-positionprice
    endif

    #39879 quote
    Nicolas
    Keymaster
    Master

    Please speak German in English Forums and >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<

    #39897 quote
    Despair
    Blocked
    Master

    Nimm in deiner ersten Variante die Zeile mit set stop ploss 18 weg, die ist ueberfluessig. Wenn’s dann immer noch nicht geht, solltest du mal graph benutzen, um zu gucken wie sich deine SL verändert.

    #39898 quote
    alexander48
    Participant
    New

    den SL 18 brauch ich aber, wenns tatsächlich gleich zu Beginn ins Minus läuft

    #39899 quote
    alexander48
    Participant
    New

    habs aber trotzdem versucht und jetzt stoppt er mich bei -40 aus!!

    #39900 quote
    alexander48
    Participant
    New

    Also: die folgende Anweisung stoppt bei -18

    // Code-Parameter
    DEFPARAM CumulateOrders = False // cumulation of positions deactivated
    DefParam FlatAfter = 173000 // close all orders and positions at 17:30
    
    // opening
    c6 = (CurrentTime = 080000)
    
    // condistion of opening Long
    IF c6 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Targets
    SET TARGET PPROFIT 180
    
    // new stop over +40
    sl=18
    if close-positionprice>=40 then
    sl=close-positionprice
    endif
    set stop ploss sl
    #39901 quote
    alexander48
    Participant
    New

    Habs weiter vereinfacht und statt “Close” “High” genommen (weil ja Close unter 40 sein kann obwohl high schon drüber wwar. Es bleibt aber beim Stopp -18

    // Code-Parameter
    DEFPARAM CumulateOrders = False // cumulation of positions deactivated
    DefParam FlatAfter = 173000 // close all orders and positions at 17:30
    
    // condition of opening Long
    IF CurrentTime = 080000 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Targets
    SET TARGET PPROFIT 180
    
    // new stop over +40
    sl=18
    if high-positionprice>=40 then
    sl=high-positionprice
    endif
    set stop ploss sl
    #39902 quote
    alexander48
    Participant
    New

    glaube ich habs: potitionpreis ist laut Handbuch nicht der Eröffnungskurs sondern der Durchschnittspreis der Position (und der erreicht tatsächlich nicht 40 über Einstand – ich brauche also statt positionprice den Eröffnungskurs und der heißt …………????

    #39903 quote
    alexander48
    Participant
    New

    der Eröffnungskurs laut Handbuch dürfte der “TRADEPRICE” sein, bringt aber auch keine Verbesserung. Weiter bei -18 ausgestoppt obwohl 49 im Plus

    #39911 quote
    Despair
    Blocked
    Master

    Alexander,

    Du drueckst dich wirklich recht schwerverständlich aus. tradeprice und positionprice geben dasgleiche Resultat, da deine Position nicht kumuliert ist. Das ist egal. Das Problem wird dadurch verursacht, dass du stop loss ja jede Candle wieder auf setzt. Das musst du verhindern. So z.B.:

    // Code-Parameter
    DEFPARAM CumulateOrders = False // cumulation of positions deactivated
    DefParam FlatAfter = 173000 // close all orders and positions at 17:30
     
    // opening
    c6 = (CurrentTime = 080000)
     
    // condistion of opening Long
    IF c6 THEN
    BUY 1 CONTRACT AT MARKET
    sl=18
    ENDIF
     
    // Targets
    SET TARGET PPROFIT 180
     
    // new stop over +40
    
    if close-positionprice>=40 then
    sl=close-positionprice
    endif
    set stop ploss sl
    #39914 quote
    alexander48
    Participant
    New

    Besten Dank. Bringt aber am 3.4.2017 als Resultat -41,9 statt ca. 0

    Woran liegts??

    #39952 quote
    Despair
    Blocked
    Master

    Alexander,

    Hast du dir mal mit graph die Variablen angeguckt?

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

Stopp nachziehen


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
Summary

This topic contains 18 replies,
has 4 voices, and was last updated by alexander48
8 years, 6 months ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 07/04/2017
Status: Active
Attachments: No files
Logo Logo
Loading...