I'm sorry for the delayed response! I've been moving homes. > On Sep 14, 2015, at 2:22 AM, Kyle Spaans <[email protected]> > wrote: > > Can you show me the format string you used? I'd like to help if I can.
I used: ledger csv -f file.ledger --csv-format '%(quoted(date)),%(quoted(code)),%(quoted(payee)),%(quoted(display_account)),%(quoted(commodity(scrub(display_amount)))),%(quoted(quantity(scrub(display_amount)))),%(quoted(display_amount))%(quoted(join(note | xact.note)))\n' The key addition was: %(quoted(display_amount)) By removing the quantity(scrub(...)) from %(quoted(quantity(scrub(display_amount))), you get ledger to print out a full amount string which you can then parse to get the lot price. But as John as points out, there's an undocumented lot_price variable that works better. > Meanwhile, have you seen > https://github.com/ledger/ledger/wiki/Currency-trading-accounts > <https://github.com/ledger/ledger/wiki/Currency-trading-accounts>? It should > give you a way to track your gains automatically going forward. That works for currencies, but not commodities. With currencies, you want to track the difference in value between an invoice and a payment. But with commodities, you want to track the difference between the buy price and the sell price of the commodity. The IRS has defined Bitcoin to be a commodity. For every Bitcoin you own, you have to remember its lot price. For every Bitcoin you send to someone else, you have to match it up to a Bitcoin you own, and report capital gains for the difference in value. There is no way to do this in Ledger unless you export the data into another program. There is no simple way to get this data into another program. -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
