EMA13 := EMA(CLOSE, 13); {13-PERIOD EXPONENTIAL MOVING AVERAGE}

MACD := EMA(CLOSE, 12) - EMA(CLOSE, 26); {MACD LINE}

SIGNAL := EMA(MACD, 9); {SIGNAL LINE}

MOMENTUM := MACD - SIGNAL; {MOMENTUM COMPONENT}

BULLISH := CLOSE > EMA13 AND MOMENTUM > REF(MOMENTUM, 1);

BEARISH := CLOSE < EMA13 AND MOMENTUM < REF(MOMENTUM, 1);

STICKLINE(BULLISH, LOW, HIGH, 2, 0), COLORRED; {BULLISH SIGNAL - RED}

STICKLINE(BEARISH, LOW, HIGH, 2, 0), COLORGREEN; {BEARISH SIGNAL - GREEN};