As the closing balance of the previous period is the opening balance of this month, there are:
(a+b)/2+(b+c)/2+(c+d)/2+(d+e)/2+(e+f)/2
=a/2+b+c+d+e+f/2
Don't you think these two algorithms are one?