It is permissible to trade stocks provided with two conditions:
1) One must trade only permissible stocks. There are certain criteria about the permissibility of stocks which is derived from the permissibility of main line of business and that the company is not loaded with non-permissible transactions/contracts.
2) The second criteria is that the trading (of stock) contract is permissible. For instance the AAOIFI (Auditing and Accounting Organization of Islamic Financial Institutions) resolved that buying stock on future delivery or on a loan from broker are not permissible.