Suppose we want to do exemption harvesting. We will sell units and buy again.
I suppose this may change the calculation of returns since the new buy is considered instead of the actual buy.
If there is no existing way to find actual portfolio XIRR, please add a way to tag trades for actual calculation purpose.
siva
2
Ofcourse returns will change once user sold and bought later, believe there is no other way around this.
believe there is no other way around this.
There is if the user tracks/tag the sell/buy appropriately.
For example at an extremely high level:
class Txn:
[...]
def buy_date_for_effective_return(self):
if self.type == buy and self.exempt_harvest_txn:
return get_txn(self.exempt_harvest_txn).date
else:
return self.date
def buy_price_for_effective_return(self):
if self.type == buy and self.exempt_harvest_txn:
return get_txn(self.exempt_harvest_txn).buy_price
else:
return self.buy_price
[...]
[...]
txn_s.type = sell
txn_b.type = buy
txn_s.exempt_harvest_txn = txn_b.id
txn_b.exempt_harvest_txn = txn_s.id
[...]
The display/calculation would be separate from taxation for obvious reason.
The exemption harvesting can in-fact be automated via a feature (“buy again” on sell screen) so tagging is done automatically.
siva
4
For now tagging need to done again , said that current returns will be calculated from new price only.