- ago
I believe I may have found an issue with TradeHistory CSV import when a position has multiple partial exits on the same date.

I reduced the behavior to this minimal three-row CSV:

2001-05-14,BUY,TDS,97,103
2001-05-17,SELL,TDS,48,105.9
2001-05-17,SELL,TDS,49,105.81682

The first transaction opens a 97-share long position.

The two transactions on May 17 sell 48 and 49 shares respectively, so I would expect the position to be completely closed:

48 + 49 = 97

However, after importing this into WealthLab, TradeHistory shows two closed trades of 48 shares and leaves a 1-share TDS position open.

In other words, the resulting positions appear to be equivalent to:

48 shares closed
48 shares closed
1 share still open

rather than the expected:

48 shares closed
49 shares closed
0 shares open

I originally encountered this while importing a much larger generated TradeHistory. To eliminate my generating application as a possible cause, I then created the above three-line file manually and imported it independently. It reproduces the same result.

Could you let me know whether you can reproduce this too? If so, this appears to be an issue in how the second partial exit is being matched or allocated.
0
4
0 Replies

Reply

Bookmark

Jump to End
Currently there are no replies yet. Please check back later.