HOW times change. When George Bush's treasury secretaries first visited China, Wall Street was booming, America's economy was growing and the president's emissaries routinely lectured their Chinese hosts on the need for freer financial markets and a more flexible yuan. But as Tim Geithner, the current treasury secretary, prepares to make his maiden trip to Beijing on May 31st, Wall Street is synonymous with greed and failure, America's economy is on its knees and it is the Chinese who have been doing the lecturing. With America's budget deficit soaring and the Fed's printing presses running at full speed, China is complaining loudly of the risks that inflation and depreciation pose to its huge stash of dollars, and arguing for an alternative to the greenback as the world's reserve currency.

The tables may have turned, but the dynamics on both sides of the Sino-American economic relationship are remarkably similar. The lecturing tone is driven largely by politics at home. Just as American treasury secretaries needed to shout loudly about China's currency in order to appease a potentially protectionist Congress, so Beijing officials must hector Americans about their profligacy to assuage rising domestic fury about the losses China faces on its reserve holdings. On both sides, the most egregious posturing is economically illiterate. America's bilateral trade deficit with China does not prove that Beijing manipulates its currency, as many congressmen have argued. And despite the huffing in Beijing, the losses that China faces on its reserve portfolio have more to do with its own policy choices than America's spendthrift ways.

Both China and America should use Mr Geithner's three-day visit to set a new tone in which co-operation replaces rhetoric. The two countries need to act on a broad economic agenda from global warming (real progress is impossible without co-operation between the world's two biggest carbon emitters) to funding the expansion of the International Monetary Fund (China has yet to come up with any cash and Congress has not authorised the $100 billion promised by the Obama administration). The priority, however, should be a healthier macroeconomic relationship between the world's biggest sovereign borrower and America's largest creditor. What is needed for a sustainable global recovery is well known. China must foster private-sector domestic demand with a stronger currency, among other things. And America must lay out a credible route to the eventual unwinding of its massive stimulus.

In today's febrile markets any misstep could cause the dollar to tumble and Treasury yields to soar further. So the moves must be carefully choreographed. China should be more forthright on the yuan. After a welcome appreciation alongside a stronger dollar in 2008, China's currency has fallen on a trade-weighted basis in recent weeks as the dollar has tumbled. Mr Geithner's hosts should make it clear that even if the dollar continues its slide against other currencies, the yuan will not follow suit. Instead it will gradually appreciate. To forestall any additional surge in Treasury yields, Mr Geithner should elaborate on how the Obama administration intends to cut spending and raise tax revenue in the medium term.

It will take political courage for the Chinese to eschew a weak currency and for an American treasury secretary to unveil fiscal details in Beijing. But the parlous state of the world economy demands nothing less.