Bands centred on the regression endpoint, not on a moving average of price:
the fitted line's value at the newest bar of the window, pushed out by
errors standard errors, and only then smoothed. The middle plot is that
smoothed endpoint, so it is not the same line as a plain regression curve.
All three legs are smoothed independently, which is why the first bar of each
lands at (periods - 1) + (averagePeriods - 1).
Bands centred on the regression endpoint, not on a moving average of price: the fitted line's value at the newest bar of the window, pushed out by
errorsstandard errors, and only then smoothed. The middle plot is that smoothed endpoint, so it is not the same line as a plain regression curve. All three legs are smoothed independently, which is why the first bar of each lands at(periods - 1) + (averagePeriods - 1).