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

RE: [Metastockusers] Weekly Pivot on Daily Chart



PureBytes Links

Trading Reference Links

Following code is what I use. 
See if it will help.

Regards,

{Pivot Points}
{Anonymous study}
{Extended by Dr. Torque, Ph.D. Finance}
{http://finance.groups.yahoo.com/group/FXtrades}
TF:=Input("1=hour 2=day 3=week 4=month 5=year ",1,5,2);
NW:=If(TF=1,ROC(Minute(),1,$)<0,If(TF=2,ROC(Hour(),1,$)<0,
If(TF=3,ROC(DayOfWeek(),1,$)<0,If(TF=4,ROC(DayOfMonth(),1,$)<0,ROC(Month(),1
,$)<0))));
A1:=Cum(1);
A2:=LastValue(A1-BarsSince(NW>0));
WH:=ValueWhen(1,Nw,Ref(HighestSince(1,Nw,H),-1));
WL:=ValueWhen(1,Nw,Ref(LowestSince(1,Nw,L),-1));
WCL:=ValueWhen(1,Nw,Ref(C,-1));
BP:=LastValue((WH+WL+WCL)/3);
R#2:= If(A1<A2,BarsSince(A1>=A2),LastValue(((WH+WL+WCL)/3) -
(2*((WH+WL+WCL)/3)-WH) +(2*((WH+WL+WCL)/3)-WL)));
R#1:= If(A1<A2,BarsSince(A1>=A2),LastValue(2*((WH+WL+WCL)/3)-WL));
 
PP:=If(A1<A2,BarsSince(A1>=A2),LastValue((WH+WL+WCL)/3));
S#1:= If(A1<A2,BarsSince(A1>=A2),LastValue(2*((WH+WL+WCL)/3)-WH));
S#2:=
If(A1<A2,BarsSince(A1>=A2),LastValue(((WH+WL+WCL)/3)-(((2*((WH+WL+WCL)/3) -
WL)-(2*((WH+WL+WCL)/3)-WH)))));
R#3:=R#2+(R#1-PP);
S#3:= S#2-(PP-S#1) ;
R#3;
R#2;
R#1;
PP;
S#1;
S#2;
S#3;

-----Original Message-----
From: Metastockusers@xxxxxxxxxxxxxxx [mailto:Metastockusers@xxxxxxxxxxxxxxx]
On Behalf Of ag2657
Sent: Friday, May 20, 2005 6:19 AM
To: Metastockusers@xxxxxxxxxxxxxxx
Subject: [Metastockusers] Weekly Pivot on Daily Chart


AS I'm a really not good at using Ms language, can anyone help me : 
I want to apply on a daily Chart the lines of the weekly Pivot. I try
to modify a formula given by Roy Larsen for ploting Daily Pivot on
Intraday chart but it doesn't function. Please thank you for your
help.

ALAIN


Here is the formula I try to make : 

{Daily Pivot Points}
{C 2004 Roy Larsen, rlarsen@xxx}
{for use on intraday charts}
A:=Input("Pivot Points - Day of Week Last Bar" ,0,7,5);
B:=Input("Hour of Days Last bar",0,23,17);
Q:=Input("Display Mode, 0=Static 1=Dynamic 2=Test",0,2,2);
{0=Display, update at last bar of week}
{1=Display, update on each new bar}
{2=Backtest, update on first bar of new week}
G:=LastValue(Highest(Sum(DayOfMonth()<>ValueWhen(2
,1,DayOfMonth()),5))=5);
I:= Month()<>ValueWhen(2,1, Month());
M:=G OR I;
F:=G OR (DayOfWeek()=A AND Hour()=B);
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)=2,1,J);
J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J));
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,L
w,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);
K:=ValueWhen(1,K>0,K);
M:=(Hw+Lw+K)/3; {mid point}
R2:=M+(Hw-Lw);
R1:=(M*2)-Lw;
S1:=(M*2)-Hw;
S2:=M-(r1-s1);
R1; R2; S1; S2;
ValueWhen(1+G,1,M);





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 the Yahoo! Terms of Service. 



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