Hi,
Yes, provided the loss and the gains are both in the same tax year. You can set the losses from the disposal of the shares against the gain from the property. CG21500 advises "Gains accruing to a person in a tax year may be chargeable to capital gains tax at different rates. Thus the tax effect of losses and the annual exempt amount set off against those gains can vary.
Subject to specific restrictions that may apply on the use of particular losses (see CG15800), allowable losses and the annual exempt amount can be deducted in the way that is most beneficial to the individual TCGA92/S1F.
Generally this will be against gains that are charged at the highest rate".
CG21500 - Individuals: Losses: assessment
Please have a look the link below for some examples of how to calculate the gains and losses.
CG21520 - Individuals: losses: Relief for losses: examples 1 to 5
Please also have a look at the self assessment guidance at:
Capital Gains Summary notes
Thank you.