add Moving Average Capital Gains #4546
Open
+817
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #4503
Hello,
This is a proposition to add the Capital Gains as per Moving Average cost method in :
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

Securities Performance view

Performance Calculation widget

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 ofCostCalculation
andCapitalGainsCalculation
logics.I took the opportunity to add Descriptions to those columns of Securities Performance view.