It is clear that if you want to build something, you should have all the information, rules, exceptions, etc... Not just the trading stuff, but also the fiscal stuff...
You need help from a good account/bookkeeper or you will never get what you want. I think that what you wish is so specific that there is no standard package that can cover your needs. The potential market to sell the software is too small.
I’m not going to assume such a software doesn’t exist.