How to create algo for RSI Trigger Line strategy?

How to create algo for RSI Trigger Line strategy?

Condition:
The moving average of RSI indicates the average momentum, while RSI indicates current momentum. So we are trying to buy when RSI crosses above its moving average.The short RSI period of 7 is used to generate sufficient signals. The Moving Average period used is 15, arbitrarily the double of RSI period.
Buy: When RSI crosses above its trigger line and RSI>60
Sell: When RSI goes below trigger line and RSI<40 Reverse is applicable for shorting.