// Festlegen der Code-Parameter
DEFPARAM CumulateOrders = True // Kumulieren von Positionen deaktiviert
DEFPARAM Flatbefore=081500
DEFPARAM Flatafter=214500
// Bedingungen zum Einstieg in Long-Positionen
indicator1 = MACD[12,26,9](close)
c1 = (indicator1 crosses over 0)
indicator3 = Average[9](close)[5]
c3 = (close > indicator3)
IF NOT LongOnMarket AND c1 AND c3 THEN
BUY 3 SHARES AT MARKET NextBarOpen
ENDIF
// Bedingungen zum Ausstieg von Long-Positionen
indicator4 = Average[9](close)[5]
c4 = (close < indicator4)
indicator5 = MACD[12,26,9](close)
c5 = (indicator5 crosses under 0)
IF c4 AND c5 THEN
SELL AT MARKET
ENDIF