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

[EquisMetaStock Group] Re: RSI Calculation



PureBytes Links

Trading Reference Links

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@xxx> 
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/