Programmatic FIFO in Real-Time or Report (R Example)
Basically, this looks at all of your sell orders in the year, and goes back through your buy orders chronologically to match them up.
(Change the gold_txn_fifo.txt to .R and demo.txt to .csv ..... I could only upload .txt files)
LIFO is harder to program because it needs to be last in based on the time of each sale... but that option would be cool too.
This is just to kick off an idea, so do NOT use this for something like your 2016 tax return.
But, BitCoin lovers, keep in mind you'll need some sort of logic like this if you are using FIFO to record the buying and selling of "property".