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

Calculate unrealized gains #497

Merged
merged 3 commits into from
May 23, 2024
Merged

Calculate unrealized gains #497

merged 3 commits into from
May 23, 2024

Conversation

vmartinv
Copy link
Collaborator

@vmartinv vmartinv commented Mar 8, 2024

This introduces unrealized gains calculations (proposed in #495). This is an estimation of the amount of gains/loss you could have if you sell all your shares. Features:

  • The flag --unrealized-gains to enable it.
  • Breakdown by symbol.
  • Uses yahoo finance api to get the current market prices (it shows unknown and a warning when it can't fetch it).
  • No changes to the PDF report, only the console output.

Preview of the output:

Portfolio at the end of 2023/2024 tax year:
  FOO: 423.00, £10000.00 (unrealized gains: £1000.00)
  UNKNOWN_COMPANY: 200.00, £400.00 (unrealized gains: unknown)
For tax year 2023/2024:
Number of disposals: 0
Disposal proceeds: £0.00
Allowable costs: £0.00
Capital gain: £0.00
Capital loss: £0.00
Total capital gain: £0.00
Taxable capital gain: £0
Total unrealized gains: £1000.00
WARNING: Some unrealized gains couldn't be calculated. Take a look at the symbols with unknown unrealized gains above and factor in their prices.

Generate calculations report
All done!

@vmartinv vmartinv added the feature New feature or request label Mar 8, 2024
@KapJI
Copy link
Owner

KapJI commented May 23, 2024

Thanks!

@KapJI KapJI merged commit 0337c56 into KapJI:main May 23, 2024
3 checks passed
@vmartinv vmartinv deleted the unrealized_gains branch May 23, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants