Need help with a coding for RSI in pi

Trying to create a strategy in Pi for RSI with two candles.

Buy: Previous candle RSI< 80 and current candle RSI> 80 with current candle close> previous candle close.

Sell: Previous candle RSI> 20 and current candle RSI< 20 with current candle close < previous candle close.

Can anyone help with this strategy?

Why don’t you check out @Streak, it will be much easier to create there.

You easily create this in Streak.

Here are the conditions for Buy

buy signal:
sell signal:

Hi @veera_krishna

You can use this condition

Long Entry: RSI(0) higher than 80 and RSI(-1) lower than 80
Short Entry: RSI(0) lower than 20 and RSI(-1) higher than 20