Friday the 13th will be remembered for good tidings rather than bad luck. The sustained stock market rally broke through the 23,000-point barrier for the first time, and a ratings agency raised Hong Kong's sovereign debt rating to an unprecedented AA. It may be argued that the 23,000 barrier is a number of no special importance and that the rating upgrade means little because Hong Kong is not a borrower. But psychologically the two events are significant, given that at this time four years ago Hong Kong was in deep trouble. A prolonged economic downturn had been exacerbated by Sars, the property market had collapsed, and half a million marched on the anniversary of Hong Kong's return to China on July 1 in a protest against proposed national security legislation that embraced discontent with the government's performance and calls for democratic reform. A government deeply concerned over the deteriorating budget position scorned populism with tough decisions to reduce the public deficit. The Hong Kong dollar came under attack during the Asian financial crisis in 1997, and the government - fearing a repeat if it failed to show resolve in tackling this economic crisis - cut civil service salaries and raised profits and salaries taxes. Who would have thought that just four years later the government would be awash with money from record stamp duties on stock-market transactions and that the fiscal surplus for 2006-07 would exceed HK$58 billion? The AA rating may be a touch academic, but it still leaves a recognised imprint of quality on the city's finances. Today's government will benefit from the political credit. But it is time to remember that credit is due also to former chief executive Tung Chee-hwa and former financial secretary Antony Leung Kam-chung, along with Hong Kong Monetary Authority chief Joseph Yam Chi-kwong, for their part in taking decisions that were unpopular at the time but laid the foundations for a quick turnaround in the city's fortunes. The central government played its part, too, by allowing more mainlanders to visit here to boost the tourism and retail sectors. So much for superstitions about Black Friday - except that we would be foolish to ignore portents in the external environment that things could easily change quickly for the worse. With the price of oil having risen 45 per cent since January to hit US$70 a barrel, inflation rising and long-term interest rates up and widening credit spreads that reflect nervousness over the meltdown in the US sub-prime mortgage market, optimism and fear are finely balanced. It would not take much for investors to develop a sudden aversion to risk. A retreat from assets perceived as relatively risky would not spare our stock market. Many factors could conspire to lead to a massive correction. The city has prospered from the booming mainland economy, but the mainland stock-market bubble could burst with serious implications for Hong Kong. Investors must be alert for the danger signals. We could easily see a repeat of what happened with the sharp market correction in February-March, except that it could be more severe. While economic recovery maintains its momentum, public finances are buoyant and unemployment is now below 4 per cent, economic restructuring must be an ongoing priority if Hong Kong is to meet the challenges of a global, knowledge-based economy and ride out cyclical troughs. Much remains to be done to ensure our future competitiveness.