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

Re: DATE FUNCTIONS



PureBytes Links

Trading Reference Links

Erkan

> DOES METASTOCK HAS ANY DATE FUNCTIONS TO DRAW VERTICAL
> LINE OR PAINT THE BAR FOR EXAMPLE IF(DATE=1/4/01,1,0)?
> THANKS
> ERKAN

Use a combination of Year(), Month() and DayOfMonth() functions to create an indicator, drop it on a
chart without scale, and change style to histogram. You could cut down the following "Date Filter"
indicator to show only one date rather than a range.

  {Date Filter}
StDay:=Input("   Start day",1,31,1);
StMnth:=Input("Start month",1,12,8);
StYear:=Input("Start year",1980,2002,2001);
EnDay:=Input("     End day",1,31,31);
EnMnth:=Input("  End month",1,12,8);
EnYear:=Input("  End year",1980,2002,2001);
If((Year() > StYear OR (Year()=StYear AND ((Month() >
StMnth) OR (Month() = StMnth AND DayOfMonth() >=
StDay)))) AND (Year() < EnYear OR (Year()=EnYear AND
((Month() < EnMnth) OR (Month() = EnMnth AND
DayOfMonth() <= EnDay)))) ,1,0);

Roy