Most contemporary scholars permit buying shares in companies whose main business is lawful, with conditions. Shares in companies whose main business is haram (alcohol, interest-based banks) are forbidden. Scholars differ about companies that are mostly lawful but have a small amount of interest income, and about margin buying and short selling, which most forbid. Check the company and ask a scholar.
O die ihr glaubt, zehrt nicht euren Besitz untereinander auf nichtige Weise auf, es sei denn, daß es sich um einen Handel in gegenseitigem Einvernehmen handelt. Und tötet euch nicht selbst (gegenseitig). Allah ist gewiß Barmherzig gegen euch.
This is general information, not a fatwa. For your own situation, ask a qualified scholar.
Questions about halal and haram
Is trading in stocks halal?
Most contemporary scholars permit buying shares in companies whose main business is lawful, with conditions. Shares in companies whose main business is haram (alcohol, interest-based banks) are forbidden. Scholars differ about companies that are mostly lawful but have a small amount of interest income, and about margin buying and short selling, which most forbid. Check the company and ask a scholar.