Weighted moving average rotator BUG

I wrote about a solution for this over here.