What will be the cod to get alerts when price close above or below 50 sma

As per the above condition,

Buy Script:

CLOSE  > SMA(CLOSE,50)

Sell Script:

CLOSE  < SMA(CLOSE,50)

in this if i want to add volume as well i want to scane 2x or 5x volume amoung last 10 period

you can add that volume condition by using Operator AND