PureBytes Links
Trading Reference Links
|
Hi to everyone,
Here are two indicators that I saw here in this group, but when I try
to
use them seems like something is wrong with the var peri.
First I noticed that in loc:= L<Ref(LLV(L,peri),-1) AND
L<=Ref(LLV(L,peri),peri); the last peri have to have a "-" sign, isn't
it?
And then the author made some multiplications and divisions by 5 or 4,
instead the peri that we input in the first line.
All of this shows me that the indicator doesn't have the period that
we
input as
a peri.
Thank you for any help, and I would appreciate any suggestion for
apply
them to an
indicator like CCI.
The formulas are like this:
1 ***TDLineLow***
2 peri:=Input("Priod?",2,100,4);
3 {by FREDCOM, 26May2003 --> V1.13}
4 loc:= L<Ref(LLV(L,peri),-1) AND L<=Ref(LLV(L,peri),peri);
5 y1t:=LastValue(ValueWhen( 2, loc=1, L ));
6 y2t:=LastValue(ValueWhen( 1, loc=1, L ));
7 x1t:=LastValue(ValueWhen( 2, loc=1, Cum(1) ));
8 x2t:=LastValue(ValueWhen( 1, loc=1, Cum(1) ));
9 {at:=(y1t-y2t)/(x1t-x2t);bt:=y1t-at*x1t;}
10 yt:=(y1t-y2t)/(x1t-x2t)*Cum(1)+y1t-(y1t-y2t)/(x1t-x2t)*x1t;
11 {yt:=at*cum(1)+bt;}
12 e1:=L-yt;
13 ret1:=LastValue(Cum(1)-(x1t+Int((x2t-x1t)/2)-1));
14 seg1:=LastValue(Int((x2t-x1t)/2+Int(2*peri/5)){+peri-1});
15 x1:=LastValue(Cum(1)-LLVBars(Ref(e1,-ret1),seg1)-ret1);
16 y1:=LastValue(ValueWhen(1,x1=Cum(1),L));
17 ret2:=LastValue(Cum(1)-(x2t+Int(5*peri/5)));
18 seg2:=LastValue(Int((x2t-x1t)/2)+Int(4*peri/5));
19 x2:=LastValue(Cum(1)-LLVBars(Ref(e1,-ret2),seg2)-ret2);
20 y2:=LastValue(ValueWhen(1,x2=Cum(1),L));
21 {a:=(y1-y2)/(x1-x2);b:=y1-a*x1;}
22 a:=(y1-y2)/(x1-x2);
23 LoTL:=If(Cum(1)>x1t-5,(y1-y2)/(x1-x2)*Cum(1)+y1-(y1-y2)/(x1-x2)
24 *x1,BarsSince(Cum(1)>x1t-5));
25 Diff:=Ref(H-LoTL,-LastValue(Cum(1)-x2t));
26 decal:=LastValue(HHV(Diff,x2t-x1t));
27 LoTL;LoTL+decal;
1 ***TDLineHigh***
2 peri:=Input("Période?",2,100,5);
3 {by FREDCOM, 26Mai2003 --> V1.13}
4 hic:= H>Ref(HHV(H,peri),-1) AND H>=Ref(HHV(H,peri),peri);
5 y1t:=LastValue(ValueWhen( 2, hic=1, H ));
6 y2t:=LastValue(ValueWhen( 1, hic=1, H ));
7 x1t:=LastValue(ValueWhen( 2, hic=1 , Cum(1) ));
8 x2t:=LastValue(ValueWhen( 1, hic=1 , Cum(1) ));
9 {at:=(y1t-y2t)/(x1t-x2t);bt:=y1t-at*x1t;}
10 yt:=(y1t-y2t)/(x1t-x2t)*Cum(1)+y1t-(y1t-y2t)/(x1t-x2t)*x1t;
11 {yt:=at*cum(1)+bt;}
12 e1:=H-yt;
13 ret1:=LastValue(Cum(1)-(x1t+Int((x2t-x1t)/2)-1));
14 seg1:=LastValue(Int((x2t-x1t)/2+Int(2*peri/5)){+peri-1});
15 x1:=LastValue(Cum(1)-HHVBars(Ref(e1,-ret1),seg1)-ret1);
16 y1:=LastValue(ValueWhen(1,x1=Cum(1),H));
17 ret2:=LastValue(Cum(1)-(x2t+Int(4*peri/5)));
18 seg2:=LastValue(Int((x2t-x1t)/2)+Int(4*peri/5));
19 x2:=LastValue(Cum(1)-HHVBars(Ref(e1,-ret2),seg2)-ret2);
20 y2:=LastValue(ValueWhen(1,x2=Cum(1),H));
21 {a:=(y1-y2)/(x1-x2);b:=y1-a*x1;}
22 a:=(y1-y2)/(x1-x2);
23 HiTL:=If(Cum(1)>x1t-5,(y1-y2)/(x1-x2)*Cum(1)+y1-(y1-y2)/(x1-x2)
24 *x1,BarsSince(Cum(1)>x1t-5));
Diff:=Ref(HiTL-L,-LastValue(Cum(1)-x2t));
decal:=LastValue(HHV(Diff,x2t-x1t));
HiTL;HiTL-decal;
------------------------ Yahoo! Groups Sponsor --------------------~-->
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|