Script to identify RSI divergence?

I have tried some options to create code to identify RSI divergence but I am unable to create a suitable one.

What i need is :

buy signal: price is decreasing but corresponding RSI is increasing.

sell signal: price is increasing but corresponding RSI is decreasing.

Any help is appreciated.

Thanks,

Raghav

hElLO tRaDeR,

This is the code for Pi:

BUY SCRIPT:

TREND(CLOSE, 3) = UP AND
TREND(RSI(CLOSE,14), 3) = DOWN

SELL SCRIPT:

TREND(CLOSE, 3) = DOWN AND
TREND(RSI(CLOSE,14), 3) = UP

3 represents number of candles, adjust the number of candles accordingly.

1 Like

AFL code for the same:

Is this for Pi?

Yes sire, I am looking for tradescript.

Thanks much for the prompt response!
This looks quite promising!
The power just went out so I will check it out as soon as it’s back!
Thanks again!

Thanks for pointing me in the right direction! This script does what it is supposed to do.

Hi
On streak, I’m trying to do create the following, but not being able to…will appreciate if anyone can help me put up the formula for the same:

Regular Bullish Divergence in Daily/Hourly (AND) Hidden Bullish Divergence in 5 mins

Thanks.