I've just tested your script and the lookback period indeed ends January 8, while it should end January 3. I will give this to the developers to check and fix. Apparently the lookback period ends too late when it goes back into the previous year.