All perfect praise be to Allah, The Lord of the Worlds, and may His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
The form mentioned in the above question is similar to future contracts and binary options contracts which are prohibited in Islam and not permissible to be dealt in.
The General Ifaa` Department has delivered a Fatwa pointing out that the above contracts are prohibited. Moreover, the International Islamic Fiqh Academy, during its seventh session, stated that dealing in the aforementioned contracts isn`t permissible because the price of the gold is unknown and payment isn`t made on the same spot. In fact, it is a condition that the purchase of gold should be immediate and that payment should be made on the same spot.
Allah's Messenger (PBUH) said, "Do not sell gold for gold unless equivalent in weight, and do not sell less amount for greater amount or vice versa; and do not sell silver for silver unless equivalent in weight, and do not sell less amount for greater amount or vice versa and do not sell gold or silver that is not present at the moment of exchange for gold or silver that is present."{Bukhari}.
Al-Imam An-Nawawi said, "Scholars have agreed that it isn`t permissible to sell gold for silver{Usurious types} or vice versa while one of them isn`t present at the moment of exchange……However, it is permissible for the seller and the buyer to part before payment is made on the same spot whether the item is sold for one of its kind or one that shares the same effective case(Usurious type) , such as selling gold for silver."{Sharih An-Nawawi Ala Muslim}. And Allah knows best.