Nicolas

StepRSI

Category: Indicators By: Nicolas Created: December 25, 2016, 5:44 PM
December 25, 2016, 5:44 PM
Indicators
5 Comments
StepRSI

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"

 

Download
Filename: PRC_StepRSI.itf
Downloads: 165
Nicolas
Nicolas Legend
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

Maxime Baudin
9 years ago
#

Nice! Thanks :)

rfsteve
10 years ago
#

Nicolas what do you think of these modifications for 233 tick charts ?         cheers Steve.

A=CCI[6](TOTALPRICE)
B=TEMA[1000](A)
C=(RSI[500](B)-50)*15
StepSizeFast=6
StepSizeSlow=12
if barindex>C then
RSIBuffer=C
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,FastBuffer,SlowBuffer,0

 

Nicolas
10 years ago
#

Thanks for this modification, I still do not have tested it, where did you get this idea to build a RSI from a long term period TEMA of a CCI? 

rfsteve
10 years ago
#

Trial and error from study of indicators call it coding mad science was trying to find an indicator close to price pattern but with useful divergence still like most indicators not much good in strong trends as you will discover Nicolas.

Polnet
10 years ago
#

Gracias Nicolas, muy buen indicador

ProRealCode ProRealCode
Loading...