Taxes - Practical Issues board.
likewise bed and ISA.
Otherwise its a spreadsheet with a balance of available allowance figure updated after each transaction. Work out the gain per share and thus how many you need to sell (while leaving some margin for price movements). [more]