gabri

RSI overbought/oversold bands on price

Category: Indicators By: gabri Created: April 18, 2017, 8:38 AM
April 18, 2017, 8:38 AM
Indicators
8 Comments
RSI overbought/oversold bands on price

This code draws the overbought/oversold lines on the price. You can change the default values (70 and 30) with the one you like the most and you can also add a EMA[26](close) that represent perfectly the RSI-50 line.

Blue skies

// oversold-overbought RSI band on price

RSIsuplimit=70
RSIinflimit=30
a=rsi[14](close)

up=max(close-close[1],0)
down=max(0,close[1]-close)

avgUPieri=wilderaverage[14](up[1])
avgDOWNieri=wilderaverage[14](down[1])

//calcolo fasci superiore
if a[1]<=RSIsuplimit then
 RAPPsuplimit=RSIsuplimit/(100-RSIsuplimit)
 avgUPoggiRSIsuplimit=avgDOWNieri*RAPPsuplimit
 upSUPlimit=(avgUPoggiRSIsuplimit*14)-(avgUPieri*13)
else
 RAPPsuplimit=RSIsuplimit/(100-RSIsuplimit)
 avgDOWNoggiRSIsuplimit=avgUPieri/RAPPsuplimit
 downSUPlimit=(avgDOWNoggiRSIsuplimit*14)-(avgDOWNieri*13)
endif
if a<=RSIsuplimit then
 sup=close[1]+upSUPlimit
else
 sup=close[1]-downSUPlimit
endif
//calcolo fascia inferiore
if a[1]<=RSIinflimit then
 RAPPinflimit=RSIinflimit/(100-RSIinflimit)
 avgUPoggiRSIinflimit=avgDOWNieri*RAPPinflimit
 upINFlimit=(avgUPoggiRSIinflimit*14)-(avgUPieri*13)
else
 RAPPinflimit=RSIinflimit/(100-RSIinflimit)
 avgDOWNoggiRSIinflimit=avgUPieri/RAPPinflimit
 downINFlimit=(avgDOWNoggiRSIinflimit*14)-(avgDOWNieri*13)
endif

if a<=RSIsuplimit then
 sup=close[1]+upSUPlimit
else
 sup=close[1]-downSUPlimit
endif

if a<=RSIinflimit then
 inf=close[1]+upINFlimit
else
 inf=close[1]-downINFlimit
endif

return sup as "RSI overbought", inf as "RSI oversold"

Download
Filename: Mio-rsi-su-prezzi.itf
Downloads: 365
gabri
gabri Master
Developer by day, aspiring writer by night. Still compiling my bio... Error 404: presentation not found.
Author’s Profile

Comments

Alain
3 years ago
#

Wilder MA is exactly the 50% line

bolsatonimora2
5 years ago
#

Hi, nice indicator, it´s possible to include a middle line with 50 value? ty!

gabri
5 years ago
#

Hi, EMA26 approximate almost exactly the 50% line

km20
6 years ago
#

this did not add to price window, but was added to seperate indicator window at bottom. how to add it to price directly as shown in the above picture ?

Nicolas
6 years ago
#

Add it on the price, by using the wrench on the left upper side of the price chart.

bolsatrilera
9 years ago
#

bravo, molto intelligente.

gabri
9 years ago
#

Thanks Nicolas!!

Nicolas
9 years ago
#

Another fine piece of code gabri! Excellent work again. Thanks a lot for your precious contribution.

ProRealCode ProRealCode
Loading...