How to code RSI strategy on Pi?

I want code for buy when rsi moves above 60 and stay long as long as its above 60

And a sell strategy. when Rsi moves below 40 and stay short as long as rsi stays below 40

please help me with coding . I dont know about coding

CROSSOVER(REF(RSI(CLOSE,14),1) , 60) AND
RSI(CLOSE,14) > 60

CROSSOVER(40 , REF(RSI(CLOSE,14),1)) AND
RSI(CLOSE,14) < 40