Require script for below stratedy?

buy:

when macd crossover occurs below 0 and trend is up

when macd histogram crosses > 1.2

sell:

when macd crossover occurs above 0 and trend is down

when macd histogram crosses <1.2

For the above given condition

Buy script:

MACDSignal(13, 26, 9, SIMPLE)>1.2 AND MACD(13, 26, 9, SIMPLE)>1.2 AND
TREND(CLOSE,5)=UP

Sell script:

MACDSignal(13, 26, 9, SIMPLE)<1.2 AND MACD(13, 26, 9, SIMPLE)<1.2 AND
TREND(CLOSE,5)=DOWN