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"
Dear Nicolas
Thank you, this is a great tool and I use it in my trading.
I am trying to code a signal when the RSIOMA is turning and only when it does so over or under the 30 and 70 level. But I must be doing someting wrong what can you tell from below suggestion? If this is the wrong way to ask please say so. :)
//====================================================
// Confirmed turn
//====================================================
// Topp over 70
SellSignal = rsioma[2] < rsioma[1] AND rsioma[1] > rsioma AND rsioma[1] >= 70
// Bottom under 30
BuySignal = rsioma[2] > rsioma[1] AND rsioma[1] < rsioma AND rsioma[1] <= 30
//====================================================
// Draw Signal
//====================================================
IF BuySignal THEN
DRAWARROWUP(barindex,low)
ENDIF
IF SellSignal THEN
DRAWARROWDOWN(barindex,high)
ENDIF
Regards Joachim