When you buy shares you buy an asset - the shares. Cash flows but this is not an expense: you are transferring value from a cash or bank account to shares.
When you sell shares the profit or loss on the sale is income or expense. Do not enter the proceeds in the receiving account.
Go to "Shares held" (assuming this is the account in which the shares purchased are recorded) and enter the transaction as a sale of the shares. You will be prompted for the proceeds, the account which has received the proceeds and the
number of shares sold. You will need to allocate share lots to the disposal. The profit or loss on the disposal will be calculated by Money, the shares will be removed from your investments and the profit or loss will show as income (with a negative
amount if it is a loss) under Investment Income: Capital Gains.