Doubts about avg price calculation and profits[solved]

I new to investments with ETF and yesterday I sold some quotes from one of my two ETF portfolio and I noticed that the average(purchase) price of the ETF I sold has increased 0,13euros one day after the operation…
I don’t expect the average price to increase when I sell quotes. Otherwise that will affect my futute sales (in negative)

The brokers is Interactive Brokers. I raised a question to the help desk but at the moment I got no feedback.

For those who like to make calculations, there is also another aspect that I don’t understand about that operation:
The cash increase for my account after the operation was 50074 Euros
The market value of the operation was:
237,67 x 214(quotes) = 50861,38
The average purchasing price value was 237,67:
234,11 x 214= 50099,54

50099,54 - 25 Euros of commission = 50074

EDIT: in my initial version of the post I did some calculation copy paste mistakes so the next reply will refer to those errors.

The amount of loss I see with the above details is 786 euros (50861 - 50074).
I added the details in the attached picture.

But The amount of loss visible from the IB report is : 621 Euro. Which I don’t understand .

Mate, you’re mixing up a lot of numbers…

234,11€ x 214(quotes) = 50099.54€

237,67€ x 214 = 50861.38€

Question is: where did you get the 237.67€ from?

As you can see from your screenshot, you sold 214 shares at 234.11€ = 50099.54€
Your costs basis was 50696.29€, which means you bought for an average price of 236.90€
Please note that the average price also includes fees paid when you bought, so that actual purchase price of the share might have been a bit lower.

You can also check how much you paid when you bought the 0MV9 shares initially. Go to reports, and you’ll be able to select annual reports.

For me, judging from the screenshot, it’s clear: you paid 236.90€ per share initially = 50696.29€ (maybe a little less, because of included fees in the overall basis price). Now, you just calculate 50696.29€ - 50099.54€ - 25.05€ fees, and voila: you have your 621.80€


Thanks for spending some time checking that. Much appreciated. I edited the initial post where I did a copy paste mistake with the calculations

where did you get the 237.67€ from?

I got it from two sources:

  1. It was clearly visible in the “positions” section on the IB portal before I did the first sale. The default set of columuns in IB shows that value.
  2. I track every operations in a separate excel(google sheets) page to keep things monitored.
    For each purchase I used the data provided by IB right after the operation . So in the picture it would be the (“amount” + “commission”) / “quantity” .
    Then , to find the average cost I did “sum of amounts” / “sum of quotes” = 237,67 . So I was super happy that it worked that way but apparently the values matches by accident (still have to understand that)


Anyway I just got a feedback from IB and the calculation are a bit more complicated:

First, the tax lot matching method that you are using is FIFO, the system’s default tax lot matching method. Sales are paired with the earliest purchases sequentially.

Next, In Client Portal under Reports, I have created a Custom Statement for you called “FIFO Activity”

More on FIFO at:
and What is the meaning of Mark-to-Market and First In, First Out? | IB Knowledge Base

Below(see Picture), is the tax lot break down, based on FIFO of the sale of -214 0MV9 @ 234.11 on 20222-01-21, 05:20:41 and how the P/L of -621.80 was determined that can be found in the Custom Statement: “FIFO Activity”

Your Cost Basis went from 237.67 to 237.80 on 2022-01-21 sale of -214 0MV9 @ 234.11 on 20222-01-21, 05:20:41, based on FIFO.

And note that you can make changes to the accounts tax lot methodology by using the tax optimizer as per below:
Tax Optimizer

This should be the Fifo activity he was referring to :

I will try to find the energy to read that stuff and connecting the dots. The statement to decode is this one…“Your Cost Basis went from 237.67 to 237.80 on 2022-01-21 sale of -214 0MV9 @ 234.11 on 20222-01-21, 05:20:41, based on FIFO.”

Actually I am curious to know whether this tax optimizer , optimizes things by default.

There’s nothing to optimize in Switzerland since there’s no capital gain tax :slight_smile:


There’s nothing to optimize in Switzerland since there’s no capital gain tax

True but you have a withhold tax so perhaps if you decide to minimise the profits you can save something. Just guessing though and considering long term investments where you could decide to switch part of the capital to speculate on market dip (that would be my case)

There are no withholding tax when you sell, right?

Yes, I think I got your point. After all the withholding tax takes into consideration both the liquidity and the invested capital so there is no point minimising or maximising the profits

I think I understood what I was looking for.
I also found this description about tax optimization lots(with a use case) quite useful in case somebody has the same doubts: Tax Lot Optimization: Why It Matters To Investors – Level Financial Advisors

Regarding the increased average price…the conclusion I drew is that I build my google sheet to calculate the avg purchase price considering all purchases(I would still have to review how i did it but I think I will avoid calculation and fill the info calculated by IB) while IB used the FIFO strategy by default that affected the avg purchase price calculation for that sale operation and for the future sell operations
I hope I got it right. If that is the case thank for helping!

The tax optimization article you’re reading is meant for US investors.

As others have already pointed out, when you sell your stocks as a Swiss resident you don’t get taxed. Nothing is withheld. You get the full amount in your account, and you don’t owe anything when you file your tax declaration.

There is withholding tax applied to dividends, but it doesn’t matter which lots you’ve sold or kept, just the amount of stocks you have at the dividend date.


Thanks for pointing that out. I mentioned that link because I had no idea what was the use case so I had to search around a bit before understanding that.

Thanks for the update!

This tax optimizer just got my attention. Is it something which is configured by default for every account? I’m also wondering if someone else was affected by this issue before? So far, haven’t noticed anything regarding lots when selling shares (which I rarely do anyway).

Just curious if this could be a potential problem if you reach RE and then gradually sell shares.

By chance: do you have a US citizenship?

By chance: do you have a US citizenship?

I don’t . I am European currently living in Europe (I left Ch) and my IB account was also transferred from the UK to somewhere else in Europe during the relocation process.
The ETFs have a European domicile as well.

Just curious if this could be a potential problem if you reach RE and then gradually sell shares.

What does “RE” mean?

Is it something which is configured by default for every account?

In my case it was already active by default, and FIFO is the default strategy . Apparently, when you sell something the sale is visible in the “trade” section (picture in my 2nd post) and if you click on the 3 dots on the right you can make your choices.
Yesterday I tried to change it out of curiosity but apparently I cannot do it anymore.

Apparently IB has a dedicated application(java) for this under the section Reports>>Taxes . I believe Chrome does not have Java installed (or I don’t have it installed in my computer) so in my case it just downloads a java file instead of launching the application.

RE is the “retire early” part of FIRE (financial independence, retire early). Really really simplified: you can spend 4% of your money per year, coming from dividends and selling some shares, until the rest of your life (@rest don’t burn me for this one :slightly_smiling_face:). So once you are retired, you will sell some shares gradually. I don’t want to have unexpected surprises with some automatic tax optimizer then.

I will check in the IB portal, but I don’t remember seeing anything like on your last screenshot.

Thanks for clarifying.
My screenshot does not show the tax optimizer , it was just a reference to find it.
If you click on the “Trade” section then on “Order& trades” you see what I see in the screenshot.
In the corresponding “Sold” action/line, on the right of the screen you have 3 dots (I cut them out of the screenshot, they are not visible , next to the total cost of the operation). If you click on those 3 dots you should have the option “Change tax lot”

1 Like

You can do it in their mobile up. I was changing once lots purely for estetic reasons. There is also a “lowest gain” or something - sell lots with highest purchase price - strategy, which I have activated.

Cheers for the hint. Just checked, and it also says FIFO for me:

I’m not planning on selling VT anytime soon, but good to know for the future. Or for other stocks I might be selling.