Incorrect P&L when multiple trades on same day

The P&L appears to be incorrect when the same symbol is traded more than once on the same day. I used the following test file in Schwab format:

Date,Action,Symbol,Description,Quantity,Price,Fees & Comm,Amount
06/26/2025,Buy,XYZ,DUMMY,10,100,-1000.00
06/26/2025,Sell,XYZ,DUMMY,10,105,1050
06/26/2025,Buy,XYZ,DUMMY,20,110,-2200.00
06/26/2025,Sell,XYZ,DUMMY,20,115,2300.00

When I load this I get a P&L on the trades screen of $50. Drill down to the trade and the quantity is correct (30 shares) and the average entry & exit prices are also correct. But the P&L just shows the result from the first trade ($50). The second trade result is missing.

If you are self hosting, the latest commit should fix this.

When I try to import the test file i get the following error in the log (same error when using the cloud version):

[2025-12-11T21:09:50.226Z] [ERROR] Import process failed: CSV parsing failed: txn.date.toISOString is not a function
[2025-12-11T21:10:10.357Z] [INFO] [IMPORT] [STATS] Job Queue Status:

Here is the test input file:

Date,Action,Symbol,Description,Quantity,Price,Fees & Comm,Amount
06/26/2025,Buy,XYZ,DUMMY,10,100,-1000.00
06/26/2025,Sell,XYZ,DUMMY,10,105,1050
06/26/2025,Buy,XYZ,DUMMY,20,110,-2200.00
06/26/2025,Sell,XYZ,DUMMY,20,115,2300.00

I think I got it resolved this time in the latest commit

Total P&L on the Trades screen does not reflect the actual trades uploaded. (see attached screenshot)

It appears to be stuck showing either 0 or the first file’s totals. Deleting all the uploads and starting from scratch does not fix the problem.

Here’s another screenshot:

That is interesting. I have not seen this problem in a while. You are using the latest image? Running in docker?

I tried to load the same files on your cloud version to see if it has the same problem but I get the following:

[2025-12-12T14:53:19.778Z] [ERROR] Import process failed: CSV parsing failed: txn.date.toISOString is not a function

I changed how dates are handled in the latest commit. Hopefully it is more robust.

I was able to load the two test files using the cloud version, but it has the same problem as before:

Okay, I have made quite a few changes today. I think this is all resolved. The cloud version will have the latest changes shortly

Looks better but the Trades screen still displays the wrong totals. For example I uploaded two test files and the Trades totals were correct. But if I then delete one of the uploads the Trades totals are incorrect.

I also noticed that the Trades screen sometimes shows the wrong trades depending on what filters were used previously. Refreshing the browser screen sometimes fixes the problem.

I think these issues were resolved today on my latest commits. I made quite a few improvements.

The same problem persists.

What specifically is your problem that is still occurring? If running on docker, are you on the latest image?

See my message from Dec 13, 08:43am. Let me know if you need further clarification.

I really need more specifics. Could you open a github issue providing as many details about the problem as you can, including the csv you are using to import the trades?

To replicate the error have 2 transaction files available. Import the first file and check the total P&L on the trades tab. Now import the 2nd file and again check the totals on the Trades tab. Now delete the first file from the import tab. Go back to the Trades tab and the totals are incorrect. It still shows the old old total from when both files were loaded.

Alright, I think it is just a caching error. I just pushed a change to latest image. I will have it up in cloud in a few minutes