Hi Wayne, BarbeeO,
Wayne, I was hoping you had the "complete answer" !!!!
Now you have me going on this as I had bumped into this before and don't remember the details.
What you posted is "true" for the "final outcome" when all related positions are closed and settled. The "end" accounting is FIFO, First In, First out. I think the "intermediate accounting" is LIFO, Last In, First Out. I don't recall the details of why. I think it has to do with tax and possibly with the margin calculations ??
The "intermediate account balance" will not be what you expect for FIFO but at settlement all the money will be as you would expect for FIFO accounting. I think this is only done for futures contracts.
Do a search for something like "futures contract settlement accounting fifo lifo" I'm getting too tired to dig further right now.
If you are a "deep pocket trader" you can generate "taxes due at IRS next business day, possibly the third ??? "
If I ever get to that point I won't be worrying about this stuff, the accountant will !!!!!
Good Luck, Lee