confused
no, i mean the order of the coefficients in the output array is a design choice that is not stated in the manual. It took some experiments, but I figured out that it is implemented like this:
1. the value of coeff[n] gets the coefficient for the x^n term.
2. for polyfits with degree < m, coeff[m] through coeff[8] are 0.

I'm just trying to help the next person save a few steps here.


I have a related observation about something tricky.
The independent variable, x, for the polyfit is the bar index. 0 is the current bar, and the sense of it is that bar index decreases with time. Therefore, the first coefficient which is commonly thought of as the slope, or m, will actually be negative for rising series.