Skip to content

fix little typo in calculation.md#167

Merged
hug-sch merged 3 commits intoportfolio-performance:masterfrom
mierin12:calculation_typo
Jun 25, 2025
Merged

fix little typo in calculation.md#167
hug-sch merged 3 commits intoportfolio-performance:masterfrom
mierin12:calculation_typo

Conversation

@mierin12
Copy link
Contributor

Hello,

This is a proposition of small typo fix in the Calculation.md file.
In the commit, I only modify some small things, but I think one more complex modification could take place but I wanted your view on how to modify/present :

One of the modification is to go from 100 x (0.6372 - 0.6149) = 8.93 EUR to 400 x (0.6149 - 0.6372) = -8.92 EUR
We notice there is 0.01 EUR difference with the result from PP. -8.92 instead of -8.93 of Figure 1. This is because the real calculation from PP is not
400 x (0.6149 - 0.6372) = -8.92 EUR
but
400 x (1/1.6263- 1/1.5693) = - 8.9336 = -8.93 EUR

You can see it more clearly if you exaggerate the value : instead of a 500 AUD deposit on 01/01/2023 followed by a 100 AUD purchase on the same day, lets deposit 10 000 AUD
(10 000 - 100 ) x (0.6149 - 0.6372) = -220.77 EUR
(10 000 - 100 ) x (1/1.6263 - 1/1.5693) = -221.107 = -221.11 EUR

PP says :
Capture d’écran 2025-06-17 202855

But this is true also for the Capital Gain and Currency Capital Gain. Let's exaggerate the purchase from 5 share to 500 shares, so a 500*20=10 000 AUD purchase.
Capital Gain
500 x (15 x 0.6149 - 20 x 0.6372) = -1760.25 EUR
500 x (15 x 1/1.6263 - 20 x 1/1.5693) = -1760.572 = -1760.57 EUR

Currency weight in the Capital Gain
500 x 20 x (0.6149 - 0.6372) = -223 EUR
500 x 20 x (1/1.6263 - 1/1.5693) = -223.3408 = -223.34 EUR

PP says :
Capture d’écran 2025-06-17 201534

This is even directly clear in the Currency Converter section, with only 100 cash you do not see the difference, but if you exagerate :
Capture d’écran 2025-06-17 195838
Capture d’écran 2025-06-17 195855

@hug-sch
Copy link
Collaborator

hug-sch commented Jun 18, 2025

@mierin12
Hi,
Thank you for the very thorough and detailed review. It definitely contributes to the quality of the documentation.
You’re right that the 400 AUD remaining in the deposit account results in a currency loss of -8.93 EUR, while the calculation    400 × (0.6149 - 0.6372) = -8.92 EUR.

However, I don't understand why the formula should be:     400 × (1/1.6263 - 1/1.5693) = -8.9336 ≈ -8.93 EUR.

The exchange rate on 31/12/2022 was 0.6372 AUD/EUR, meaning 1 AUD = 0.6372 EUR.
Since the performance calculation is done in EUR, the 400 AUD must be converted to EUR (not vice versa). That’s why I thought my calculation made sense, and I don’t quite understand why PP uses the other one. Do you have an explanation for this?

In any case, I believe your formula is more accurate. If you’d like to update the text, that’s perfectly fine with me.

However, could you also update the screenshots from the dark theme to the light theme? If you’d like to have the demo file I used in the example, just let me know — I’d be happy to send it to you. Ideally, it should also be included in the project’s assets with a reference to it in the documentation.

I also noticed a change in the settings menu (the gear icon): in addition to the FIFO method, the moving average method is now available as well.

Let me know what you think and whether you need anything from me.

@mierin12
Copy link
Contributor Author

Hello @hug-sch , why it is the case, I am not sure. I think PP data source for exchange rate is the indirect quotation (1 EUR = XXX) of the European Central Bank. Which was 1 EUR = 1.5693 AUD on Jan 1st 2023. 1/1.5693 = 0.637226789 , so the difference is just if the exchange rate is rounded at the fourth decimal 0.6372 or not.
I tested by changing the preference settings "use indirect quotation", but no change, this must change something else but not the (un)realized gains calculation.

Those pictures were for illustration here, I am not sure they would add a lot in the manual ? At least maybe not on the calculation page, but on a detailed "exchange rate" topic page ? *
Regarding the new option "moving average", maybe we can make reference to the new page, https://help.portfolio-performance.info/en/concepts/cost-methodology/ I show it in fig 2 and 3

  • maybe useful as several topics on the forum nowadays are "I have a high profit in USD but small/ loss in EUR, why ? " so maybe a illustrative page on this topic could be useful.

@hug-sch
Copy link
Collaborator

hug-sch commented Jun 19, 2025

Hi @mierin12, Yes, I agree. The indirect quotation from the ECB is probably the reason. Your suggestion about referring to Gains and Acquisiton Cost principle : FIFO vs Moving Average for covering the FIFO/moving average change in the page is perfectly fine. Shall I update the text, or prefer you doing it? May be, you have noticed that @Nirus2000 introduced some changes in the frontmatter (see for example the index.md from Getting started). Perhaps, you would like to conform your pull request to it?

Finally, a detailled "exchange rate" topic page is certainly needed in the docs (beautiful example in the current evolutions USD/EUR). The current currencies page needs also some attention. Would you be willing to make a first proposal?

mierin12 added 2 commits June 22, 2025 21:21
link to cost methodology page, use indirect exchange rate in calculation
@mierin12
Copy link
Contributor Author

Hello @hug-sch , sorry for the delay, I have added a bit more info. OK to create an example page illustrating the USD gain vs EUR gain. But a bit latter in the week. Maybe not a new page but a complement to https://help.portfolio-performance.info/en/reference/view/general-data/currencies/ ?
What is the frontmatter subject, I did not follow ?

@hug-sch
Copy link
Collaborator

hug-sch commented Jun 23, 2025

No need to hurry about the example page. About the frontmatter: besides the title, additional info is provided, e.g. the author of the changes, description, ... See below for an example (from the about.md page). It's not obligatory! What do think? Adding the metadata?


title: About Portfolio Performance
hide:
- navigation
- toc
description: Discover Portfolio Performance, an open-source application for managing and analyzing your investment portfolio with accurate performance calculations and insightful overviews.
changes:
- date: 2025-05-03
author: Nirus2000
description:
- Initial version of the "About Portfolio Performance" page, noting the transition of 'PP' to 'Portfolio Performance' in naming and including this YAML source.
- Removal of the reference to the no longer existing FAQ topic in the forum.
- Navigation has been disabled for this page.


@hug-sch
Copy link
Collaborator

hug-sch commented Jun 23, 2025

Sorry about the font size. Don't know how this has happened. :-(

@mierin12
Copy link
Contributor Author

Not super thrilled by this metadata subject, is it really applied ? In Contributing I see :

Since the Portfolio Performance manual is being maintained in GitHub, version control is already in place.

but nothing about this frontmatter/metadata. And the CI shows a green tick..

@hug-sch
Copy link
Collaborator

hug-sch commented Jun 25, 2025

No problem. I've just mentioned it, so, that you know. The pull request is merged.

@hug-sch hug-sch merged commit 96dc35f into portfolio-performance:master Jun 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants