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

[EquisMetaStock Group] Re: Coding for period between 2 dates using single date input format



PureBytes Links

Trading Reference Links

Arun,

There were several problems with your code. The following code will 
work but only if there is a trading day on the date you have 
selected. The alert function will hold a statement true for a period 
of time and could be used to get around the problem.

Also note that the format you are using of mmddyyyy is not the best.
Consider using yyyymmdd.

{Start date}
dt1:=Input("Start date mmddyyyy",0,12312100,10072003);
{End date}
dt2:= Input("End date mmddyyyy",0,12312100,10072004);
{Start}
start:= dt1= Month()*1000000 + DayOfMonth()*10000+ Year();
{End}
end:= dt2= Month()*1000000 + DayOfMonth()*10000+ Year();
start OR end;


Preston

--- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@xxx> wrote:
>
> Arun,
> 
> In October ,when we were discussing 7 inputs, I gave you the 
> following link:
> 
> http://forum.equis.com/forums/thread/17014.aspx
> 
> There you will find a discussion on how its done.
>  
> Basically you use the inputs from the year, month, and day of the 
> month to derive a numerical value.
> 
> There is a problem with metastock's calculation method that could 
> effect the outcome so you will need to decide how you wish to 
> proceed. 
> 
> You should also be aware that there is a DLL version that will work 
> as well.
> 
> All is discussed there, so if you haven't done so, go to the link 
and 
> read at least the first and second page of the discussion. 
> 
> If you are still having problems let me know.
> 
> 
> Preston
> 
> 
> 
> --- In equismetastock@xxxxxxxxxxxxxxx, "arun103" <arun103@> wrote:
> >
> > How do you code the period between two dates if single date input 
> > format is being used?
> > 
> >  { Start date }
> > dt1:=Input("First date (mmddyyyy) :",1011960,12312100,1072008);
> > 
> >  { End date }
> > dt2:=Input("Second date (mmddyyyy) :",1011960,12312100,1072008);
> > 
> > With the metastock date functions, using the metastock date input 
> we 
> > can code it as follows:
> > 
> >  { Start }
> > start:=Year()>sy 
> > OR (Year()=sy AND (Month()>sm 
> > OR Month()=sm AND DayOfMonth()>=sd)); 
> > 
> >  { End }
> > end:=Year()<ey 
> > OR (Year()=ey AND (Month()<em 
> > OR Month()=em AND DayOfMonth()<=ed));
> > 
> > event:=start and end;
> > 
> > Please help
> > 
> > Regards
> > 
> > Arun
> >
>



------------------------------------

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/