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

How to do ... appendum



PureBytes Links

Trading Reference Links

Hello again,

meanwhile I was afraid of the case some top
Metastock programming cracks could not have
been understood the algorithm of the problem
described earlier and thus how to expand it
to meet the limits I run against described in
the former mail.

Therefore it will be demonstrated in the following
how to expand code sample 2 from N:=4 to N:=5

I wrote
"...IF YOU EXTEND the following code sample to N=12 ..."
---------- sample 2 -----------
N:= 4;
A:= Mov(C,N,S);

H0:=(C-A)*(C-A)
+(Ref(C,-1)-Avg)*(Ref(C,-1)-A)
+(Ref(C,-2)-Avg)*(Ref(C,-2)-A)
+(Ref(C,-3)-Avg)*(Ref(C,-3)-A)
;

H1:=(C-A)*(Ref(C,-1)-A)
+(Ref(C,-1)-A)*(Ref(C,-2)-A)
+(Ref(C,-2)-A)*(Ref(C,-3)-A)
;

H2:=(C- A)*(Ref(C,-2)-A)
+(Ref(C,-1)- A)*(Ref(C,-3)-A)
;

H3:=(C-A)*(Ref(C,-3)- A)
;

r1:=H1/H0;
r2:=H2/H0;
r3:=H3/H0;

r1; r2; r3;

+2/Sqrt(N);
-2/Sqrt(N);
---------- end of sample 2 -----------

... so here is the -- by one -- expanded example.
Please note the addition of the new lines which are
indented and also the new variables H4 and r4 to
deal with.

Thank you, Regards - Jasper

--- sample 2 expanded to N:= 5 ---
N:= 5;
A:= Mov(C,N,S);

H0:=(C-A)*(C-A)
+(Ref(C,-1)-Avg)*(Ref(C,-1)-A)
+(Ref(C,-2)-Avg)*(Ref(C,-2)-A)
+(Ref(C,-3)-Avg)*(Ref(C,-3)-A)
  +(Ref(C,-4)-Avg)*(Ref(C,-4)-A)
;

H1:=(C-A)*(Ref(C,-1)-A)
+(Ref(C,-1)-A)*(Ref(C,-2)-A)
+(Ref(C,-2)-A)*(Ref(C,-3)-A)
  +(Ref(C,-3)-A)*(Ref(C,-4)-A)
;

H2:=(C- A)*(Ref(C,-2)-A)
+(Ref(C,-1)- A)*(Ref(C,-3)-A)
  +(Ref(C,-2)- A)*(Ref(C,-4)-A)
;

H3:=(C-A)*(Ref(C,-3)- A)
  +(Ref(C,-1)- A)*(Ref(C,-4)-A)
;

  H4:=
  (C-A)*(Ref(C,-4)- A)

r1:=H1/H0;
r2:=H2/H0;
r3:=H3/H0;
  r4:=H4/H0;

r1; r2; r3;
  r4;

+2/Sqrt(N);
-2/Sqrt(N);
--- end of sample 2 expanded to N:= 5 ---