DEFPARAM PreLoadBars = 1000
// Die Position wird um 21 Uhr 45 (lokale Zeitzone) glattgestellt.
DEFPARAM FlatAfter = 220000
DEFPARAM FlatBefore = 160000
// Keine neue Position nach dem Candlestick, der um 17 Uhr 15 schließt.
LimitEntryTime = 214500
StartTime = 160000
//Indikatoren
MACDH = MACD[12,26,9](close)
DiM = DI[14](close)
SuperT = Supertrend[10,3]
IF Time = StartTime THEN
// TradingRange wird festgelegt - 3h = 12 Bars von 13-16h
UpperLevel = Highest[12](High)
LowerLevel = Lowest [12](Low)
ENDIF
// BUY LONG
BL01 = MACDH > 0
BL02 = DiM > 0
BL03 = SuperT < (close)
BL04 = (close) > UpperLevel
BL05 = (close[1]) < UpperLevel
BL06 = Time <= LimitEntryTime
IF BL01 AND BL02 AND BL03 AND BL04 AND BL05 AND BL06 THEN
BUY 1 SHARES AT MARKET
ENDIF
//SELL LONG
SL01 = ((close - open) < 0)
IF SL01 THEN
SELL AT MARKET
ENDIF
// BUY SHORT
BS01 = MACDH < 0
BS02 = DiM < 0
BS03 = SuperT > (close)
BS04 = (close) < LowerLevel
BS05 = (close[1]) > LowerLevel
BS06 = Time <= LimitEntryTime
IF BS01 AND BS02 AND BS03 AND BS04 AND BS05 AND BS06 THEN
SELLSHORT 1 SHARES AT MARKET
ENDIF
//SELL SHORT
SS01 = ((close - open) > 0)
IF SS01 THEN
EXITSHORT 1 SHARES AT MARKET
ENDIF
SET STOP pLOSS 100
SET TARGET pPROFIT 3