Rsi(OMA) enhanced

Category: Indicators By: Nicolas Created: August 27, 2018, 9:19 AM
August 27, 2018, 9:19 AM
Indicators
0 Comments

The RSIoMA is a simple RSI calculation of a moving average. In this version you can choose the smoothing period and method of the moving average (PriceSmoothing = period and PriceSmoothingM = method).
This version of the RSIoMA include the dynamic levels calculation for overbought and oversold zones.

Converted from an MT5 version by a request in the forum.

//PRC_RSIoMA extended | indicator
//27.08.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT5 version

// --- settings
RsiPeriod = 14 // Rsi period
PriceSmoothing  = 21 // Price smoothing (<= 1 for no smoothing)
PriceSmoothingM = 1 // Price smoothing method (MA mode)
MinMaxPeriod    = 50 // Floating levels period (<= 1 for fixed levels)
LevelUp         = 80.0 // Up level %
LevelDown       = 20.0 // Down level %
// --- end of settings 

RsiPrice = customclose   // Price to use
n=max(1,PriceSmoothing)
ma=average[n,PriceSmoothingM](RsiPrice)
rsioma=rsi[RsiPeriod](ma)

//levels
mmin = rsioma
mmax = rsioma
for k=1 to MinMaxPeriod-1 do
 mmin=min(rsioma[k],mmin)
 mmax=max(rsioma[k],mmax)
next
rrange = mmax-mmin
levelupz = mmin+LevelUp * rrange/100
leveldnz = mmin+LevelDown * rrange/100
levelmi = mmin+0.5*rrange

//colours
r=192
g=192
b=192
if rsioma>levelupz then
 r=50
 g=205
 b=50
elsif rsioma<leveldnz then
 r=255
 g=165
 b=0
endif

return rsioma coloured(r,g,b) style(line,3) as "RSIoMA",levelupz coloured(50,205,50) style(dottedline,2) as "Level Up", leveldnz coloured(255,165,0) style(dottedline,2) as "Level Down", levelmi coloured(155,155,155) style(dottedline,2) as "mid level"

 

Download
Filename: PRC_RSIoMA-extended.itf
Downloads: 195
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...