You do this calculation and if there is a capital gain you must declare and be taxed at 30%: selling price - [total acquisition price × (selling price / total portfolio value)].