Closed lyricnz closed 2 years ago
With the following config
[portfolio]
columns = ["rank", "name", "symbol", "price", "holdings", "balance", "1h_change", "24h_change", "7d_change", "percent_holdings", "last_updated"]
compact_notation = false
holdings = [["Algorand", "100", "1.95", "USD"], ["Binance Coin", "3.2", "401.45", "USD"], ["Bitcoin", "0.1", "34849.83", "USD"]]
The following output
Added "cost" and changed some of the formatting.
[portfolio]
holdings = [["Algorand", "100", "1.95", "USD"], ["Binance Coin", "3.2", "401.45", "USD"], ["Bitcoin", "0.1", "34849.83", "USD"]]
columns = ["rank", "name", "symbol", "price", "holdings", "balance", "buy_price", "buy_currency", "cost", "profit", "profit_percent"]
Nice! I Think in the next step it would also be interesting to add the date the purchase was made, so one can see the differences in performance over time - I don't think, though, that this should go in the same PR, should it? (Of course the maintainers have to decide!)
I don't know how to make new edit fields, and in fact are in the middle of a radical overhaul of color/keybinding in another PR. Can you test this PR, see if it works for you? (or help?) There are still some todo's here, in particular currency conversion.
There's still an issue with changing currency conversion - it takes a while for the table to update, so the numbers are wrong for a bit.
Priced in SATs
The slow-update is caused by #178 which has to do with updating all the pages of coins, one after another, before going back to the top. I think this PR is ready for review. Will raise feature-requests for pnl-alerts and pnl "cointop holdings" output.
Renamed and combined buy-price and buy-currency to "cost price".
With the following portfolio (cost in diverse currencies) and column configuration, and the currency set to GBP (British Pound).
[portfolio]
columns = ["rank", "name", "symbol", "price", "holdings", "balance", "cost_price", "cost", "profit", "profit_percent"]
holdings = [["Algorand", "100", "1.95", "USD"], ["Binance Coin", "3.2", "401.45", "USD"], ["Bitcoin", "0.1", "50100.83", "AUD"]]
it looks like this:
Oh! There's still no support for editing the cost price in the UI. I have no idea how to do this yet.
For consistency, I renamed 'profit' column keys to 'pnl'. I also added the cost and pnl columns to the default list of column but they'll only render if there's at least one portfolio entry with a specified cost basis. https://github.com/cointop-sh/cointop/commit/fe9400080e07f52af1d139247deee074f327b961
Overall it works great! nice job @lyricnz
Oops, I didn't notice your commits weren't in this branch/PR, but were in another! I tried to update your branch from
sorry about that! I didn't realize that it was in a different branch. The other PR looks good @lyricnz
Add support for declaring a BuyPrice and BuyCurrency in portfolio. eg: ["Algorand", "125.4", "0.8", "USD"]
Add optional (default off) columns to portfolio: "buy_price", "buy_currency", "profit", "profit_percent"
TODO: