EMA Crossover

Can anybody Please tell me code of EMA Crossover

Slow period 26

Fast period 12

Signal period 9

Same like MACD indicator of NSE Chartapp

When Buy square off at Sell, not only sell but take new position of short and same for Sell square off not only Buy but take new position.

Thanks

BUY:

CROSSOVER(EMA(CLOSE,12),EMA(CLOSE,26))
and
EMA(ClOSE, 9) > EMA(CLOSE,12)

SELL:

CROSSOVER(EMA(CLOSE,26),EMA(CLOSE,12))
and
EMA(ClOSE, 9) < EMA(CLOSE,12)

There is no easy way to do the second part of yours in tradescript. You may have to execute two orders simultaneously in quick succession.

Thanks a lot