If this is your holy grail, you need to look more ...
inputs: Price( Close ), RSILength( 5 ),SMALength(150), OverSold( 30 ), OverBought( 70 ) ;
variables: MyRSI( 0 ) ;
variables: Counter( 0 ) ;
MyRSI = RSI( Close, RSILength ) ;
if Currentbar > 1 and MyRSI crosses under OverSold...