Hi I am interested in this function also, but on inspection found a few things that I believe are errors. When I applied it to a test data set it missed a few valid highs and lows. Looking at the code I saw that when testing for a swing High it (correctly) tests whether this is > End_Val_HL*WavePcnt. However when testing for a swing Low it simply replaces the > sign with a < sign, whereas the test should be < End_Val_HL/WavePcnt. There are also a few peculiar issues, like using Ref(H,0) where simply H would do, and setting a for loop between i=0 and i<Barcount, and then later testing whether i>0 and i<Barcount, where the condition could not occur anyway if i = 0. However, these don't affect the answer. I am working on another version (hopefully correct!) and will post this when complete.
Brian --- In amibroker@yahoogroups.com, Thomas Ludwig <thomas.lud...@...> wrote: > > Thanks for sharing this code. It's seems not quite identical with the > built-in > function, though. > > Regards > > Thomas > > On 19.06.2009, 20:37:04 Herman wrote: > > I think this was posted by Dave, a long time ago: > > > > function ZigZagHL(prcnt) > > { > > [snip] >