Lynn's integer filter has a linearly increasing trend
Your lowpass filter is the cascade of two 3-point moving average filters each implemented as recursive running sum filters. (It's gain at 5 Hz is -2.4 dB.) I can't interpret your code but I'm guessing your feedback operations are incorrect. To test your code, make sure all accumulator variables are set to zero. Then apply a unit impulse to your filter and see if its impulse response is [1, 2, 3, 2, 1, 0, 0, 0, ...] as it should be.  If you change your $H(z)$ exponents from $2$ to $1$, then your filter's impulse response should be [1, 1, 1, 0, 0,0,  ...]. If your impulse responses do not agree with the above, then finding out why they don't will solve your problem.