Hi,

> You admit that you are complete novice, yet you make definitive statements ...

Sure. This is because I wrote a script, which generates exactly the same output 
as Peak/Trough in WL.
So, I know for sure that this script does not use a Zigzag (WL simply does not 
have this indicator)
and it does not look into the future, that is when I call TroughBars[bar] I do 
know that it does not
use any bars with indexes > bar. So, it does not look into the future, but have 
some lag,
which is expected. Please, correct me if I am wrong.

> (i.e. you must look at bars that occur AFTER THE PEAK) and find out that the 
> price moved in opposite

Sure, but I never look AFTER THE BAR when I call TroughBars[bar]. Therefore, my 
script does not look into the future. That is, it will generate exactly the 
same answer no matter whether bar is the last in the series or some time later 
when bar will be in the middle of historical data.

> Finding "that reversal happens" is where looking into the future occurs.

No. The script never looks after the BAR, but, of course, it does look after 
the peak if the peak is in the past.


> *IS* actually zig-zag algorithm and that peak and trough functions are 
> _products_ of zig-zag algorithm.

This may be true, but it is not really important. It does not matter how a 
particular trading program chose to name each function. It is more important 
what exactly the function does, in particular whether it does look into the 
future, that is when I call TroughBars[bar] will it look after the bar or not? 
And here, if I understood you correctly, AB is profoundly different from WL 
because in WL TroughBars[bar] does NOT touch any data after bar, but AB does.

> You can not simply remove SelectedValue from such formula because it relied 
> on manual input

Of course. I stated this in my original question.

> In order to remove SelectedValue you would need to come up first with 
> conditions that say when to start and when to end the trendline because it is 
> not always obvious.

I already did that in my post 
http://finance.groups.yahoo.com/group/amibroker/message/148924
I, as well as other users, found it very difficult to understand AB array-based 
language,
so it is very likely that I made some mistake in my rewritten scripts.
So, I would appreciate if somebody with experience will comment on it.

Thank you
John




Reply via email to