Vortex Indicator: how much of the window's total travel was spent reaching up
versus reaching down.
Both movement terms straddle a bar boundary (high against the previous
low), so bar 0 has no term at all: it is missing there, and so is any
rolling-sum window containing it. Summing from bar 1 and shifting the answer
forward one bar is how that hole stays out of the running total, and it is why
the first printed value lands at index length rather than at length - 1
like the denominator does.
Vortex Indicator: how much of the window's total travel was spent reaching up versus reaching down.
Both movement terms straddle a bar boundary (
highagainst the previouslow), so bar 0 has no term at all: it is missing there, and so is any rolling-sum window containing it. Summing from bar 1 and shifting the answer forward one bar is how that hole stays out of the running total, and it is why the first printed value lands at indexlengthrather than atlength - 1like the denominator does.