Average basis

I can’t seem to write a Python function that will spit out the same numbers for average cost basis that Vanguard puts on their statement. My many Google attempts are not turning up any description of the average tax basis algorithm (single or double category) that is precise enough to implement. All of them parrot […]