The StepRSI or the Step Relative Strength Index oscillator is made of a classic RSI with 2 others lines that are calculated upon its variation, the “step RSI fast” and the “step RSI slow”. These 2 lines are changing their values by doing steps, if the RSI has made variations of the “StepSize” parameters. This indicator can be used in different ways : breakout of RSI zone made by the RSI step lines or just use it as a filter of the whipsaws of the original oscillator. This indicator has been converted from MT4 version.
//PRC_StepRSI | indicator
//25.12.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//Converted from MT4 version
// --- parameters
//RSIPeriod=14
//StepSizeFast=5
//StepSizeSlow=15
// ---
Price=customclose
if barindex>RSIPeriod then
RSIBuffer=RSI[RSIPeriod](Price)
smax=RSIBuffer +2.0*StepSizeFast
smin=RSIBuffer -2.0*StepSizeFast
trend=trend[1]
if (trend[1]<=0 and RSIBuffer>smax[1]) then
trend=1
endif
if (trend[1]>=0 and RSIBuffer<smin[1]) then
trend=-1
endif
if(trend>0) then
if(smin<smin[1]) then
smin=smin[1]
endif
result=smin+StepSizeFast
endif
if(trend<0) then
if(smax>smax[1]) then
smax=smax[1]
endif
result=smax-StepSizeFast
endif
FastBuffer = result
smaxSlow=RSIBuffer +2.0*StepSizeSlow
sminSlow=RSIBuffer -2.0*StepSizeSlow
trendSlow=trendSlow[1]
if (trendSlow[1]<=0 and RSIBuffer>smaxSlow[1]) then
trendSlow=1
endif
if (trendSlow[1]>=0 and RSIBuffer<sminSlow[1]) then
trendSlow=-1
endif
if(trendSlow>0) then
if(sminSlow<sminSlow[1]) then
sminSlow=sminSlow[1]
endif
result=sminSlow+StepSizeSlow
endif
if(trendSlow<0) then
if(smaxSlow>smaxSlow[1]) then
smaxSlow=smaxSlow[1]
endif
result=smaxSlow-StepSizeSlow
endif
SlowBuffer = result
endif
RETURN RSIBuffer as "RSI", FastBuffer as "Fast Step RSI", SlowBuffer as "Slow Step RSI", 50 as "level 50", 30 as "level 30", 70 as "level 70"