On Friday, July 26, 2019 at 1:32:45 PM UTC-4, John Wiegley wrote:
>
> >>>>> "PP" == Pranesh Prakash <[email protected] <javascript:>> writes: 
>
> PP> (And FWIW, I believe trading accounts are a very powerful idea that 
> PP> unfortunately don't have enough integration into the ledger-likes.  
> They, 
> PP> used judiciously with sub-accounts, can even mimic lots accurately.) 
>
> Hi Pranesh, 
>
> I do quite a lot of investment tracking with Ledger these days. It's a bit 
> more manual than I would like, but I haven't run into any blocking 
> limitations. 
>
> [snip]  

> Things that are still manual in the above: 
>
>  - Entering the lot details 
>  - Calculating the wash amount 
>  - Calculating the adjusted cost basis on the next purchase (or of 
>    other shares currently held) 
>  - Withdrawing from the wash account on the next purchase 
>
> John 
>

I struggled to calculate gains for a bunch of trades recently.  Long story 
short, I was able to automate a lot of the calculation, and ledger was a 
huge help.

In order to address some of the complexity mentioned by Pranesh, I added 
splits to call out inventory and cost basis explicitly.  I think the 
inventory and gains splits mske it easier to see and understand when trades 
create or consume inventory.  Once the splits are there, ledger calculates 
gains like a champ.

I wrote up some notes, and made the tool available.  

See https://www.d10.dev/blog/ledger-cli-trade/ for the write-up.

See https://src.d10.dev/lotter for the open source tool.

-- 

--- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/37e9773c-7b0e-4a50-ab58-5315ecdf2c03%40googlegroups.com.

Reply via email to