Halbe Position verkaufen

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #237603 quote
    axmichi
    Participant
    Senior

    Hallo

     

    ich möchte die halbe Anzahl an Position verkaufen, wenn der Trade nach 6 Tagen noch im Verlust ist.

    Ist der Trade nach 6 tagen im Gewinn dann soll der Stop Loss auf Tradeprice gelegt werden

    Hier mein Code, das mit der halben Position bekomme ich nicht hin???

    IF MyLongConditions THEN
    BUY 2 CONTRACT AT MARKET
    StopLoss = lowest[3](low)
    CRV11 = close + (close – StopLoss)
    Joker = close – ((close – StopLoss)/2)
    TargetPrice = close + 2*(close – StopLoss)
    SET STOP PRICE StopLoss
    SET TARGET PRICE TargetPrice
    endif

    if longonmarket and barindex-tradeindex>6 and close<tradeprice THEN
    sell size/2 at market
    endif

    If longonmarket and  barindex-tradeindex>6 and close>tradeprice then

    StopLoss = TradePrice
    SET STOP PRICE StopLoss

    endif

    #237652 quote
    robertogozzi
    Moderator
    Master

    Wenn Sie diese Linie hinzufügen, werden Sie feststellen, dass Trading nicht der Kaufpreis, sondern der letzte Preis eines Betriebs ist. Nach dem Verkauf von halben Verträgen ist dies der Ausgangspreis.

    graphonprice tradeprice

    Der Einstiegspreis muss in eine Variable eingefügt werden und verwenden:

    IF MyLongConditions THEN
       BUY 2 CONTRACT AT MARKET
       StopLoss = lowest[3](low)
       CRV11 = close + (close - StopLoss)
       Joker = close - ((close - StopLoss)/2)
       TargetPrice = close + 2*(close - StopLoss)
       SET STOP PRICE StopLoss
       SET TARGET PRICE TargetPrice
    endif
    IF onMarket and not onMarket[1] then
       EntryPrice = TradePrice     //Geben Sie den Einstiegspreis in die EntryPrice -Variable ein
    endif
    
    if longonmarket and barindex-tradeindex>6 and close<tradeprice and (abs(CountOfPosition) =2) THEN
       sell abs(CountOfPosition) / 2 contract at market
    endif
    
    If longonmarket and  barindex-tradeindex>6 and close>tradeprice then
       StopLoss = EntryPrice
       SET STOP PRICE StopLoss
    endif
    graphonprice StopLoss    coloured("Red")
    graphonprice TargetPrice coloured("Blue")
    Iván González thanked this post
    #237677 quote
    axmichi
    Participant
    Senior

    Hallo

     

    diese Zeile verstehe ich nicht:

    Der Einstiegspreis muss in eine Variable eingefügt werden und verwenden

    Ich habe eine Variable angelegt, aber es wird keine halbe Position verkauft? Siehe Bild

    Können Sie bitte ein Bild senden, was ich machen soll

    #237695 quote
    robertogozzi
    Moderator
    Master

    Hast du meinen Code ausprobiert? Funktioniert?

    In meinem Code gibt es bereits die Variable EntryPrice.

    #237697 quote
    axmichi
    Participant
    Senior

    Danke ja es funktioniert!! 🙂

     

    In Zeile 19 soll stehen, das wenn Close > Tradeprice, dann nur die halbe Position auf Break even!!

     

    und wenn dann der Kurs zu 100 % im Gewinn ist sollen beide Aktien auf Break even!

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

Halbe Position verkaufen


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
axmichi @axmichi Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by axmichi
1 year, 4 months ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 09/16/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...