wealthfolio icon indicating copy to clipboard operation
wealthfolio copied to clipboard

Loss/Gain of sold stocks not displayed in holding

Open ianyu21 opened this issue 3 months ago • 3 comments

Situation:

  • I bought 100 shares of a stock at T1, T2, T3 respectively; cumulatively I have bought 300 shares averaging 10 dollars/share
  • at T4, I sold the 200 shares of the stock at 8 dollars/share; I have 100 share remaining
  • now at T5, the market price of the stock is rated at 9 dollar/share

The loss/gain of my account should be a sum of:

  • Part A: the loss/gain realized from the sold 200 shares, which is 200 * (8-10) = -400 dollars
  • Part B: the book loss/gain of the remaining 100 share, which is 100 * (9-10) = -100 dollars So the total loss/gain is -500 dollars However in the holdings detail table, only part B is shown, part A is completely missing.

Attaching an actual example: photo 1: activities photo 2 & 3: the holding info resulted from the activities

Image Image Image

ianyu21 avatar Sep 09 '25 15:09 ianyu21

I'm also getting some strange behaviour.
I've successfully sold some stock and it has updated the cash balance for one portfolio. I did this using import for CSV. For another portfolio whenever I click on the next having selected all the import columns correctly... it just does nothing.
Then I manually add the sell order, and it appears correctly.

Image

however, the amount sold for is not added to the CASH balance on the account and it now shows a loss = to sell amount.

Image

sticilface avatar Sep 15 '25 20:09 sticilface

OK fixed it. not sure why it cause the issue but I had currency set to GBp and not GBP which the original order was.

I'm also getting some strange behaviour. I've successfully sold some stock and it has updated the cash balance for one portfolio. I did this using import for CSV. For another portfolio whenever I click on the next having selected all the import columns correctly... it just does nothing. Then I manually add the sell order, and it appears correctly.

Image however, the amount sold for is not added to the CASH balance on the account and it now shows a loss = to sell amount. Image

sticilface avatar Sep 16 '25 15:09 sticilface

Notes:

  • We need to add Realized Gain/Loss for each lot.
  • We need a setting for the calculation method: FIFO, LIFO, AVG

afadil avatar Sep 16 '25 18:09 afadil