PeakBars
|
Basic price pattern detection |
| 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 |
The PeakBars function is used in the following formulas in AFL on-line library:
See updated/extended version on-line.