Bitcoin Forum
May 24, 2024, 06:17:35 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [ANN] cryptocurrency capital gains calculator for ledger  (Read 1044 times)
redfish64 (OP)
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile
January 13, 2016, 07:48:57 AM
 #1

This is a little tool for helping with capital gain calculation for crypto currencies. It uses ledger-cli.org style account books and spits out a csv file like the following:

Short term Trades
SharesSymbolBuy DateSell DateSell PriceBuy PriceGainRunning Total GainRefs
XXXFOO2015-10-222015-10-22XXXXXXXXXXXXS: bittrex.dat:43 foo.dat:44 B: foo_adj.dat:7
XXXFOO2015-10-222015-10-22XXXXXXXXXXXXS: foo_adj.dat:7 B: foo_adj.dat:7
XXXBTC2015-09-272015-10-25XXXXXXXXXXXXS: poloniex_adj.dat:10 B: bittrex.dat:55
Long term Trades
SharesSymbolBuy DateSell DateSell PriceBuy PriceGainRunning Total GainRefs
XXXBTC2013-09-012015-04-29XXXXXXXXXXXXS: electrum_wallet1.dat:7-17 B: btc-e.dat:39
XXXBTC2013-09-012015-08-12XXXXXXXXXXXXS: electrum_wallet1.dat:24 kraken.dat:8-38 B: btc-e.dat:39
XXXBTC2013-09-012015-08-19XXXXXXXXXXXXS: electrum_wallet1.dat:33 B: btc-e.dat:39
Remaining balances:
SharesSymbolBuy DateBuy PriceRefs
XXXAUG2015-08-19XXXelectrum_wallet1.dat:33
XXXTAU2015-08-21XXXmasterxchange.dat:1
XXXTAU2015-08-31XXXmasterxchange.dat:6

The "Refs" column pointa to the file number, line number(s) of the individual ledger posting used, so it's easy to track what this program does. Each line shows the "S", sale, and "B", buy of the coin, and intra-day entries are combined. For example, on line 1, bittrex.dat:43 means the bittrex.dat ledger file, line 43, and an example ledger entry might be:

2015-10-22 12:45:01 * Trade
   Assets:bittrex           XXX BTC
   Assets:bittrex           -XXX FOO


WARNING: I just added a large portion to this for ledger and multi crypto currency support and am the only user as far as I know, so there may be bugs lurking. This is GNU licensed.

You can get it here: https://github.com/redfish64/bitcoin-tax-calculator
fiotermca
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
February 12, 2019, 02:52:04 PM
 #2

This is a little tool for helping with capital gain calculation for crypto currencies. It uses ledger-cli.org style account books and spits out a csv file like the following:
...

You can get it here: https://github.com/redfish64/bitcoin-tax-calculator


Hi,
I started with "hledger" and tried to import csv trades...
Are you still working with ledger and scritping?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!