GithubHelp home page GithubHelp logo

ghostfolio / ghostfolio Goto Github PK

View Code? Open in Web Editor NEW
3.7K 21.0 343.0 30.15 MB

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🀍

Home Page: https://Ghostfol.io

License: GNU Affero General Public License v3.0

JavaScript 0.31% TypeScript 69.57% HTML 27.23% SCSS 2.37% Dockerfile 0.09% PLpgSQL 0.08% CSS 0.31% Shell 0.04%
wealth-management web software angular typescript prisma portfolio etf stock nestjs

ghostfolio's Issues

Clean up module imports and exports

  • CacheModule -> imports too many modules
  • InfoModule -> imports too many modules
  • DataGatheringModule -> exports DataEnhancerModule (good practice?)

Dividends

Is there also an idea / implementation regarding dividend payment that can be registered ?

Account Cluster Risk showing internal ID instead of Account Name

While fiddling around with all the neat functions I stumbled upon a small UI error.

Installation: Self-hosted
Version: v1.104.0 (via Docker-Hub)

As seen in below screenshot the Account Cluster Risk under Xray shows the internal ID of the Account instead of the Account-name:
image

Cheers!

Add Activity dialog not working

Steps to reproduce

  1. Create a new account
  2. From the main screen, after signup
  3. Click on "Time to add your first activity"

Expected behaviour

  • Dialog to add new activity shows up
  • In the Activities page, clicking in "Time to add your first activity" shows the dialog

Current behaviour

  • Dialog to add new activity don't shows up
  • In the Activities page, clicking in "Time to add your first activity" does nothing

Notes:

Add support for free stocks

When I add stock with price "0" overview does not load and console spits out errors:

ghostfolio_1  | [Nest] 1  - 12/07/2021, 5:03:29 PM   ERROR [ExceptionsHandler] [big.js] Division by zero
ghostfolio_1  | Error: [big.js] Division by zero
ghostfolio_1  |     at Big.P.div (/ghostfolio/apps/api/node_modules/big.js/big.js:356:13)
ghostfolio_1  |     at PortfolioCalculator.<anonymous> (/ghostfolio/apps/api/main.js:3735:62)
ghostfolio_1  |     at Generator.next (<anonymous>)
ghostfolio_1  |     at fulfilled (/ghostfolio/apps/api/node_modules/tslib/tslib.js:114:62)
ghostfolio_1  |     at runNextTicks (internal/process/task_queues.js:60:5)
ghostfolio_1  |     at processImmediate (internal/timers.js:437:9)

Running in docker built from v1.86.0 tag.

Ideas of features

Hey guys, how is it going?

First of all, I wanted to say thanks for your hard work put on this app, it's awesome that we have something this good as an open-source project.

In Brazil we have a very cool app called Kinvo, which I'm moving from to Ghostfolio now.
This app has some cool features that I wanted to share with you to get your feedback on and, if it's cool enough, put in the roadmap for future releases.
I want contribute to the project, mainly on the back-end side because it's were I'm more proficient on.

  • Distinction between Real and Nominal income.

Ghostfolio gives us a very cool and easy way of seeing how much our investments give us in return, both in currency and in percentage values, but sometimes the investments we make isn't beating inflation and this is a super important factor when investing.

Here's a screenshot of Kinvo's page about Profit:

real_nominal_income

On the right we can see the Profit/Loss in a easy way with circles for Real income (% Real) and for Nominal income (% Total), and we can select the timeframe for this (since the beginning, year-to-date, 1 year, 2 years, 3 years, 5 years, and 10 years).
This feature is powerful for seeing if our investments are in the right direction, and I think we could add this to Ghostfolio.

I'm not sure exactly where we can add some form of visualisation (maybe on the first page with the graph and/or in the Summary), but, as Ghostfolio is used internationally, I think we could have a set of predefined inflation indexes for each currency - with a default one for each currency - and then the user could choose in the settings which index he/she wants to use to compare its portfolio against.
This would address cases where a currency has multiple inflation indexes (for example in Brazil we have IPCA and IGPM).

  • Ability to have custom Asset Classes for better visualisation in allocations and current allocation in % for a stock for both in-class and whole portfolio.

Now we can see the asset classes based on asset type, but sometimes we want to visualize our portfolio in different ways.
For example, maybe we want to have different allocation categories for different stocks (differing Growth and Value for example).
Or even have different categories for Stocks and ETFs.
And, as we have these classes, we want to see the weight of each asset inside the class in percentage.
For example, having Stock A and Stock B inside Class X, we want to see that Stock A represents 87% of Class X, and Stock B represents the remaining 13%.

And we could generate graphs and information for each group.
For example, Kinvo's page about stocks:
Screenshot 2021-12-12 at 11 24 31
Screenshot 2021-12-12 at 11 26 42

We have a profit/loss graph by month (whole class and by each stock), nominal value (Saldo Bruto), invested value (Valor Aplicado), result in currency, result in percentage, dividends in currency (Proventos), and Yield on Cost).
Screenshot 2021-12-12 at 11 24 49
Right below we have a list with each stock, allocation percentages, dividends by type (Proventos por Tipo), stock by sector (Por Setor/Subsetor), and all of the operations made in each stock.

  • Portfolio comparison against different indexes

Again, in Kinvo's page about Profit:
income_comparison_against_indexes

In the middle we can see the Profit/Loss per day (% por dia), per moth (% por mΓͺs), and per year (% por ano), which can be compared to the inflation graph (Inflação IPCA), as well as IBOV and CDI.

We could even expand this and have this comparisons against each asset class, so we could compare our american stocks portfolio against S&P500, our british stocks portfolio against FTSE 100, and our fixed income portfolio against CPI.
I think this could be customised by the user, so he/she can compare any asset class to any index he/she wants.

These are some ideas and inspirations of features we can add to this awesome app.
What do you guys think?

Build new releases 1.87 and 1.88 fail

I'm trying to build newest releases from 1.87.0 and 1.88.0 with docker-compose -f docker/docker-compose-build-local.yml build, but I get the following error message:

Step 25/30 : RUN yarn database:generate-typings
---> Running in 71b1bcd376f0
yarn run v1.22.15
$ prisma generate
/bin/sh: prisma: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c yarn database:generate-typings' returned a non-zero code: 127
ERROR: Service 'ghostfolio' failed to build : Build failed

I'm now on 1.83.0.

Is the `watch:server` script correct?

Hey! On my local setup, the watch:server yarn script doesn't seem to work properly.

With nx build api --watch, the client side app cannot connect to the servier. Updating this to nx serve api --watch, which I took from nx docs, seems to fix it.

Is it something I'm doing wrong?

API /order 400 error on TSK symbols

Hi,

Trying to add BB.TO return a 400 error from the API

// https://ghostfol.io/api/order
{"accountId":"asdf","dataSource":"YAHOO","date":"2021-08-13T12:40:33.184Z","fee":0,"quantity":11,"symbol":"BB.TO","type":"BUY","unitPrice":22}

image

Annualized performance

Hi @dtslvr, not sure if this helps but I noticed another performance inconsistency, this time in the Summary tab. With a time in the market of 5 months for a simulated portfolio, I get:

  • gross performance = -1.24%
  • net performance = -1.93% (so far so good)
  • annualized performance = +49.64%

I assume this once again stems from the use of TWR, with some positions in the simulated portfolio opened just a few days ago at the "dip" preceding the recent swift recovery.

Originally posted by @FedericoComoglio in #554 (comment)

Please allow overview for single account

Would it be possible to add ability to limit overview to show data from one account only? I have one account with free stocks and it messes up overview of my "real" investments.

Unable to add stock for a company that does not exist anymore

I'm trying to import all of my historical data and I have a stock from a company that no longer exists (it was bought by another company). When I try to add that stock to my portfolio, it does not show up in the list of securities and I can't import it.

Example: I used to have HSE.TO (Husky Energy) which was bought out by CVE.TO this year, but I can't add HSE to my portfolio since that stock no longer exists.

Adding or editing transaction queries database multiple times

Adding or editing an transaction will spit out following error for every day between now and date of the transaction. I have multiple transactions with the same date not sure if it was happening before I added them or not.

postgres_1    | 2021-12-07 17:09:03.719 UTC [43] ERROR:  duplicate key value violates unique constraint "MarketData.date_symbol_unique"
postgres_1    | 2021-12-07 17:09:03.719 UTC [43] DETAIL:  Key (date, symbol)=(2021-12-06 00:00:00, VTI) already exists.
postgres_1    | 2021-12-07 17:09:03.719 UTC [43] STATEMENT:  INSERT INTO "public"."MarketData" ("createdAt","dataSource","date","id","symbol","marketPrice") VALUES ($1,$2,$3,$4,$5,$6) RETURNING "public"."MarketData"."date", `"public"."MarketData"."symbol"

Running in docker built from v1.86.0 tag.

[RFC] Include fee in calculations

Hi, my preference would be to have the fee included in the calculations/charts. Short of that, it'd also work to have it as an option that people can switch on and off.

Happy to look into implementing that, if you can assist me with some pointers.

[bug] Holdings screen does not work with a Frankfurt exchange transaction

Hi @dtslvr, just trying out Ghostfolio and at first glance I must say it looks fantastic. Very well designed and great UX. Thank you for your work and making it open source.

I have an issue (hosted version) with the stock ticker options not always showing up. Sometimes I type part of it and it gets autocompleted, sometimes it does not The issue is that when I don't select one of the options, even if the text is the same (say, APC.F), it won't let me save the transaction.

Running ghostfolio behind traefik

Hi all,

I'm currently trying to setup a ghostfolio instance behind traefik v2.

Unfortunately I doesn't work as expected.

I did follow the instructions in the README and everything starts up just fine with the DB populated and ghostfolio accessibel via my domain.
BUT when I try to login with the provided secret for the Admin user I just get the message:
"Oops! Incorrect Security Token."
and on the top left another one saying:
"This feature requires a subscription - Upgrade Plan".

So I thought "Ok I'm creating a user myself and assign it the ADMIN role in the database".
That didn't work as expected either.
When I click on "Get Started" > "Create Account" I get the popup with the generated Security Token and after agreeing to that the user gets created in the database.
BUT when I try to login with that user then I get the same messages mentioned above when I try to login with the provided Admin from the README.
In fact I get those messages every time when I try to login with any account I create.

I guess the reverse-proxy fucked up the api-calls somehow as I do get a 401 unathorized when trying to login and ghostfolio sending that request in the Firefox Developer Tools:
GET https://ghostfolio.mydomain.org/api/user

I would provide you with the logs though right now I think that doesn't make any sense as there are no errors present besides that one in Firefox.
If there is a way to adjust log-level to DEBUG/INFO somehow?

Thanks in advance for any ideas you may have to solve this!

Manager for supported currencies

As a Ghostfolio administrator I would like to manage the supported currencies used for

  • base currency of a user
  • currency of an account
  • Create an admin api endpoint to edit entries of the model Property
  • Support management of currencies in the admin control panel
  • Combine currencies in Property with other symbols in data gathering

Line chart (overview) missing data points for 2022

Hi,

I noticed the line chart in the overview stopped updating at the end of last year. There seem to be missing data points for 2022. As a consequence, the trend for the new year is simply a segment. A message ("Sorry! Our data providing partner is experiencing the hiccup") keeps appearing since the beginning of the year, too.

Thank you!

Inconsistent change/performance values in Holdings tab

Hi,

I promised to report a few inconsistencies that I noticed while testing Ghostfolio functionalities. When thinking about the performance of a security, I generally think of three components:

  • capital gains
  • dividend gains
  • currency gains.

Clearly, change/performance can be gross or net, depending on whether transaction fees are taken into account. Looking into previous issues, I noticed that recent releases of Ghostfolio indeed feature both net and gross performance (nice!). In addition, I am aware that some features -such as introducing a DIVIDEND transaction type - are in the making and cannot contribute to the issue I am reporting here. For simplicity, I also picked an example of a stock in CHF, to rule out currency effects.

Based on the attached screenshot, I would like to understand how the indicated "change" and "performance" are exactly computed (of note, the total transaction fee for this position amounts to CHF 11.35). In particular:

  • I get that investment simply refers to average buy price * quantity (141.8 * 14)
  • I would expect change to be defined as (market price - average buy price) * quantity. This would amount to (143.9-141.8) * 14 = 29.4 gross or 18.05 net (i.e. 29.4 - transaction fees).
  • I would expect performance to be defined as change/investment * 100, but this is not the case. I also don't get why it is negative in spite of a positive change. Even factoring in transaction fees, that would still result in a performance of -0.42%: (2.85 - 11.35) / 1985.2 * 100

Could you please clarify how are these quantities computed, and what am I missing here, in case?

Thanks a lot!

Screen Shot 2021-12-18 at 3 31 40 PM

Optimize data gathering

Each time when the data-gathering-7d runs it's requesting data that's already in the database

Perhaps good to have some kind of check in place if the data has already been grabbed to keep the API from being overcalled and thus restricting the download of data.

With 400 stocks, in 30 mins Ghostfolio has told me that the data couldn't be grabbed because of API overusage

Baseline (break-even point) not visible on desktop

On mobile:
image

And, on dekstop it fades:
image

I definitely love the simplicity and minimalistic design of ghostfolio (one of the main reasons, in addition to being open source + nice community that I chose it for), but in that case I think functionality trumps design.

As a separate RFC, I'd be great to be able to hover over the graph and see the standing for that particular point in time, and have the calculation at the bottom of the page update accordingly. That might, though, be too resourceful for the server and tricky to implement.. In that area, I think M1 Finance has a somewhat similar and great UI to get inspiration from :-)

Problem Running the Frontend

I followed the setup instructions in README.

For the server, I ran yarn start:server and for client, I ran yarn start:client

However, I get the following error and http://localhost:4200/ is blank (nothing is showing up)

Screen Shot 2021-07-31 at 7 53 04 PM

Any idea how to solve this?

really cool project btw πŸ™πŸΌ πŸ˜ƒ

Nodejs version issue

I am trying to install on WSL2 Ubuntu and I get this error after trying yarn install

yarn install v1.22.11
[1/5] Validating package.json...
error [email protected]: The engine "node" is incompatible with this module. Expected version "14.x". Got "16.6.2"
error Found incompatible module.

This is odd as the requirement is 14.x and above. 16.6.2 clearly satisfies this requirement.

Portfolio Allocation Currency

I'm a python guy looking to build a similar app to what you have built here. Looks awesome by the way.

The currency on the portfolio, I created a base account in USD (would like to be able to create one in another currency but only EUR and USD came up)

and then on the portfolio allocation currency chart it shows CHF in the hover text. I'm not an expert in JS (a wee beginner) or TS or angular to understand how this is being created on the back end or even shown so will just raise an issue.

image

Add Yuh to platforms

Hi,

Yuh! is a new platform launched as a joint venture between PostFinance and Swissquote. Would it be possible to add it to the list of available platforms on Ghostfolio?

Thank you!

Date range buttons no longer visible on holdings screen

image

^ these buttons no longer show up on the holdings (wallet) screen. But having them dare is actually really useful: it allows me to check how the stocks perform daily, and then move to the MAX button to review the overall performance of the portfolio.

How to for the Finalization part

I don't know how to perform the 2 following steps:

  1. Assign the role ADMIN to this user (directly in the database)
  2. Delete the original Admin (directly in the database)

Can it be explained?

Selfhosting and custom Admin Access Token and Salt

Hello,

I tried running Ghostfolio with docker-compose. With defaults from .env and the Readme it works fine. But i would like to use my own Admin Access Token in the Seed as well as another Salt (ACCESS_TOKEN_SALT) . The App runs just fine and I am able to create a user with a Token. But unfortunately i have no idea what the Access Token for the Admin user is and therefore i am unable to login as Admin.

How do I find out the access token for the Admin user?

I was trying to replicate the reateAccessToken function from the project. But I'm not getting the Token mentioned in the Readme with Inputs from the Seed and Salt from this Repo.

Transaction detail should show current transaction info

Opening transaction detail shows average buying price, all time performance of all transactions of this stock and total investment. While this is useful and should be accessible somehow, transaction detail should show price of the stock at the time of transaction (not average of all) and performance for this transaction only. Especially the last part is important since you might want to know single transaction performance when you are taxing sold stocks.

TLDR: data for all transaction of given stock and data of a single transaction should be two separate screens.

Revamp Holdings screen to show investment value

One of the areas that's missing is the total current value of an investment on the Holdings screen. Here's a way to show it without overcrowding it:

image

Logo is optional, though I kinda like the more visual effect :-) It's a bit motivating also to see the logos of the companies you've put your money in 😁

Happy to take a look into implementing this... though not sure what API ghostfolio is using behind the scenes and if there's an easy way to grab the logo

How to use a new currency?

I see that it's supposed to have the functionality by #387 but I can't find how to do it.
I have tried the online version, it has a few currencies, but it doesn't have CAD. I've tried a local version, it has only EUR and USD and I can't find any place where I could add any. Is there any?
image
I was able to specify CAD in API request manually, but it's hacky and I think something won't work. Also, it would be nice to use CAD by default for everything.
Thank you.

Save button grayed-out in new transaction form

Hi,

while testing, I am unable to save a new (fake) transaction for ticker BRKB. I confirm the new transaction form is filled in entirely and with valid input. I did not experience this issue before for other tickers (I tested another 5 without changing anything else in the form and the save button became available). It appears to specifically affect BRKB. I can reproduce the issue both on Chrome as well as on Safari.

Hope this helps. Thank you!
Screen Shot 2021-12-16 at 2 55 04 PM
Screen Shot 2021-12-16 at 2 54 58 PM

Add new currency and stocks from another country

I really enjoyed this project, it's simple and very intuitive and the best one is that it is open source and self hosted :D

But I can't use to manage the portfolio on my country (Brazil), I don't know the technical details, but I think it'll not be so difficult to add the B3 (Bovespa and BMF) and BRL currency to the project, the stock info already is at the yahoo financial (for example PETR4).

Thanks and keep the good work :D

Example for CSV import

Is it possible to include an example CSV file for when people want to import their full portfolio into Ghostfolio ?

I did see that there's a JSON reader but couldn't find the correct values that the CSV reader requires to load the whole portfolio in

all in one docker compose configuration

Hi,
I set up a quick'n' dirty set of scripts to allow using Ghostfolio in a headless docker environment, you can find it here.

Hopefully this can be useful, it's hackish but works :)

Add validation for api/import

A typical export consists of a list of objects like this:

{
      "currency": "USD",
      "dataSource": "YAHOO",
      "date": "2018-07-16T00:00:00.000Z",
      "fee": 13.79,
      "quantity": 1,
      "symbol": "AMZN",
      "type": "BUY",
      "unitPrice": 1823
}

Add an object validation to the ImportService which checks the following fields:

Limit to maximum 20 items.

The response should either be that all items have been imported (200 OK) or a little report of which items would fail (400 BAD REQUEST).

Accessing database when self-hosting (Finalization)

I am trying to follow the setup steps in the README. However, as I have only basic knowledge of docker(-compose) and PostgreSQL, I was not able to do the "Finalization" steps (namely accessing the database).

In issue #635 basically the same question is raised but when I follow the steps of the answer I get the following error when doing docker-compose exec postgres psql -U user in the docker directory:

psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  database "user" does not exist

What am I missing?

Fix warning in ./libs/common/src/lib/types/index.ts

On server startup, the following warnings appear in the log:

WARNING in ./libs/common/src/lib/types/index.ts 6:0-92
"export 'AccessWithGranteeUser' was not found in './access-with-grantee-user.type'

WARNING in ./libs/common/src/lib/types/index.ts 6:0-92
"export 'DateRange' was not found in './date-range.type'

WARNING in ./libs/common/src/lib/types/index.ts 6:0-92
"export 'Granularity' was not found in './granularity.type'

WARNING in ./libs/common/src/lib/types/index.ts 6:0-92
"export 'OrderWithAccount' was not found in './order-with-account.type'

WARNING in ./libs/common/src/lib/types/index.ts 6:0-92
"export 'RequestWithUser' was not found in './request-with-user.type'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.