PureBytes Links
Trading Reference Links
|
Aaaargh, again there is an error. Change the last line to
SQRT( ( R3 - R2 * R2 / NN ) / ( NN - 1 ) );
I suspect it will give a divide by zero error on the first calculable
observation, when NN - 1 = 0. So maybe this line should allow for
that by doing something like
SQRT( ( R3 - R2 * R2 / NN ) / Max( NN - 1, 1 ) );
Again, all of this is OTC. The value will then be zero for this first
observation (as here R3 = R2 * R2 and NN = 1, so the difference
becomes zero - the variance in just one observation is zero!). Better
to just ignore that observation. I am sure you can cook up code to
make MS do it, but after 100 or so observations its impact will be
small....
Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://www.ferra4models.com
http://fun.ferra4models.com
--- In equismetastock@xxxxxxxxxxxxxxx, mgf_za_1999 <no_reply@xxxx> wrote:
> Hi there,
>
> Try something like
>
> R1 := ROC(C,13,%);
> R2 := Cum(R1);
> R3 := Cum(R1*R1);
> NN := Cum(R3>0);
>
> SQRT( NN / (NN-1) * ( R3 - R2 * R2 ) );
>
> Regards
> MG Ferreira
> TsaTsa EOD Programmer and trading model builder
> http://www.ferra4models.com
> http://fun.ferra4models.com
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "robcpettit" <robcpettit@xxxx>
> wrote:
> > I think Ive done it using Stdev(ROC(C, 13, % ), 2), I dont quite
> > understand how though. Igot to involved in th periods, thinking I it
> > would go something like, say 100 days of data, day 13 the roc kicks in
> > and the stdev would be for prev 13 days, next day would be for prev 14
> > days then 15 etc. Entering the period as 2 has done excactly the same.
> > Ive checked the calculation in excel. What Idont undestand is what is
> > the period part telling the stdev to do.
> > Regards Robert
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hajh9f2/M=362131.6882500.7825259.1493532/D=groups/S=1705375617:TM/Y=YAHOO/EXP=1124139837/A=2889190/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Put more honey in your pocket. (money matters made easy) Welcome to the Sweet Life - brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> 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/
|