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

Re: [EquisMetaStock Group] Re:Coppock


  • Date: Sat, 13 Mar 2010 20:31:38 +1300
  • From: "Roy Larsen" <rlarsen@xxxxxxxxxx>
  • Subject: Re: [EquisMetaStock Group] Re:Coppock

PureBytes Links

Trading Reference Links



Hi Henry
 
 
Good work. There's a small mistake in the formula that I only spotted while trying to convert it to the Multi-Frame format. The last 6 characters of the CG definition should be ")))/55" rather than "))/55)" - i.e the last closing bracket is in the wrong place. As CG is a weighted moving average of A1 it can also be coded simply as..
CG:=Mov(A1,10,W);
 
Unfortunately the Multi-Frame version still has use WMA coded the long way.
 
The Multi-Frame code (below "Copock Curve Monthly") effectively allows the monthly Copock Curve of the DOW to be dropped onto any EOD chart where its monthly values can be read off (the curve steps at the end of each month). Using the Security() function to call "Multi-Frame D Copock Curve" from the DOW would be the most appropriate way to do this - see "Copock Curve Monthly" immediately below. There's another way to go to achieve the same monthly value on any EOD chart but it involves inserting the Security() function into the Multi-Frame formula and I'd rather not go there right now.
 
 {Copock Curve Monthly}
Security("C:\Pathname...\$DJI",Fml("Multi-Frame D Copock Curve"));
 
 {Multi-Frame D Copock Curve}
 {Requires Equis Forum DLL}
 {Adapted by Roy Larsen, 2010, 13/3/10}
 
 {User settings}
N:=Input("Multi-Frame D Copock Curve,  Periods 1",1,99,11);
R:=Input("Periods 2",1,99,14);
J:=Input("Months per Frame, (0 for Weekly frames)",0,12,1);
J:=If(J<5 OR Mod(J,3)=0 AND (J<>9),Int(J),-1);
G:=Input("End-of-week Offset (Weekly frames only)",0,6,0);
Q:=Input("Mode, 0=Static 1=Dynamic 2=Delayed",0,2,1);
 {Update on last bar, new bar or new frame}
 
 {Timing signals}
 {Day counter by metastocktools.com}
D:=DayOfWeek();M:=Month();Y:=Year();
Z:=Cum(1);F:=Rnd(Life(291231));
M:=If(J=0,ValueWhen(1,Z=1,F+D-G-1)-F,
(Y-ValueWhen(1,Z=1,Y))*12+M);
I:=If(J=0,Int(M/7),Int((M-1)/Max(1,J)));
I:=I>ValueWhen(2,1,I);
G:=LastValue(J<0 OR Lowest(Sum(I>0,5))=5);
I:=ExtFml("Forum.Sum",I,1);M:=G+I;
F:=ExtFml("Forum.Sum",Ref(I,1),1)*(M=0)*(Z>1)+G;
B:=LastValue(Z);A:=B-1=Z;B:=B=Z;
F:=F+B*(Q=0)*(J=0)*(D=5);
J:=If(F,1,(Alert(F,2)=0)*M*2*(Z>1));
J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J);
J:=If(G,1,If(Q=2,M*2,J));
 
 {Frame CLOSE}
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
 
 {Copock Curve}
A:=ValueWhen(N+1,J,K); B:=ValueWhen(R+1,J,K);
A:=(100*K/ValueWhen(1,A>0,A))-100;
B:=(100*K/ValueWhen(1,B>0,B))-100;
D:=(A+B)/2;
G:=(10*D+ 9*ValueWhen(2,J,D)+
8*ValueWhen(3,J,D)+ 7*ValueWhen(4,J,D)+
6*ValueWhen(5,J,D)+ 5*ValueWhen(6,J,D)+
4*ValueWhen(7,J,D)+ 3*ValueWhen(8,J,D)+
2*ValueWhen(9,J,D)+ ValueWhen(10,J,D))/55;
G;
 
 
Regards
 
Roy
 
 
----- Original Message -----
From: Henry
Sent: Saturday, March 13, 2010 9:47 AM
Subject: [EquisMetaStock Group] Re:Coppock

 


Per1:=Input("length ",1,100,11);
Per2:=Input("length ",1,105,14);
A1:=(ROC(C,Per1,%)+ROC(C,Per2,%))/2;
CG:=((A1*10)+(Ref(A1,-1)*9)+(Ref(A1,-2)*8)+(Ref(A1,-3)*7)+(Ref(A1,-4)*6)+(Ref(A1,-5)*5)+(Ref(A1,-6)*4)+(Ref(A1,-7)*3)+(Ref(A1,-8)*2)+(Ref(A1,-9))/55);
CG;

Apply This to a monthly bar chart of the Dow,
or create a security of the dow and reference it in place of the C in A1

--- In equismetastock@yahoogroups.com, fibok@xxx wrote:
>
>
> _http://www.optionetics.com/market/articles/22401?utm_source=optionetics&utm
> _medium=wnl&utm_campaign_
> (http://www.optionetics.com/market/articles/22401?utm_source=optionetics&utm_medium=wnl&utm_campaign) =
>
>
> has anyone worked through this Coppock methodology in Metastock?
>
>
> Regards
>
> Bill
>



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4940 (20100312) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4940 (20100312) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___