Short selling and closing realized capital gains impact not visible

Hi,
When I sell an instrument without holding it (short selling), and when I buy it back later on, I don’t see it’s impact on the Realized Capital Gains.
Also in Trades section I see the error “No holdings for sell transaction in securities account” for all my short sells (mostly covered call or cash secured put options), which I simply ignore.
Does Portfolio Performance not support short selling in calculations of performance, especially realized capital gains when I buy the position back for gain/loss or am I doing something wrong?
Thanks

Yes, it is not supported.

It would be great if it could be supported in a future upgrade. I don’t know how complicated it would be to incorporate this in the existing functionality, but from a user perspective there is no difference between making a capital gain from a short position or from a long position. It’s merely a question of the sequence of the buy vs. sell. A profit is still a profit, right?

One of the challenges is the fact PP is calculating everything at runtime. This leads to a point where calculations are tagged to an operation. For instance, the internal model expects a buy before a sell in order to run the calculation model.

Thanks for the answer.
Is there no way that the first “operation” that the internal model expects, could be a credit?
I trade vertical options on the SPX on a weekly basis, where I buy one option and sell another at the same time. Then a few days later I close the vertical by reversing the two trades. In these trades it is only the ‘losing’ trade, that shows up under “Realized Capital Gains”:

In the “Trades Profit/Loss” the correct net value of the collective trade is shown; one profitable and one loser. Here is a breakdown of the collective trade:

Options trade

I appreciate that when the engine has been built to calculate in a certain way it may be complicated to change, but if or when this affects the performance calculation for standard transactions like shorting, it may be worth having a second look at.

I’m keeping my fingers crossed.

This holds true only, when you use PP in a way it was not intended. It’s not like I do not understand your need, but the core of PP was build almost 15 years ago with a buy and hold purpose and from there it grew over time.

So it’s not a question if something useful is missing or not. It’s a question of who, when and how to implement.

I get it, and understand that it’s not easy or even possible to change something which is so ingrown in the whole system.
So I’ve decided to go for a workaround that solves the issue for me: I simply reverse the sell and buy dates for the shorted option, so it appears correctly in the calculation window. I add a note on each transaction with the correct transaction date, just for future reference. I hope this can work for you too @TT77.

This is very similar to what I’ve been doing as a workaround.

If I short sold something, when I buy to close I change the transaction date of the Sell to Open order to the “same day” of the Buy to Close (not reversing dates like you) and add a personal note with the “actual date” of the Sell to Open transaction.

It’s not ideal but at least now I can track gains/losses correctly.

In general, I still don’t think it would be super complicated to modify the code in a way that a BUY transaction is not expected before a SELL transaction for the calculations. After all we can already enter a SELL transaction without a BUY transaction and in Statement of Assets we see the -100 positions for instance. It’s just that later if the Buy to Close date is after Sell to Open, the position disappears from Statement normally but financial calculations are not run since the code expects the BUY date before the SELL date as @Sn1kk3r5 pointed out.

Let’s hope they will implement this relatively small modification in the code at some point. Maybe we just need more lobbying for this :slight_smile:

It’s a question of who, when and how to implement.

We’re talking about Open Source Software here. So anyone with coding skills who want this feature is free to edit the code to implement it. I could give it a shot together with some friends. What is the procedure to upload the updated software to the site? Who officially manages the site and the source? Also I couldn’t find a link to the source code on the website.

Here you go: GitHub - portfolio-performance/portfolio: Track and evaluate the performance of your investment portfolio across stocks, cryptocurrencies, and other assets.

Main responsible is @AndreasB

1 Like