Chiming in that this is also a great opportunity to contribute improved documentation after you've figured out your answer.
In addition to Marcus' comment, looking at the code helps (and in this case is pretty easy):
set_history(d_length);
// skipping some stuff
@I_TYPE@ sum = 0;
int num_iter = (noutput_items>d_max_iter) ? d_max_iter : noutput_items;
for(int i = 0; i < d_length-1; i++) {
sum += in[i];
}
for(int i = 0; i < num_iter; i++) {
sum += in[i+d_length-1];
out[i] = sum * d_scale;
sum -= in[i];
}
The first loop builds up an "initial" sum, the second loop does the grunt work of generating output samples. You'll always get the sum of the last n_length samples scaled by some factor (n_length for arithmetic mean).