After swinging 470 points during the day, the 30-share Sensex settled 38.80 points, or 0.10 per cent, higher at 37,350.33.
Pick-up in demand from local jewellers at the domestic spot market led to the rise in gold prices, analysts said.
Analysts said speculative positions created by traders led to rise in oil prices.
At the Interbank Foreign Exchange, the rupee opened weak at 71.33 then fell to 71.47 against the US dollar.
The 30-share index pared some opening losses to trade 248.25 points or 0.67 per cent lower at 37,063.28 at 0930 hours.
Gold is trading at Rs 37,945 per 10 gram in the national capital due to lacklustre demand from jewellers.
After surging 515 points during the session, the 30-share Sensex settled 353.37 points or 0.96 pc higher at 37,311.53.
Forex traders said US delaying new tariffs on Chinese electronics to December 15, also helped investor sentiments.
Easing inflation numbers, released after market hours on Tuesday, too helped the recovery in domestic market sentiment, traders said.
The benchmark Index fell 693 point intra-day as it touched a low of 36,888.49 with major heavy weights down 2 to 5 per cent.