Ultimate Oscillator — buying pressure over true range, measured across three
horizons at once and weighted 4:2:1 so the fast window leads without the
slower two losing their vote.
high_/low_ reach back to the previous close, so bar 0 has no value: the reference
max(high, na) is na, and that bar contributes to neither sum. Summing
from bar 1 is what keeps it out — rollingSum keeps a running total, and one
NaN in a running total never comes back out. With the default 28-bar window
the first print is therefore at index 28, not 27.
Ultimate Oscillator — buying pressure over true range, measured across three horizons at once and weighted 4:2:1 so the fast window leads without the slower two losing their vote.
high_/low_reach back to the previous close, so bar 0 has no value: the referencemax(high, na)isna, and that bar contributes to neither sum. Summing from bar 1 is what keeps it out —rollingSumkeeps a running total, and one NaN in a running total never comes back out. With the default 28-bar window the first print is therefore at index 28, not 27.