Hallo Ich habe eine Frage-
Ich möchte in den Trade einsteigen (kaufen) wenn die Farbe vom Supertrend Grün ist.
Wie muss man das im Code schreiben??
Danke
Da ist er:
myST = Supertrend[3,10]
Green = close > myST
IF Green AND Not OnMarket THEN
BUY 1 Contract at Market
ENDIF
SET STOP pLOSS 100
SET TARGET pPROFIT 300
Hallo Danke,
könnte Sie den SL ändern bitte.
Ich möchte einen Trailing Stop einfügen der mit ATR * 3 mit geht?
Vielen Dank!!
Sie können Stop Loss, Take Profit und Trailing Start nach Belieben ändern.
myST = Supertrend[3,10]
Green = close > myST
IF Green AND Not OnMarket THEN
BUY 1 Contract at Market
SET STOP pLOSS 400
SET TARGET pPROFIT 800
ENDIF
// ATR Trailing Stop
//
TrailStart = 30
IF Not OnMarket THEN
Atr = averagetruerange[14](close) * 2
StopLossL = close + Atr
StopLossS = close - Atr
ExitPrice = 0
ENDIF
myProfit = PositionPrice * PositionPerf / PipSize
IF myProfit >= TrailStart * PipSize THEN
IF ExitPrice = 0 THEN
IF LongOnMarket THEN
ExitPrice = StopLossL
ELSIF ShortOnMarket THEN
ExitPrice = StopLossS
ENDIF
ENDIF
IF LongOnMarket AND close > (ExitPrice + Atr + (TrailStart * PipSize)) THEN
ExitPrice = ExitPrice + Atr
ELSIF ShortOnMarket AND close < (ExitPrice - Atr - (TrailStart * PipSize)) THEN
ExitPrice = ExitPrice - Atr
ENDIF
ENDIF
IF LongOnMarket AND (ExitPrice > 0) THEN
SELL AT ExitPrice STOP
ELSIF ShortOnMarket AND (ExitPrice > 0) THEN
EXITSHORT AT ExitPrice STOP
ENDIF
//graphonprice StopLossL coloured("Green",255)
//graphonprice StopLossS coloured("Blue",255)
//graph myProfit