Trading constitutes of many different products. Just like a supermarket, you can buy bread, vegetables, alcohol, or pork. The main goal is to participate in halal investments and abstain from haram investments.
Trading in companies that sell and create halal products such as mining, gold, oil, commodities, energy are generally accepted. Abstien from companies that involve dealing in things that are against Islamic teachings such as alcohol, pork products etc.
Similarly, there are halal products (equities, commodities) and haram products such as bonds and debentures also known as debt equity. Where you make money by lending an x amount and making monthly interest fees.
This is to give you a general idea of what is considered halal and haram. Furthermore, there are actions in trading that are not permissible such as betting against the market or known as hedging since you are not investing in the product but rather in the probability of the success or the failure of said products. This is generally resembling gambling.
That being said, there are some Muslim brokers that can advise you on the list of stocks that are considered halal based on their operations style, products and so forth. You may want to consult these experts to have an assuring way of trading in the stocks market.
Regards,
Abdelarhman.