Referring this question to Dr. Monzer Kahf , Scholar in Islamic Economics & Financial Expert, he said,

Trading currencies online is difficult to claim as permissible, because currencies are not subject of trade. They are only money that serves the market in all known functions of money.
On the other hand speculation in currencies, commodities, equities and other assets is not within the Islamic arena of transactions and trade. Trade is different from speculation and I see many problems in speculations from Shari`ah point of view. I would see that if the conditions mentioned above plus: 1) actual delivery of goods purchased or sold, and 2) avoidance of futures, the transactions may be permissible provided they are not speculative. I define speculation as having one concern only that is the price change.