Online trading is like face to face trading. It is allowed if the material is allowed and vice versa. Stock market trading depends on the activities of the company of the shares. If the company deals with non Halal ( forbidden) business like interest, alcohol, etc, then buying or dealing with shares of such company is not allowed. If the company deals with permissible activities, then dealing with its shares will be permissible.