PeakBars
- bars since peak

Basic price pattern detection
(AmiBroker 3.10)


SYNTAX PeakBars(ARRAY, change, n = 1)
RETURNS ARRAY
FUNCTION Gives the number of bars that have passed from the n-th peak. This uses the Zig Zag function (see Zig Zag) to determine the peaks. n =1 would return the number of bars that have passed since the most recent peak. n =2 would return the number of bars that have passed since the 2nd most recent peak Caveat: this function is based on Zig-Zag indicator and may look into the future.
EXAMPLE peakbars(close,5,1)
SEE ALSO

References:

The PeakBars function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.