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
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")
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
Hast du meinen Code ausprobiert? Funktioniert?
In meinem Code gibt es bereits die Variable EntryPrice.
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!