TroughBars
- bars since trough

Basic price pattern detection
(AmiBroker 3.10)


SYNTAX TroughBars(ARRAY, change, n = 1)
RETURNS ARRAY
FUNCTION Plots the number of bars that have passed from the n-th trough. This uses the Zig Zag function (see Zig Zag) to determine the troughs. Caveat: this function is based on Zig-Zag indicator and may look into the future.
EXAMPLE troughbars(close,5,1)
SEE ALSO

References:

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

More information:

See updated/extended version on-line.