(Updates prices after European open)
* Europe opens in red, S&P futures whipsawed
* Trump vows to go to Supreme Court
* Final result might not be known for a days or weeks
* Tech stocks gain on talk a Trump win would favour sector
* Dollar rallies, 10-yr Treasury yields down sharply
* Gold retreats, oil clings to gains
* Graphic: 2020 asset performance http://tmsnrt.rs/2yaDPgn
* Graphic: World FX rates in 2020 http://tmsnrt.rs/2egbfVh
By Marc Jones and Wayne Cole
LONDON/SYDNEY, Nov 4 (Reuters) - Share markets were whipsawed, while bonds and the dollar gained on Wednesday as results from the U.S. presidential election proved far closer than polls had predicted, potentially leaving the outcome in doubt for days or weeks.
Democratic contender Joe Biden took to the air to declare he was optimistic about winning and called for all votes to be counted, no matter how long it took.
President Donald Trump responded by saying he had won, that "they" were trying to steal the election, and that he would go the U.S. Supreme Court to fight for victory if necessary.
Investors initially wagered that a possible Democratic sweep by Biden could ease political risk and provide a huge boost to fiscal stimulus.
But the mood quickly changed as Trump snatched Florida and ran much closer in other battleground states than polls predicted. equity futures went on a wild ride, rising then falling, climbing again as the voting seemed to favour Trump only to sag once more as the president vowed to make a Supreme Court challenge. .EU
The prospect of a drawn out and bitter fight ahead meant Europe's main bourses in London .FTSE , Paris .FCHI and Frankfurt .DAX fell a modest 0.1%-0.8% as they opened as investors factored in the uncertainty ahead.
"It means possibly quite a lot of volatility," said AXA Group's Chief Economist Gilles Moec in London.
"As it is not clear, markets are going to overreact to every tiny piece of news," such as any further talk from Trump or Biden about legal fights.
(For the latest results and news on U.S. election, click: https://www.reuters.com/world/us-election2020 )
Dealers said investors could be thinking a status quo result would lessen political uncertainty and remove the risk a Biden administration would roll back corporate tax cuts.
The technology sector saw reason for gains, with NASDAQ futures rising 2.4% NQc1 . E-Mini futures for the S&P 500 ESc1 dropped 1% after Trump signalled his intention to go to the Supreme Court but clawed higher again in early European dealing.
Andrew Brenner, head of international fixed income at NatAlliance Securities, said the move in techs appeared to be a play on the Senate potentially staying Republican.
Brenner said that under a Biden win tech stocks were seen faring worse, partly due to Democrats going after the sector in hearings and because a potential rise in capital gains tax would hit tech stocks harder.
Stéphane Monier, CIO at Lombard Odier said a divided Congress would have "far-reaching implications for markets, mostly because it means that any kind of pandemic recovery package is still tough to approve."
Japan's Nikkei .N225 was ahead by 1.7%, while MSCI's broadest index of Asia-Pacific shares outside Japan .MIAPJ0000PUS edged up 0.2%.
Chinese blue chips .CSI300 rose 0.7%, with markets uncertain how Sino-U.S. relations would develop from here.
Some investors hedged against the risk of a contested election or at least a drawn-out process as mail-in ballots were counted.
"It's a wait-and-see," said Matt Sherwood, head of investment strategy at Perpetual in Sydney.
"I think the odds of a clean (Democrat) sweep are diminishing, almost by the minute. That reduces the possibility, or the likelihood at least of a large stimulus programme being agreed to in the first days of a Biden administration."
That saw 10-year Treasury yields fall all the way back to 0.81% US10YT=RR , having been at a five-month top of 0.93%.
The U.S. dollar had a roller coaster session, reversing early losses to be last up 1% on a basket of currencies at 93.902 =USD . The euro fell back hard to $1.1650 EUR= and away from a top of $1.1768.
The chance of a Trump victory saw the dollar jump 2% against the Mexican peso MXN= on the assumption U.S. trade policies would continue to favour tariffs. Norway's crown NOK= , Australia's risk-sensitive dollar AUD=D3 and Britain's pound GBP=D3 all tumbled too.
Going the other way, the dollar eased nearly 1% at one point to the Russian rouble RUB= , which had been one of the hardest fallers in the run up to the election, though the move seemed to lose traction in European trading. EMRG/FRX
STILL TO COME
Investors are awaiting the outcome of U.S. Federal Reserve and Bank of England meetings this week, which are expected to at least give a nod to further stimulus.
The Reserve Bank of Australia on Tuesday cut interest rates to near zero and boosted its bond-buying programme, adding to the tidal wave of cheap money flooding the global financial system. had been buoyed by the extensive liquidity but ran into profit-taking on Wednesday, losing 0.6% to $1,896 an ounce.
Oil prices held gains made after industry data showed crude inventories in the United States dropped sharply. O/R
Dealers said a returned Republican administration would likely be more positive for the oil industry than the Democrats that favour renewable technology.
U.S. crude futures CLc1 were up 25 cents at $37.86 a barrel, with Brent crude LCOc1 futures gaining 22 cents to $39.94.
<^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Asia stock markets
https://tmsnrt.rs/2zpUAr4 Asia-Pacific valuations
https://tmsnrt.rs/2Dr2BQA Key emerging currencies being split by U.S. election
https://tmsnrt.rs/326Toa7 Global markets since Trump's election
https://tmsnrt.rs/3jNwnis World stocks market cap rise over last four years
https://tmsnrt.rs/2TL19hh U.S. stock futures whipsawed as U.S. election result looms
https://tmsnrt.rs/3kXuxgj
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^>