Negative positions during FIFO costing

I get a negative position error, but I review the transactions and they are correct and should be positive. This error occurs because when making a partial sale of an asset, the purchase price for the total number of shares is maintained without derecognizing those that have been sold, and in the end, it results in an erroneous negative difference. That is, the result is = market value of current shares - market value of initial shares (without removing those that have already been sold), so the subtraction is very negative. Is there a solution to this?

To be honest I do not understand your explanation.

Buy and sell belongs to pieces, nothing else. So when PP tells you something is negative, changes are high PP is right.

But without any bookings we can’t help you from a distance.

Can you share the concrete transactions for this instrument? At least some screenshot would help or as CSV data.

In principle, the FIFO calculation is able to handle partial sales and update the count of shares. What it does not support is short sales. Check that data and time of your transactions are ordered correctly.

Could you ‘buy for zero cost’ as a workaround for short selling?

e.g.

  • You own 1000 shares @ $1.
  • You sell the shares for $1000 with the intention of buying back cheaper.
  • You immediately add a ‘dummy’ buy of 1000 shares @ $0.
  • When you buy back the shares, you enter the correct transaction values (e.g. 1000 @ $0.50).
  • Finally, you sell the ‘dummy shares’ for $0.

That would maintain the calculation data across the short selling period.