On Price RSI Indicator

// — settings
rsiperiod=14
ATRperiod = 20
maPeriod = 20
maMethod = 0
overBought = 70
overSold = 30
// — end of settings
maPrice = customclose
dTR = 0
for i = 0 to ATRperiod1
dTR=dTR+max(abs(Dhigh(i)Dlow(i)),max(abs(Dhigh(i)Dclose(i+1)),abs(Dlow(i)Dclose(i+1))))
next
avgRange = dTR/ATRperiod
maValue = average[maPeriod,maMethod](maPrice)
rsivalue = rsi[rsiperiod](maPrice)
//—-
Buffer1=maValue
Buffer2=maValue+(avgRange*(overBought50)/100)
Buffer3=maValue(avgRange*(50  overSold)/100)
Buffer4=maValue+(rsivalue 50)/100*avgRange
return Buffer1  style(dottedline,1) as “mid level”, Buffer2  style(dottedline,1) as “overbought level”, Buffer3  style(dottedline,1) as “oversold level”, Buffer4 coloured(0,255,0) style(line,2) as “OnChart RSI”

How To Add Indicator

 

Leave a Comment