pviotti / degiro-bookkeeper

Simple financial accounting for Degiro.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does it take into account the 4 weeks rule?

goenning opened this issue · comments

According to Revenue:

Shares sold within four weeks of acquisition
Shares bought and sold within a four-week period cannot be offset against other gains.

You can only deduct the loss from a gain made on a subsequent disposal of same-class shares acquired within the four weeks.

https://www.revenue.ie/en/gains-gifts-and-inheritance/transfering-an-asset/selling-or-disposing-of-shares.aspx

Is this something you intend to add?

commented

The 4 weeks offset rule is part of the exception to the FIFO rule for Irish Revenue.

So let's say that we implement a --fifo flag to compute earnings the way Irish Revenue wants. With that flag:

  • normally, earnings are computed using FIFO rule
  • earnings from buy and sell transactions within 4 weeks are computed according to the LIFO rule (and maybe marked as such in the CLI output and in the CSV)
  • total profit/loss (now only reported as output on the command line) is a sum of all earnings (either computed as FIFO or LIFO). For the purpose of computing total earnings, all earnings in a single "LIFO 4-weeks period" are summed up into a single "macro LIFO earning". If the resulting "macro LIFO earning" is negative, it is not taken into account in the total profit/loss sum, and reported separately.

I hope that makes sense 🙂

But I suspect there are edge cases and patterns that I didn't think of, as they don't appear in my own trading record.
So I'd say that my first priority for this tool is to work out basic, generic figures from the account statement, rather than chasing this or that country's definitions of earning for taxation purposes - though I'd welcome contributions to support them.

(related to #38)

Yeah, that makes sense. When I saw the project initially I thought the intention was to build it specifically for Irish users.

I'd just suggest using a country code cli parameter to activate country specific rules, otherwise it'd end up with a lot of different cli flags once more countries are supported.