[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Re: RSI Calculation



PureBytes Links

Trading Reference Links

Preston, Thanks for your reply.

I'm not sure which method Wilder used. But it seems that MS actually 
does use EMA smoothing in computing the RSI. I state this for the 
following reason.

When I directly compare my spreadsheet calculations of RSI (where 
EMAs are used but are computed recursively) with MS's results for SPY 
from 1993 through the present (using a 14 bar period), the greatest 
percentage error is 0.0003%. On that basis, it most definitely 
appears that MS also uses EMAs in its internal calculation.

I'm wondering if anyone among the MS development community is 
participating in this group who can definitively state which method 
is used?

KM


--- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@xxx> wrote:
>
> Kenneth,
> 
> The major flaw that I see with your code is the method of smoothing 
> which should be Wilder's not Exponential. There are literally 
dozens 
> of ways to write the code. You can find some here:
> http://trader.online.pl/MSZ/e-0-tytulowa-r.html
> You may also search our archived messages and find a few that are 
not 
> there and may work even better.
> 
> Preston
> 
> 
> 
> --- In equismetastock@xxxxxxxxxxxxxxx, "antoinesax" <kennethmetz@> 
> wrote:
> >
> > Prior to exploring some variations for RSI, I thought it best to 
> first 
> > verify my own coding for this indicator in comparison with 
> MetaStock's 
> > calculation. 
> > 
> > Much to my surprise, the results differed widely when applied to 
> SPY 
> > (from first data in 1993 through present date). Although 
generally 
> > zigging and zagging in the same direction, the two differ 
> > significantly with ratio (my own code vs MS) varying from around 
> 0.5 
> > to 1.3.
> > 
> > On the other hand, a spreadsheet version nearly matches MS, 
> suggestion 
> > a problem in the MS coding. The only difference in the two 
versions 
> is 
> > that I used recursive formulas in the spreadsheet to implement 
the 
> > EMA, whereas I simply used the Mov(C, N, E) function in MS.
> > 
> > Can someone point out the error in the code shown below?
> > 
> > 
> > Thanks,
> > 
> > KM
> > 
> > PS. Please note that the code uses the most logical definition of 
> RSI, 
> > which is mathematcially equivalent to the standard version using 
RS 
> > that was (maybe) computationally simpler three decades ago when 
> this 
> > indicator was invented...
> > 
> > 
> > ===========================================
> > 
> > Npds := Input("Periods",1,5000,14);
> > Chng := C - Ref(C,-1);
> > Adv := If(Chng>0,Chng,0);
> > Dec := If(Chng<0,-Chng,0);
> > AvgAdv := Mov(Adv,Npds,E); 
> > AvgDec := Mov(Dec,Npds,E); 
> > RSItest := 100*AvgAdv/(AvgAdv+AvgDec);
> > 
> > 
> > RSItest
> >
>




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/