Code in pi scanner requird

buy signal alert when candle close above 10sma and rsi 14 above 40 or 60 and macd crossover (12,26,9)
sell signal alert when candle close below 10 sma and rsi 14 below 60 or 40 and macd crossover (26,12,9)

for the above given condition

Buy script:

CLOSE>SMA(CLOSE,10) AND RSI(CLOSE,14)>40 OR RSI(CLOSE,14)<60 AND CROSSOVER(MACDSignal(12, 26, 9, SIMPLE), MACD(12, 26, 9, SIMPLE)) = TRUE

Sell Script:

CLOSE<SMA(CLOSE,10) AND RSI(CLOSE,14)>40 OR RSI(CLOSE,14)<60 AND CROSSOVER( MACD(12, 26, 9, SIMPLE),MACDSignal(12, 26, 9, SIMPLE)) = TRUE