Hi
Your conditions are almost impossible to be realized because based on 5mn candle, it is quite difficult to get the previous RSI above and just after
the very first value of the RSI corresponding to current candle is above 50 level. It is not impossible but the chance to get this figure is difficult.
I recommend to increase the shift value to get the previous value of 3 or 4 candles ago for example or to work with completed values using shift 1 and 2 (Vs current value still fluctuating with shift 0) and here is the reason:
