| 
 PureBytes Links 
Trading Reference Links 
 | 
Hi Preston
If you look at my code you'll see that the "Date" variable changes state on the user date. If that doesn't occur on a required date it will go TRUE on the next available bar with no concern for the charts periodicity. The "Start" variable merely captures the leading edge of "Date" to provide a one-off event for triggering ValueWhen(). I cheated - this concept comes from my "Date Filter" indicator.
Regards
Roy
  ----- Original Message ----- 
  From: pumrysh 
  To: equismetastock@xxxxxxxxxxxxxxx 
  Sent: Friday, September 14, 2007 3:17 PM
  Subject: Re: [EquisMetaStock Group] ROC Since Date
  Roy,
  Glad you jumped on this on!
  I had worked out the daily and weekly using the formulas below but 
  couldn't get around the monthly.
  Preston
  {Daily ROC}
  Day1 := Input("Day",1,31,4);
  Month1 := Input("Month",1,12,1);
  Year1 := Input("Year",1900,2400,1999); 
  XD:=ValueWhen(1,DayOfMonth()=Day1 AND
  Month()=Month1 AND Year()=Year1,CLOSE);
  100 * (CLOSE - XD) / XD; 
  {Weekly ROC}
  Day1 := Input("Day",1,31,4);
  Month1 := Input("Month",1,12,1);
  Year1 := Input("Year",1900,2400,1999); 
  XW:=ValueWhen(1,DayOfWeek()=5 AND
  Month()=Month1 AND Year()=Year1,CLOSE);
  100 * (CLOSE - XW) / XW; 
  --- In equismetastock@xxxxxxxxxxxxxxx, "Roy Larsen" <rlarsen@xxx> 
  wrote:
  >
  > Hi Jeff
  > 
  > 
  > Try this.
  > 
  > D1:=Input("Day",1,31,4);
  > M1:=Input("Month",1,12,1);
  > Y1:= Input("Year",1900,2400,1999);
  > D:=DayOfMonth(); M:=Month(); Y:=Year();
  > Date:=D>=D1 AND M=M1 AND Y=Y1 OR Y>Y1 OR Y=Y1 AND M>M1;
  > Start:=Date AND Alert(Date=0,2);
  > StartVal:=ValueWhen(1,Start,C);
  > 100*(C-StartVal)/StartVal;
  > 
  > 
  > Regards
  > 
  > Roy
  > www.metastocktops.co.nz
  > 
  > 
  > 
  > ----- Original Message ----- 
  > From: jwlcfp 
  > To: equismetastock@xxxxxxxxxxxxxxx 
  > Sent: Friday, September 14, 2007 10:42 AM
  > Subject: [EquisMetaStock Group] ROC Since Date
  > 
  > 
  > I am currently using the following formula to calculate the rate 
  of 
  > change since a selected date:
  > 
  > Day1 := Input("Day",1,31,4);
  > Month1 := Input("Month",1,12,1);
  > Year1 := Input("Year",1900,2400,1999);
  > 
  > 100 * (CLOSE - ValueWhen(1,DayOfMonth() = Day1 AND Month() = 
  Month1 
  > AND Year() = Year1, CLOSE))/ ValueWhen(1,DayOfMonth() = Day1 AND 
  Month
  > () = Month1 AND Year() = Year1,CLOSE) 
  > 
  > The formula works on the daily chart but not on the weekly or 
  monthly 
  > charts, unless the specified date is the last trading day of the 
  week 
  > or month. If the date is not at the end of the week or month, I 
  lose 
  > the chart. Does anyone know how to change the formula so the 
  date 
  > will go to the last trading day of the week (if in the 
  > weekly mode) and the last trading day of the month (if in the 
  monthly 
  > mode).
  > Thanks for your help,
  > Jeff
  > 
  > 
  > 
  > 
  > 
  > __________ NOD32 2529 (20070913) Information __________
  > 
  > This message was checked by NOD32 antivirus system.
  > http://www.eset.com
  > 
  > 
  > [Non-text portions of this message have been removed]
  >
   
  __________ NOD32 2529 (20070913) Information __________
  This message was checked by NOD32 antivirus system.
  http://www.eset.com
[Non-text portions of this message have been removed]
 
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/
 
 |