logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

2 Pages<12
Options
Go to last post Go to first unread
mahen1602  
#21 Posted : Wednesday, March 19, 2008 10:53:50 PM(UTC)
mahen1602

Rank: Newbie

Groups: Registered, Registered Users
Joined: 1/12/2008(UTC)
Posts: 7

Weekly:
new:=ROC(DayOfWeek(),1,$)<0;
yh:=ValueWhen(1,new, Ref(HighestSince(1,new,H),-1));
yl:=ValueWhen(1,new, Ref(LowestSince(1,new,L),-1));
yc:=ValueWhen(1,new, Ref(C,-1));

pp:=(yc+yh+yl)/3;r1:=(pp*2)-yl;s1:=(pp*2)-yh;
r2:= pp+r1-s1;s2:= pp-r1+s1;r3:= pp+r2-s2;
s3:= pp-r2+s2;

r3;r2;r1;pp;s1;s2;s3;
mstt  
#22 Posted : Monday, March 24, 2008 4:34:52 PM(UTC)
mstt

Rank: Advanced Member

Groups ready for retrieval: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)

Hi Senthil

Static and Dynamic settings both plot historical weekly values as soon as Friday data is available. Dynamic differs on the week currently being formed in that it updates on each day of the week, thus returning a dynamic (changing) value until Friday data completes the current week. For example, the weekly close would be updated on the last bar as each day’s data is added. The Dynamic setting is most appropriate when weekly indicator is used visually on EOD charts.

The Static setting is more appropriate for system tests, remembering that that each weekly close becomes available only with the Friday close. In many cases it would be desirable to use the Static setting with a 1-bar delay. The Delayed mode provides this by holding off the weekly update until Monday data is available, i.e. the presence of Monday data is used to signal that the week ended on the previous bar. The Delayed setting is ideal for system testing and prevents the possible use of future data that could otherwise occur with carelessly written formulas.

Either the Static or Dynamic settings can be used at the weekend (after Friday data is added) for explorations requiring weekly data. I suggest you only use the Static setting for explorations during the week.

I suggest you use Mov(Typ(),5,S) on your EOD charts as the 5-period SMA of the pivot point (assuming pivot point is (H+L+C)/3). You could then monitor for this crossing above the higher of the weekly/monthly pivot point SMAs with something like this...

{Pivot Point Cross}

Pds:=Input("EOD Pivot Point Smoothing",1,10,5);

Wsma:=Fml("Weekly Pivot Point SMA");

Msma:=Fml("Monthly Pivot Point SMA");

Cross(Mov(Typ(),Pds,S),Max(Wsma,Msma));

To prevent errors when creating this indicator make sure that the weekly and monthly pivot point SMAs are created first.

{Weekly Pivot Point SMA}

{This indicator uses the Equis Forum DLL}

{Roy Larsen, 2004-2008}

{User settings}

N:=Input("Weekly Pivot Point SMA, Periods",1,99,3);

Q:=Input("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}

{Weekly frame timing}

{* Day counter from metastock@wabbit.com.au}

M:=Month();A:=Int((14-M)/12);D:=DayOfMonth();

Y:=Year()+4800-A;B:=M+(12*A)-3;

M:=D+Int((2+153*B)/5)+(365*Y)+Int(Y/4)-Int(Y/100)+Int(Y/400)-32045;

{*}I:=Int(M/7);

I:=I-ValueWhen(2,1,I);

G:=LastValue(Lowest(Sum(I>0,5))=5);M:=G+I;

F:=G+(M=0)*ExtFml("Forum.Sum",Ref(I,1),1);

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));

{Calculate weekly HLC prices}

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)));

Hw:=ValueWhen(1,Hw>0,Hw);

Lw:=ValueWhen(1,Lw>0,Lw);

{Calculate and plot SMA of weekly pivot points}

PP:=(K+Hw+Lw)/3;

J:=J>0; X:=Cum(J*PP);

(X-ValueWhen(N+1,J,X))/N;

{Monthly Pivot Point SMA}

{This indicator uses the Equis Forum DLL}

{Roy Larsen, 2004-2008}

{User settings}

N:=Input("Monthly Pivot Point SMA, Periods",1,99,2);

Q:=Input("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}

{Monthly frame timing}

D:=DayOfMonth();M:=Month();Y:=Year();

A:=ValueWhen(1,Cum(1)=1,Y);

M:=(Y-A)*12+M;I:=M-ValueWhen(2,1,M);

G:=LastValue(Lowest(Sum(I>0,5))=5); M:=G+I;

F:=G+(M=0)*ExtFml("Forum.Sum",Ref(I,1),1);

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));

{Calculate monthly HLC prices}

Hm:=HighestSince(1,M,H);

Hm:=ValueWhen(1,J,If(J=1,Hm,ValueWhen(2-G,1,Hm)));

Lm:=LowestSince(1,M,L);

Lm:=ValueWhen(1,J,If(J=1,Lm,ValueWhen(2-G,1,Lm)));

K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));

Hm:=ValueWhen(1,Hm>0,Hm);

Lm:=ValueWhen(1,Lm>0,Lm);

{Calculate and plot monthly pivot point SMA}

PP:=(K+Hm+Lm)/3;

J:=J>0; X:=Cum(J*PP);

(X-ValueWhen(N+1,J,X))/N;

Roy

MetaStock Tips & Tools

sennal999  
#23 Posted : Wednesday, March 26, 2008 3:16:23 AM(UTC)
sennal999

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/30/2007(UTC)
Posts: 11

Dear mstt,

Thank you very much for your kind cooperation.

Senthil Kumar.M

Users browsing this topic
Guest (Hidden)
2 Pages<12
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.