All perfect praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
Electronic stock exchange or margin trading is forbidden for several reasons. Most importantly, there is no actual or constructive holding of the stocks. Also, the broker benefits from the money it lends to the client to trade in over the deposited amount. However, according to scholarly consensus, any loan which provides benefit to the lender is considered usury.
The Islamic Fiqh Academy of the Islamic World League issued Resolution No. (18/1), which prohibits this kind of transaction along with explaining all the violations of Sharia therein. And Allah The Almighty Knows Best.