*Background*
I don't have a finance/accouting background and therefore not very familiar 
with the concept of lot date and lot price.

I use ledger for personal finance so I don't need it to 100% follow 
accouting guidance, I don't use ledger to track my taxes neither.

*Scenario*
I'm using ledger to track my investment in ETF funds, let's say I bought 
100 of certain ETF at 1.3 each at July-1st, I would have a (simplified) 
transaction as below:

2023/07/01 * Buy ETF
  Assets:Bank          -130 USD
  Assets:Fund:xxxx     100 "FD_xxxx" @@ 130 USD

In my understanding, this will create an internal commodity record that says
"FD_xxxx" = 1.3 USD at 07/01

I also manage a price db to track fund prices at each day, so that file 
contain info like below
P 2023/07/02 "FD_xxxx"  1.32 USD
P 2023/07/03 "FD_xxxx"  1.33 USD
P 2023/07/04 "FD_xxxx"  1.35 USD 

Let's say I sold all the fund using the price of Jul-4th, and the money 
will be in my account at July-5th, currently I'm recording it as below:

2023/07/04 * Sell FUND
  Assets:Bank       135 USD
  Assets:Fund:xxxx  -100 "FD_xxxx" @ 1.35 USD

I'm not exactly happy with this because

   1. My bank account actually get the money at 5th not 4th
   2. I still need to manually input the fund price even if I have a price 
   db file

For (1) -> I assume we can use lot date to fix this? Basically I want to 
record a transaction that says I sold xx amount of YYY at date A, using the 
price of this commodity/currency at date B

For (2) -> I tried not entering the [@ 1.35 USD] at the end, ledger won't 
complain, but my balance report is mixed up with different commoditties.

Lastly, I sw some one will record the "incremental gain" as 
`Income:CapitalGain` when selling the fund, for example, in the official 
document there is:

2004/05/01 Stock purchase 
  Assets:Broker                50 AAPL @ $30.00 
  Expenses:Broker:Commissions  $19.95 
  Assets:Broker                $-1,519.95

2005/08/01 Stock sale 
  Assets:Broker                -50 AAPL {$30.00} @ $50.00 
  Expenses:Broker:Commissions  $19.95 
  Income:Capital Gains         $-1,000.00 
  Assets:Broker                $2,480.05

It seems to me that the later transaction can be just written as 

2005/08/01 Stock sale 
  Assets:Broker                -50 AAPL @ $50.00 
  Expenses:Broker:Commissions  $19.95 
  Assets:Broker                $2,480.05

Both ledger will balance, which one SHOULD i follow? what if my 50 share of 
AAPL is purchased at different date and therefore different price?

-- 

--- 
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/6feb2d60-1eb4-4ebf-be10-3cd248ca5749n%40googlegroups.com.

Reply via email to