The things i don't really understand is how do you know that divergence has taken place or not?
and what are the entry and exit rule??
You know there is divergence when the price moves one way and the oscillator, in this case the RSI moves the other way... In the chart below, look at the orange line. See how the price made a higher high and formed a pinbar (not so perfect but close enough to demo purposes) and RSI made a lower high? That is Divergence. So now you have a pinbar candle signalling possible reversal and at the same time you have RSI making a lower high, also signalling reversal. Also, RSI was above the 70 level and headed downward. So this is the setup we are looking for. Now we set a pending order Short a few pips below the low of the pinbar. SL is a few pips above the pinbar, and TP1 is equla to SL or nearest reistance/support level. That is all there is to it ... Very simple