* Q3 GDP, due after 0400 GMT, seen at 6.2 pct vs 6.4 pct in Q2
* Third quarter impacted by slowdown in trade
* Signs of Q4 improvement from Sept trade data, Oct PMI
JAKARTA, Nov 5 (Reuters) - Indonesia's economy is seen growing at its slowest pace in two years in the third quarter, as the global downturn finally catches up with a country whose resilience has made it a magnet for foreign investors this year.
Southeast Asian stock markets are among the world's best performers in 2012 and the region's biggest economy is seeing record foreign direct investment after being upgraded by rating agencies for its newfound political and economic stability.
The allure has been fading in recent months though, as weak global demand for its commodities drags down its exports, leading to trade and current account deficits that have hurt the rupiah, making the currency Asia's worst performer.
Imports also started falling in the third quarter, the first sign of weakness in the buoyant domestic demand that has been protecting the world's fourth most populous nation from a harder downturn.
``Imports of capital goods remain weak, which suggests that investment is slowing. This is negative for the growth outlook, productivity and currency,'' said Prakriti Sofat at Barclays Capital.
The trade slowdown means the G20 economy is expected to post third quarter gross domestic product growth of 6.2 percent in data due later on Monday, still strong by global standards but softer than 6.4 percent in the second quarter, according to a Reuters poll of economists.
Over two-thirds of Indonesia's exports are commodities such as palm oil and coal, which have been hurt by weaker Chinese demand. Dozens of coal ships were held up off the coast of Borneo as Chinese buyers disappeared, while thousands of workers in the sector have been laid off, industry insiders say.
Corporate profit growth has slowed, with the country's biggest listed firm Astra International posting just a 2.7 percent rise in third quarter income as its coal, palm and heavy equipment businesses suffered from the commodities downturn.
New government rules curbing raw mineral exports also hurt shipments of metal ores such as nickel and bauxite, while the mining sector has also been rattled by disputes between local and foreign investors, rising wage costs and community protests.
Still, investment does not seem to have been significantly affected so far, with foreign direct investment rising 22 percent to a record $5.9 billion in the quarter, as firms eye the natural resource wealth and a growing consumer market.
Indicators for domestic demand, which makes up around 55 percent of the economy, mostly remain strong. Consumer confidence rose in September because of optimism on jobs and pay and malls are setting up impromptu showrooms for luxury cars and apartments.
The central bank has sought to spur this domestic consumption with record low interest rates that most economists expect to be maintained well into 2013.
There are signs the economy could pick up again this quarter as manufacturing levels and new export orders increased in October, according to the HSBC purchasing managers index, part of a tentative recovery seen across much of Asia. But worries over trade imbalances are likely to keep the pressure on the rupiah, already down nearly 6 percent this year.
``It is far too early to suggest that Indonesia is out of the woods as far as its external position is concerned,'' said Robert Prior-Wandesforde, economist at Credit Suisse.