Can I adjust my profits from Shariah non-compliant companies with my losses

Assalam o alaikum
I am new to the stock market. Because of my lack of research and consideration I jumped into trading stocks of any company that was not involved in non Shariah activities. All of them are med and tech basically. I am into swing trading. After earning a good £800 I got to know that I should be analysing the Financial Statements too. Now that I have thoroughly read your article and applied the formulas, I need to dispose off £749.8 as it is the profit I made from Shariah non-compliant companies. On the other hand at this moment my account is showing a loss of £316.
I usually wait for my losses to turn into profits or atleast come to 0 before I sell. If instead, I just sell my loss making shares with the intention of disposing off and then physically dispose off the rest of £434 (750 - 316), will my wealth be purified?

Wasalam

May Allah bless you.
Yes I believe it is permissible as longer as, you are offsetting with the loss made from the same non shariah compliant company.

And Allah knows best!