Need codes for mentiond strategy for bck test

Code required for below mentioned strategy

Entry Rules: 
Buy Only When Stock is Above 200-SMA, AND Below 5-Day SMA, With RSI Below 10 
Short Only when Stock is Below 200-SMA, AND Above 5-Day SMA, With RSI Above 90 

Exit Criteria: 
If Buying EXIT when Price goes Above 5 SMA. 
If Selling Exit when Price Goes Below 5 SMA. 

Please provide the code.

Thanks.

As per the above condition

Buy Script:

LAST > SMA(CLOSE,200) AND LAST < SMA(CLOSE,5) AND RSI(CLOSE,14)<10

Sell Script:

LAST > SMA(CLOSE,5)