PureBytes Links
Trading Reference Links
|
Hi, I 'm trying to explore what the YTD returns are for a list of stocks using the ROC function. I have a formula here searched from previous post a few years back but I can't seem to be able to get any results using my explorer. I know I'm missing out something, can someone please help me.
{ Rate of Change (RoC) YTD v1.0 }
{ Date inputs - today's date a year ago }
StDay:=06; { Current Day of month, 1~31 }
StMnth:=04; { Current Month, 1~12 }
StYear:=2009; { Previous Year, 1800~2200 }
method:=1; { Method: [1]%, [2]$points }
{©Copyright 2005-2006 Jose Silva.
The grant of this license is for personal use
only - no resale or repackaging allowed.
All code remains the property of Jose Silva.
http://www.metastocktools.com }
{ Data array }
x:=C;
{ Event date's signal }
date:=Year()>StYear
OR (Year()=StYear AND (Month()>StMnth
OR Month()=StMnth AND DayOfMonth()>=StDay));
event:=date AND Alert(date=0,2);
{ Event's Close value }
start:=Cum(IsDefined(event))=1;
eventVal:=ValueWhen(1,event OR start,x);
{ RoC since chosen event }
RoCper:=(x/eventVal-1)*100;
RoCpts:=x-eventVal;
{ Select % or $ method }
eventRoC:=If(method=1,RoCper,RoCpts);
eventRoC:=If(date,eventRoC,0);
{ RoC }
eventRoC
------------------------------------
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/
|