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

[EquisMetaStock Group] Re: ROC for YTD



PureBytes Links

Trading Reference Links

I am running 10.1 EOD. The code I posted plots. 

All I can suggest is that you enter the code I posted and verify line by line that you have entered the code properly. 

I get no plot - not even a 0 plot - when I leave out the last line of code which is what tells MS to draw something. 

Are you getting an error message, a horizontal line at 0, or a totally blank window?

If an error message, you misentered.
If you get a horizontal line at 0, you likely have an a non syntactic error in your code.
If you get no plot whatsoever, you left out the  line of the code that telss MS to plot something.

Try the code on several tickers.

I don't believe the code you posted and the code I posted are identical.

I can't be of further help. Sorry.




--- In equismetastock@xxxxxxxxxxxxxxx, "pbay01" <pbay01@xxx> wrote:
>
> Hi, 
> 
> That formula is exactly what I'm having problem with in my metastock 10.1. I can't seem to be able to run it. As you can see I'm really very bad at this, please help.
> 
> --- In equismetastock@xxxxxxxxxxxxxxx, "rsb_44" <rsb_44@> wrote:
> >
> > This indicator taken from Jose's site plots:
> > 
> > StDay:=Input("Day",1,31,1);
> > StMnth:=Input("Month",1,12,1);
> > StYear:=Input("Year",1800,2200,2006);
> > method:=Input("method:  [1]%-percent,  [2]$-points",1,2,1);
> > plot:=Input("plot:  [1]RoC,  [2]Date signal",
> >  1,2,1);
> > 
> > { 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);
> > 
> > { Plot in own window }
> > If(plot=1,eventRoC,event)
> > 
> > 
> > --- In equismetastock@xxxxxxxxxxxxxxx, "pbay01" <pbay01@> wrote:
> > >
> > > Hi, 
> > > 
> > > I tried changing it and tried every possible date values that I could possibly try but it comes out with nothing.
> > > As a guess, must I create some formula lines with todays date so that it knows what dates to measure against. For example today's price as compared against 31 Jan 2009.
> > > 
> > > Regards
> > > 
> > > --- In equismetastock@xxxxxxxxxxxxxxx, "rsb_44" <rsb_44@> wrote:
> > > >
> > > > StYear:=2009; { Previous Year, 1800~2200 }
> > > > 
> > > > The value should probably be 2008 not 2009. The comment says Previous year. This year is 2009.
> > > > 
> > > > 
> > > > 
> > > > --- In equismetastock@xxxxxxxxxxxxxxx, "pbay01" <pbay01@> wrote:
> > > > >
> > > > > 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/