RSI classical and hidden Divergences Indicator

Category: Indicators By: Francesco Created: December 22, 2017, 4:32 PM
December 22, 2017, 4:32 PM
Indicators
32 Comments

After a long work, I finally developed a simple, but useful RSI Divergences Indicator -Hey! another one?-

Yes, another one! (but I hope it is better than the default ProRealTime RSI Divergences Indicator).

This indicator finds both Direct (or Regular) and Hidden (or Inverse) RSI Divergences.

When a divergence is found, an Arrow is drawn to the chart and a text is added to the Arrow to mark the type of Divergence: “dd” = Direct Divergence; “hd” = Hidden Divergence

Indicator parameters:

  • RsiPeriod: number of bars to calculate RSI value, Default=10
  • RsiOverSold: Oversold Level, Default=30
  • RsiOverBought: OverBought Level, Default=70
  • MinBarRange: minimum distance from two consecutive RSI Highs or RSI Lows, Default=3

Comparing my indicator with ProRealTime RSI Divergence Indicator (using same parameters values), i found that entry points are exactly the same, except for new arrows added by my indicator in case of hidden divergence. That’s why ProRealTime indicator shows only regular divergences.

You can play with parameters to change sensivity.

Briefly, an RSI Divergence screener will be follow.

Merry Christmas!

Ciao!

//RSI Divergences By Frank (Francesco)

//Description: the indicator draws arrows on chart as entry points when a direct or an hidden RSI divergence is found.
//When a DIRECT divergence is found, "dd" (direct divergence) text is added to chart over (Sell signal) or under (Buy signal) the arrow

//When an HIDDEN or INVERSE divergence is found, "hd" (hidden divergence) text is added to chart over (Sell signal) or under (Buy signal) the arrow

//Variables:
//RsiPeriod: number of bars to calculare RSI value
//RsiOverSold: Oversold Level
//RsiOverBought: OverBought Level
//MinBarRange: minimum distance from two consecutive RSI Highs or RSI Lows

Rge = averagetruerange[10](close)
MyRSI = rsi[RsiPeriod](Close)

ONCE ShiftText = 3

RsiMax = MyRSI < MyRSI[1] and MyRSI[1] > MyRSI[2] and MyRSI[1] > RsiOverBought
RsiMin = MyRSI > MyRSI[1] and MyRSI[1] < MyRSI[2] and MyRSI[1] < RsiOverSold

if RsiMax then
 RSIMax1 = MyRSI[1]
 High1 = High[1]

 for I = MinBarRange to  80
  if RsiMax[I] then
   RSIMax2 = MyRSI[I + 1]
   High2 = High[I + 1]
   If High1 > High2 and RSIMax1 < RSIMax2 then
    DRAWARROWDOWN(barindex, High + Rge / ShiftText)coloured(255,192,203,255)
    DRAWTEXT("dd", barindex, High + Rge / ShiftText / 0.3,SansSerif,Italic,10)coloured(0,0,255,255)
   elsif High1 < High2 and RSIMax1 > RSIMax2 then
    DRAWARROWDOWN(barindex, High + Rge / ShiftText)coloured(255,192,203,255)
    DRAWTEXT("hd", barindex, High + Rge / ShiftText / 0.2,SansSerif,Italic,10)coloured(0,0,255,255)
   endif
   break
  endif
 next
endif

if RsiMin then
 RSIMin1 = MyRSI[1]
 Low1 = Low[1]

 for I = MinBarRange to  80
  if RSIMin[I] then
   RSIMin2 = MyRSI[I + 1]
   Low2 = Low[I + 1]
   If Low1 < Low2 and RSIMin1 > RSIMin2 then
    DRAWARROWUP(barindex, lOW - Rge / ShiftText)coloured(0,0,255,255)
    DRAWTEXT("dd", barindex, lOW - Rge / ShiftText / 0.3,SansSerif,Italic,10)coloured(0,0,255,255)
   elsif Low1 > Low2 and RSIMin1 < RSIMin2 then
    DRAWARROWUP(barindex, lOW - Rge / ShiftText)coloured(0,0,255,255)
    DRAWTEXT("hd", barindex, lOW - Rge / ShiftText / 0.2,SansSerif,Italic,10)coloured(0,0,255,255)
   endif
   break
  endif
 next
endif

return

 

Download
Filename: RSI-Divergences-1.itf
Downloads: 2439
Francesco Average
Code artist, my biography is a blank page waiting to be scripted. Imagine a bio so awesome it hasn't been coded yet.
Author’s Profile

Comments

Logo Logo
Loading...