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

[EquisMetaStock Group] Re: How to find Highest and Lowest between two entered dates



PureBytes Links

Trading Reference Links

Arun,

Try this:

{ Start date }
sd:=Input("Enter Start Date-DD :",1,31,1);
sm:=Input("Enter Start Month-MM :",1,12,1);
sy:=Input("Enter Start Year-YYYY :",1950,2100,2005);

{ End date }
ed:=Input("Enter Start Date-DD :",1,31,31);
em:=Input("Enter Start Month-MM :",1,12,12);
ey:=Input("Enter Start Year-YYYY :",1950,2100,2006);

{ Starting point }
start:=Year()>sy
OR (Year()=sy AND (Month()>sm
OR Month()=sm AND DayOfMonth()>=sd));

{Ending Point}
end:=Year()<EY
OR (Year()=EY AND (Month()<EM
OR Month()=EM AND DayOfMonth()<=ED));

{Displays}
event:=start AND end;
Highest(ValueWhen(1,event,H));
Lowest(ValueWhen(1,event,L));
{end}


Hope this helps,

Preston


--- In equismetastock@xxxxxxxxxxxxxxx, "arun103" <arun103@xxx> wrote:
>
> How would you code in order to find the highest high and lowest low 
> values between two user entered dates? For instance, if one were to 
> find the above values between 01-01-2005 and 31-12-2006, which 
> function would be used?
> 
>  { Start date }
> sd:=Input("Enter Start Date-DD :",1,31,1);
> sm:=Input("Enter Start Month-MM :",1,12,1);
> sy:=Input("Enter Start Year-YYYY :",1950,2100,1990);
> 
>  { End date }
> ed:=Input("Enter Start Date-DD :",1,31,1);
> em:=Input("Enter Start Month-MM :",1,12,1);
> ey:=Input("Enter Start Year-YYYY :",1950,2100,1990);
> 
>  { Starting point }
> st:=Year()>sy 
> OR (Year()=sy AND (Month()>sm 
> OR Month()=sm AND DayOfMonth()>=sd)); 
> 
> Can anybody help?
> 
> aksh
>



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

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/