I would like to ask you about another indicator derivated from ROC and that I am sure you know, the Smoothed Rate of Change, developped by Fred G. Schutzman and mentioned by Alexander Elder in” Trading for a living”. I looked in different places but it seems they’re using not exactly the same formula to calculate it. I am using bellow’s one. Could you please let me know if it’s correct?
This is what I found about the Smoothed Rate of change (S-ROC):
Smoothed Rate of Change (S-RoC) is a refinement of Rate of Change (RoC) that was developed by Fred G Schutzman. It differs from the RoC in that it based on exponential moving averages (EMAs) rather than on price closes. Like the RoC, Smoothed RoC is a leading momentum indicator that can be used to determine the strength of a trend by determining if the trend is accelerating or decelerating. The S-RoC does this by comparing the current EMA to value that the EMA was a specified periods ago. Thus, a 7-day S-RoC compares the current EMA to the value that the EMA was seven days ago. The use of EMAs rather than the price close illuminates the erratic tendencies of the RoC.
How is it calculated?
RoC is calculated in three steps. First, the EMA is calculated. Then the momentum of the change in the EMA is calculated by subtracting the previous value of the EMA from the current EMA. Finally, the result is divided by the previous value of the EMA and multiplied by 100 to give a percentage. As the S-RoC is a RoC of EMA, it takes two periods: the period of the EMA, with the default being 13; and the period of the RoC, with the default being 21. The formula is: S-RoC = ( Current EMA – Previous EMA ) / ( Previous EMA ) x 100
where the previous EMA is the value that the EMA was at specified period ago. The result is a percentage that is plotted as an oscillator that oscillates between 100% and -100%.
So here is the code for prorealtime from this description:
1
2
3
4
5
6
7
8
EMAperiod=13
ROCperiod=21
EMA=exponentialaverage[EMAperiod](close)
SRoC=(EMA-EMA[ROCperiod])/(EMA[ROCperiod])*100
RETURNSRoCas"Smoothed ROC",0as"0"
Tell me if it’s OK for you and I’ll add it to the Library. You were not too far with your code though, the “Signal” variable calculation you made need to be applied on “media” and not on Close, and you’ll get the same curve as mine.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue