Please code this simple Strategy for Pi

Buy when Candle closes above 10 SMA and 10 SMA is above 50 EMA.

Sell when Candle closes below 10 SMA and 10 SMA is below 50 EMA

As per the above condition 

Buy Script:

CLOSE > SMA(CLOSE,10) AND SMA(CLOSE,10) > EMA(CLOSE,50)

Sell Script:

CLOSE < SMA(CLOSE,10) AND SMA(CLOSE,10) < EMA(CLOSE,50)