Oh man, I do not envy your tax situation...
I plug those automated buys into a spreadsheet where I maintain a record of my orders. That spreadsheet does a FIFO capital gains calculation, and I’m good to go.
I must admit, I haven’t sold yet, so I may just be niave about how 2018 taxes will go!