If this were the case you would be talking in terms of the total sale, not the posted gain. Best of my knowledge its only the gain, so I can't see the outlay on the purchase being relevant. If you have something that says different, then I genuinely would like to have a read of it.
Applying the rules and regulations to come to a fiscal position IS accounting. If there are additional rules to take into account, then these become the "accountancy rules". Regulatory/compliance just means you can show you have followed the rules.
Anyway
@hibbo'sclass or
@The Esk are actually the guys you want for this.