alexpung / UK-Investment-tax-calculator

Capital gain and dividend tax calculator for UK tax
https://alexpung.github.io/UK-Investment-tax-calculator/
Other
9 stars 1 forks source link

Thoughts on how to support accumulating funds? #101

Open JackUkleja opened 1 day ago

JackUkleja commented 1 day ago

Hi @alexpung.

Impressive project!

Just wondering if you have thoughts on how best to extend it to support accumulating funds?

Support would be needed for 'adjustments' as well as just trades. Specifically:

Also I can see these projects are complicated the fact every broker uses different file formats. I am happy to contribute one for ii.co.uk, although I am exploring whether to use sharesight.com as they do a lot of the work already to import from many different brokers. Supporting that could open up your tool to many more users.

Cheers

alexpung commented 23 hours ago

To add accumulated funds you would need the following:

  1. Write a FundTrade class and a FundAdjustment class that carry the information needed for calculation. FundAdjustment class probably need to implement IChangeSection104.
  2. Write a Parser component to collect the data from the statements and put the data in TaxEventLists
  3. Write a class that implement ITradeTaxCalculation that will collect Trades in the same day and allow calculation of gain/loss, it would also do section104 matching here.
  4. Write a ITradeCalculator that will take a TaxEventLists (that would have a list of FundTrade class and a FundAdjustment) and produce ITradeTaxCalculation with the results. You will do the adjustments needed here and you can probably reuse the tax matching algo.

For what is expected from a Parser see ITaxEventFileParser