I understand gross and net return can be calculated and even the broker can calculate (or estimate) them for you. My concern is that, specially net return, is difficult to do with PTA.
Gross return is quite easy if you update prices of the commodities. hledger bal assets:investments --cost
for purchase cost and hledge bal assets:investments --value
for current value, and you can calculate the gross return (if there are other outflows such as dividends or interests you should take them into account).
However, net return calculation is more difficult because you need to record the expenses (fees, taxes...) you would have if you sell just now the assets. So, you have to introduce that information somehow...
- inside the pta file: you could estimate monthly or yearly the fees and taxes you would have if you sell the assets. You could creare a transation againts the unrealized gain and losses equity account What Are Unrealized Gains and Losses?. Because expenses happen when you really sell the assets.
2024-08-31 estimation of taxes and fees
liabilities:taxes 25.00 EUR
liabilities:fees 25.00 EUR
equity:unrealized-gain-losses
- outside the pta file: you dont record information to estimate the net return. you could export your opened lots to process the lots in a spreadsheet. Or you could create one script to look at your hledger file and calculate net return.
You should consider if this worth the work.
You shoul also take a look to hledger-roi script GitHub - adept/hledger-roi: Hledger Return-on-investment calucator. Does time-weighted (TWR) and money-weighted (IRR) computations . I use it to estimate IRR and TWR of my investments.