Hi Eric,
Another way to look at it would be when the swing turns up, which by definition it must be >2% from the low. So this will show +1 for upward swings, and -1 for downward swings. Note that it has to wait for the +/-2% move to happen before the direction changes (highlighted by the Show Bar arrow).
Pct=PERCENTSWING(PERCENT=2.0);
V1=SwingUp(Pct);
IF(V1, 1, -1)
We also have SWINGSTAT() which may be useful when looking for average swing lengths, eg average up swing length for the last 5 2% swings on AGG is 31 trading days:
Pct=PERCENTSWING(PERCENT=2.0);
SWINGSTAT(Pct,DEFAULT=AvgBars, SWINGS=5, TYPE=Up)
Finally, here’s a post by Mathew explaining the complexities of using swing scripting formulas.