Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Moving Average Capital Gains #4546

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

mierin12
Copy link
Contributor

@mierin12 mierin12 commented Feb 25, 2025

Closes #4503

Hello,

This is a proposition to add the Capital Gains as per Moving Average cost method in :

  • The Performance Calculation view
  • The Performance Calculation widget
  • The Securities Performance view (more columns)

FIFO remains per default in the Performance Calculation view and widget.

There were already Calculation Gains as per Moving Average in the Securities Performance view, but only on the 'current holdings'.

Performance Calculation view
2025-02-25 00_07_01-Portfolio Performance

Securities Performance view
2025-02-25 00_07_45-Paramètres

Performance Calculation widget
2025-02-25 00_08_17-Paramètres

Forex Gain : added, but I am not 100% confident on it. I wanted to add tests, but I did not managed to understand how to correctly represent the transactions in the test. Neither the transactions directly in the forex currency, neither the ones with an exchange rate.

Trail Record for the tooltip : I need to deep dive into it, to see first if the exact same structure can be reused or if it is custom made for FIFO. I propose to look into it in a second step.

Transfer : unsure if something has to be done here ? In the CostCalculation.class, the Transfer is only used for FIFO cost.
For the new class CapitalGainsCalculationMovingAverage, I used a bit of CostCalculation and CapitalGainsCalculation logics.

I took the opportunity to add Descriptions to those columns of Securities Performance view.

@mierin12 mierin12 changed the title add Moving Average Calculation Gains add Moving Average Capital Gains Feb 25, 2025
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.

Option between FIFO and MA selling stocks
1 participant