Although the Peak/Trough source is not available can you describe the rule by which the Peak / Trough indicators identify *candidate* new peaks and troughs to test % or value movement to qualify the next new peak / trough? I have researched and looked closely at the charts, but I can't identify a simple rule such as number of bars / % up or down after a confirmed peak or trough, or a pattern for a new point to begin testing against again, after a new peak or trough is confirmed. I originally thought a new peak could not be established until a new trough was established (and vice-versa for a a trough) but that does not seem to be the case.
Basically I'm asking how the peak / trough indicators "decide" that a bar qualifies to test for a trigger value to confirm a new peak / trough.
In some cases, even with a visual peak or trough (such as with 2 consecutive lower lows), movement up beyond the specified value will not necessarily qualify that last low as a trough. So I'm wondering if there's something else at work here that I can't see.
With additional testing I found an additional clue, but not sure where it leads..Bars that I think should be peaks, based on visual interpretation, will only become peaks when I reduce the percent down value. There are already qualifying low points that follow these based on the initial value. i don't understand why value selected is affecting peak candidate selection (in addition to confirmation). Is the trigger value being used in some additional way than simply to trigger on a down value, such as being used to filter candidate peaks (before they are confirmed)?
CODE:
Please log in to see this code.
I am running ^NDX with Yahoo data (10 years)
Examples of issue raised above:
Bar on 2/8/16 will only become a peak when value is decreased to 2 (%)
Bars on 1/13/16 and 1/25/16 will only become a peaks when value is decreased to 1 (%)