The U.S. dollar extended gains in volatile trading on Tuesday, as investors weighed upbeat U.S. economic data against the situation in Spain. The euro traded higher against the dollar before softening in late trading on Tuesday, as European Central Bank (ECB) President Mario Draghi defended the bank\'s bond-buying plan after a media report said German lawyers were checking its legality. Meanwhile, latest data showed that the recovery in the U.S. housing sector was stronger than expected and consumer sentiment also jumped to a seven-month high, reducing the appeal of the dollar and the Japanese yen as safe-haven assets. According to the Standard & Poor\'s Case-Shiller home price index, average home prices increased 1.6 percent for the 20-City Composite in July compared to June, beating previous forecasts. It was the third consecutive month that all 20 cities and the Composite had recorded positive monthly changes. The U.S. consumer confidence index, compiled by research group Conference Board, increased to 70.3 in September from 61.3 in August. The result was far better than economists\' median expectation, which ranged from 63 to 65. However, the euro turned lower as protesters clashed with police in Spain\'s capital Madrid on Tuesday over the government\'s austerity plan for the 2013 budget. The scenes of large-scale protests and chaos in Spain rekindled market fears about the region\'s ongoing debt woes, pushing the shared currency down. In late New York trading on Tuesday, the euro fell to 1.2926 dollars from Monday\'s 1.2935, while the British pound slipped to 1. 6211 dollars from 1.6224. The dollar rose to 0.9362 Swiss francs from 0.9355, and to 0. 9798 Canadian dollars from 0.9784. The dollar also bought 77.77 Japanese yen as against 77.86 in the previous session.