For German residents: If you make a profit from the sale of securities, capital gains tax must be paid on that realized profit. However, if you have made losses on your other positions and realized them, the realized gains and losses can be offset against each other for the calculation of the tax.
For additional information, please consult with your tax advisor.