Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Oradba
An indicator such as this one can plot weekly prices on EOD charts, but it is not possible to plot actual weekly bars in the same chart window as far as I'm aware. Weekly price as shown below make it possible to plot many weekly indicators on EOD bars. See www.metastocktips.co.nz or Jose Silva's website at www.metastocktools.com
{Weekly OHLC}
{© 2005 Roy Larsen, www.metastocktips.co.nz}
{Use with Jose Silva's "Calendar Week counter" on EOD charts}
{User settings}
Q:=Input("Weekly OHLC Mode, 0=Static 1=Dynamic 2=Delayed",0,2,1);
{0, update at last bar of current frame}
{1, update on each new bar}
{2, update on first bar of new frame}
{Timing module for weekly frames}
I:=Fml("Calendar Week counter");
A:=DayOfWeek();
G:=LastValue(Highest(Sum(A=5,5))=5);
I:=I-ValueWhen(2-G,1,I);
M:=G+I;
F:=G+(M=0 AND PeakBars(1,A,1)=0);
A:=LastValue(Cum(1)-1)=Cum(1);
B:=Alert(A,2)*(A=0);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J);
J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J));
{Prices for weekly frames}
Ow:=ValueWhen(1,M,O);
Ow:=ValueWhen(1,J,If(J=1,Ow,ValueWhen(2-G,1,Ow)));
Hw:=HighestSince(1,M,H);
Hw:=ValueWhen(1,J,If(J=1,Hw,ValueWhen(2-G,1,Hw)));
Lw:=LowestSince(1,M,L);
Lw:=ValueWhen(1,J,If(J=1,Lw,ValueWhen(2-G,1,Lw)));
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
Ow:=ValueWhen(1,Ow>0,Ow);
Hw:=ValueWhen(1,Hw>0,Hw);
Lw:=ValueWhen(1,Lw>0,Lw);
{Plot results}
Ow; Hw; Lw; K; {Weekly OHLC}
Roy
MetaStock Tips & Tools
|