It is certainly permissible to invest one’s money in buying and selling shares, provided that the shares you buy or sell are that of a business, which is permissible to operate. Thus, it is perfectly permissible to own shares in a furniture company, an iron and steel corporation, a supermarket, a travel agency, a computer business, etc. The list is endless.
It is not permissible, however, to own share in a wine company, a brewery, a gambling shop, etc. because all these either sell things that are forbidden or provide services that are also forbidden. That makes any profits earned from such business forbidden to have.
A Bank that operates on the capitalist system of finance belongs to this second category, because much of its operations are interest charging. When you buy shares in a Bank, you are actually owning a portion of that Bank which means you are involved in all its operations, in a way, you are actually helping in all its operation. Therefore, it is forbidden to own shares in a Bank where interest is the basis for most of its transactions