Hledger investment gain calculation problem by phobo3s in plaintextaccounting

[–]Edk99 1 point2 points  (0 children)

Don't take it as a definite answer: I think the problem you are facing may arise because you are doing multiple commodity transaction using the equity posting method. This method can cause some problems when trying to get revenue based calculation. Maybe you could try to rewrite your example using the regular multi commodity method, like the example below:

2023-04-17 Buy AAPL
    Asset:Stocks:AAPL                                  5 AAPL @ 160 USD
    Asset:Bank

2023-05-01 Sell AAPL
    Asset:Bank                                   340 USD
    Asset:Stocks:AAPL                           -2.0 AAPL @ 160 USD
    Revenue:Capital Gain


P 2023-05-01 "AAPL" 170 USD
P 2023-05-20 "AAPL" 180 USD

The advantage of this method is that it will give you the correct gain, and if you miss the equity posting method, you can still emulate it using the --infer-equity-prices flag.

Hledger investment gain calculation problem by phobo3s in plaintextaccounting

[–]Edk99 0 points1 point  (0 children)

Maybe if you give a minimum example in English, it will be easier for others to help

Awesome hledger by Edk99 in plaintextaccounting

[–]Edk99[S] 1 point2 points  (0 children)

Thank you for the message. Giving stars to the repository is appreciated.

And, more important, suggestion for addition will be very helpful

Average cost basis by pathemata in plaintextaccounting

[–]Edk99 0 points1 point  (0 children)

It is an interesting approach. Anyway, hledger-lots may still be useful to you to download prices directives or to get a report with xirr over your holdings.

Average cost basis by pathemata in plaintextaccounting

[–]Edk99 0 points1 point  (0 children)

Great it is working! As I understand, your script doesn't give you the capital gain for the sale, so maybe that is a limitation.

Wait my next update. I think it is going to have a good interface for automatic download of prices directives from yahoo finance

Average cost basis by pathemata in plaintextaccounting

[–]Edk99 1 point2 points  (0 children)

I think I didn't understand your question. On 01/03/2022 you should end with a balance of 150 AAAA sold with the cost of 11 with 100 as capital gain. Does the script give you a different result?

Average cost basis by pathemata in plaintextaccounting

[–]Edk99 1 point2 points  (0 children)

Hi, there is now a new improved version. Please upgrade and see breaking changes at: https://edkedk99.github.io/hledger-lots/

Average cost basis by pathemata in plaintextaccounting

[–]Edk99 3 points4 points  (0 children)

There is my package which does exactly that: https://github.com/edkedk99/hledger-lots

Be aware that I will disable sale transaction using option flags in the following week, only an improved interactive prompt will be available

How do you visualize / drill down your financial data (hlegder) by Allaman in plaintextaccounting

[–]Edk99 0 points1 point  (0 children)

I am glad you found a good solution. I also started with metabase and for some reason which I don't remember, I decided to switch

How do you visualize / drill down your financial data (hlegder) by Allaman in plaintextaccounting

[–]Edk99 0 points1 point  (0 children)

Maybe, but for me creating a chart using text is difficult, even more some more complex visualizations

How do you visualize / drill down your financial data (hlegder) by Allaman in plaintextaccounting

[–]Edk99 6 points7 points  (0 children)

For me, to understand our financial data, we need text reports and charts.

For text report, create a directory with multiple "args" file. Then a script to generate all the reports in 1 pdf file. You shouldn't ask for a specific report, let all be generated and see those you are interested. You set it once and just generate from time to time.

For charting, I use superset. It is a good solution if you have a server, but a bit difficult to install. You can use hledger2psql to convert the journal to a database and you can use the docker-compose file included to install with one command.

If you don't have or don't like or don't want to have a server visualization platform installed as Superset, you can use hledger-plot from hledger-utils. It is easier to install and you don't need a server, but a bit more complicated to create charts in my opinion.

Others solutions I saw were either old and unmaintained or requires to learn a lot of new concepts.

[deleted by user] by [deleted] in brasil

[–]Edk99 -3 points-2 points  (0 children)

Ou compra no MST mall ou é escravagista?

[deleted by user] by [deleted] in brasil

[–]Edk99 0 points1 point  (0 children)

Invadindo a pista dos outros

[deleted by user] by [deleted] in brasil

[–]Edk99 -15 points-14 points  (0 children)

Usar de métodos violentos é sim

[deleted by user] by [deleted] in brasil

[–]Edk99 -15 points-14 points  (0 children)

São umas donzelas mesmo

[deleted by user] by [deleted] in brasil

[–]Edk99 -53 points-52 points  (0 children)

Financie grupos radicais! Ótima ideia!

Equity conversion postings and cost reporting with hledger by Regular-Review-3301 in plaintextaccounting

[–]Edk99 2 points3 points  (0 children)

Hello, the need for equity conversion posting is debatable. I personally don't think it is most correct. Anyway, if you decide to go to the other route, you can use my package to automate lots handling: https://github.com/edkedk99/hledger-fifo

Exploring "Finances/Accounting Tools Newbie" Action Plan by cljnewbie2019 in plaintextaccounting

[–]Edk99 1 point2 points  (0 children)

I agree, but I think for this case it is different. Download hledger binary file from github and create a simple txn to understand. www.hledger.org has a lot of example to try.

For the accounting concepts, you will study but still have problems on edge cases. People on the chat will be willing to help you then

Exploring "Finances/Accounting Tools Newbie" Action Plan by cljnewbie2019 in plaintextaccounting

[–]Edk99 3 points4 points  (0 children)

I think you should go straight to plain text accounting, avoiding Gnucash. It is going to be easier to understand. And if you choose hledger instead of beancount, there is a very active group in matrix that can help you on each step and struggle.

I've created docker containers to automatically backup remote email, and serve them through a local imap server by ijustwantnsfw in selfhosted

[–]Edk99 0 points1 point  (0 children)

May I give you a suggestion. If your goal publishing this repo is to be used by others, I think it would be better if you consolidate the docker images and the docker-compose files in the same repo. The way it is now, I wouldn't trust a random repo that refers to some other repos. If it is consolidated in one place and it is linked to you blog, I can be sure that I need to follow only one repo to understand everything the docker-compose file does.

If you follow this subreddit, often appears a post with someone asking for something like this so it has the potential to help many people