charton API / @chart-on/ta / zigzag
Function: zigzag()
zigzag(
high,low,deviation,out?):Float64Array
Defined in: levels.ts:54
Zigzag swing points: a swing high is confirmed once a later low falls deviation percent below it, and a swing low once a later high rises that far above it. Returns each swing's price at its bar (the high for a swing high, the low for a swing low) and NaN elsewhere. The latest extreme ends the last, unconfirmed leg, so it moves as new bars arrive: recompute over every bar rather than one bar at a time. A NaN input ends the swings so far and the next bar starts afresh.
Parameters
high
low
deviation
number
out?
Float64Array<ArrayBufferLike>
Returns
Float64Array