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

[EquisMetaStock Group] Re: Calculating lowest and highest for past dates



PureBytes Links

Trading Reference Links


Try this indicator code to get you closer to your solution:

=========================
Date filter - Hi/Lo/Close
=========================
---8<--------------------

{ Open/Hi/Lo/Close of specified date period }
{ http://www.metastocktools.com }

{ Date inputs }
StDay:=Input("start Day",1,31,1);
StMnth:=Input("start Month",1,12,1);
StYear:=Input("start Year",1800,2200,2005);
EnDay:=Input("end Day",1,31,1);
EnMnth:=Input("end Month",1,12,3);
EnYear:=Input("end Year",1800,2200,2005);

{ Selected date filter }
start:=Year()>StYear
 OR (Year()=StYear AND (Month()>StMnth
  OR Month()=StMnth AND DayOfMonth()>=StDay));
end:=Year()<EnYear
 OR (Year()=EnYear AND (Month()<EnMnth
  OR Month()=EnMnth AND DayOfMonth()<=EnDay));
date:=
start AND (end OR (start AND Alert(start=0,2)));

{ Open/Hi/Lo/Close for date period }
Op:=ValueWhen(1,date=1 AND Alert(date=0,2),O);
Hi:=Highest(ValueWhen(1,date,H));
Lo:=Lowest(ValueWhen(1,date,L));
Cl:=ValueWhen(1,
 date=0 AND Alert(date,2),Ref(C,-1));

{ Plot on price chart }
Op;  { Black }
Hi;  { Red   }
Lo;  { Blue  }
Cl;  { Green }

---8<--------------------


jose '-)
http://www.metastocktools.com



--- In equismetastock@xxxxxxxxxxxxxxx, "hg1az" <hg1az@xxxx> wrote:
> 
> 
> As I said I used to be able to program the MS language
> so well but seem to have forgotten so much.
> 
> How would I calculate the change from the lowest low
> (before the highest high) to the highest high during a
> date range, say 1-1-05 to 3-1-05? It seems it would
> need a combination of the date and bars ago functions.
> It also seems it would need to determine if a date was
> a trading day. I am totally lost.
> 
> Thanks, hg





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> 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/