Need zerodha pi script

I need PI script for below condition, Can you please help

if stock goes above 50 EMA and MACD signal is <=0

also if Stock goes below 50 EMA and MACD is > 0 and 13 EMA crosses to 5 EMA

Thanks in advance

Please help on script

[quote=“akp29587, post:1, topic:31694”]
if stock goes above 50 EMA and MACD signal is <=0[/quote]

CROSSOVER(CLOSE , EMA(CLOSE,50)) AND 
MACD(13, 26, 9, SIMPLE) <= 0 

also if Stock goes below 50 EMA and MACD is > 0 and 13 EMA crosses to 5 EMA

EMA(CLOSE,50) > CLOSE AND 
MACD(13, 26, 9, SIMPLE) > 0 
CROSSOVER(EMA(CLOSE,13) , EMA(CLOSE,5))