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

Re: [Metastockusers] Another question?????



PureBytes Links

Trading Reference Links

Greg

> I look for the formula which gives me the:
>
> 1 , The High of the last week.
> 2 , The low of the last week.
> 3 , The close of the last week.
>
> Thanks
>
> greg

  {Weekly OHLC}
  {Copyright© 2003 Roy Larsen}
  {rlarsen@xxxxxxxxxxxxxx}
  {use on daily charts}
Q:=Input("Dynamic Current Week, Yes=1",0,1,0);
 {0=Update when end of current week is known}
 {1=MS compatible dynamic current week}
M:=DayOfWeek()<=ValueWhen(2,1,DayOfWeek());
F:=DayOfWeek()=5;
A:=LastValue(Cum(1)-1)=Cum(1);
B:=LastValue(Cum(1))=Cum(1);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(A+LastValue(J)>2 OR B+Q>1,1,(B=0)*J);
Hw:=HighestSince(1,M,H);
Hw:=ValueWhen(1,J,If(J=1,Hw,ValueWhen(2,1,Hw)));
Lw:=LowestSince(1,M,L);
Lw:=ValueWhen(1,J,If(J=1,Lw,ValueWhen(2,1,Lw)));
Cw:=ValueWhen(1,J,If(J=1,C,ValueWhen(2,1,C)));
Ow:=ValueWhen(1,J,If(J=1,ValueWhen(1,M,O),
  ValueWhen(2,M OR Cum(1)=3,O)));
Ow:=ValueWhen(1,Lw>0,Ow); {O}
Hw:=ValueWhen(1,Lw>0,Hw); {H}
Lw:=ValueWhen(1,Lw>0,Lw); {L}
Cw:=ValueWhen(1,Lw>0,Cw); {C}
{Ow;} Hw; Lw; Cw;

Roy




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/zMEolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

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

<*> To unsubscribe from this group, send an email to:
     Metastockusers-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/