PureBytes Links
Trading Reference Links
|
Stephane ,
Let us see the lines
tb=TroughBars(Low,5,1);
eki1=IIf(tb<=4 AND ...
According to AFL manual, TroughBars(Low,5,1)
"Plots the number of bars that have passed from the 1st trough.
This uses the Zig Zag function to determine the troughs.
Caveat: this function is based on Zig-Zag indicator and may look into
the future."
If the stock closed Day1 at 100 and it is a trough and
D1, 100.0
D2, 101.0
D3, 101.5
D4, 101.2
D5, 102.0
D6, 103.5
D7, 104.0
D8, 105.5
with the last close the formula will "see" that Day1 was a trough and
the bars that have passed are 7, i.e. tb=7 which is >4, hence tb<=4
is
false, although at D2, D3, D4 and D5 the condition tb<=4 was true.
If you plot the
graph0=tb<=4;
ten days later, you will see that it was true at above days, but you
do
not see that until the D8 close.
This is the problem for the last trough or the last peak.
Dimitris Tsokakis
--- In amibroker@xxxx, "Stephane Carrasset" <s.carrasset@xxxx> wrote:
>
> Dimitri,
>
> > Additional conditions will not change the problem.
> > And the problem is that the truth of a condition like
> > Dno1 > Dno2
> > is perhaps known some days later.
> > Please read #5290, #5292, #5293 messages I wrote for Nate.
>
> Do you think this wolf pattern is correct or it will be known some
> days later
> /*Wolf Buy Pattern*/
>
> Pa=Trough(Low,5,4);
> Pb=Peak(High,5,3);
> P1=Trough(Low,5,3);
> P2=Peak(High,5,2);
> P3=Trough(Low,5,2);
> P4=Peak(High,5,1);
> P5=Trough(Low,5,1);
> tb=TroughBars(Low,5,1);
> eki1=IIf(tb<=4 AND p1 > pa AND pb < p2 AND p1 < p4 AND
> p1 > p3 AND p3 > p5 AND p4 < p2,1,0);
> p1=Trough(Low,5,3);
> p3=Trough(Low,5,3);
> p5=Trough(Low,5,3);
> o1=p1-p3;
> o2=p1-p5;
> a1=TroughBars(Low,5,3)-TroughBars(Low,5,2);
> a2=TroughBars(Low,5,3)-TroughBars(Low,5,2);
> tan1=o1/a1;
> tan2=o2/a2;
> eki2=abs(tan1-tan2);
> Wolf=IIf(eki1 AND eki2 <= .2 ,1,0);
>
> Graph1=Wolf;
> Graph1Color=3; /* 3 is white */
> Graph1Style=1;
|