THOSE in search of a thriving stockmarket, a stable currency and low inflation would not normally pitch up in Pakistan. It is more readily thought of as a pit of instability than as a source of opportunity. Yet Pakistan is enjoying a rare period of optimism about its economy. The IMF reckons that the economy will grow by 4.7% next year, the fastest rate in eight years. Consumer prices rose by 2.5% in the year to March, the smallest increase for more than a decade. Twice already this year the central bank has lowered its benchmark interest rate. Some indicators are pointing to an upturn in spending. Compared with a year earlier, cement sales, which are a guide to how much construction is taking place, rose by 5.5% from July to March. Car sales rose by 22% over the same period.

A fall of two-fifths in the oil price is a huge slice of luck for a country such as Pakistan. It relies on imported fuel oil for two-fifths of its power supply and is prone to periodic balance-of-payments crises (see chart). The country’s import bill can easily overwhelm the foreign-exchange earnings from textile exports and the remittances that Pakistanis working in the Middle East and Europe send home. In 2013-14 Pakistan’s net import bill for oil came to $12.6 billion, or around 5% of GDP. But if oil prices stay low, Pakistan could save a total of $12 billion in the next three years, says the IMF. The money could be spent on things with more local content and give the economy a lift.

The government of Nawaz Sharif takes some credit for the economy’s new stability. It has stuck to an IMF programme agreed to in 2013, a few months after it came to power in Pakistan’s first-ever handover from one civilian government to another. Foreign-exchange reserves have more than doubled, to $17.7 billion. Electricity tariffs have been raised, and some unpaid bills collected, easing the cash burden on hard-pressed distribution companies. Tax receipts have risen, albeit from pitiful levels, in response to efforts to broaden the base and cut exemptions. The revenue agency has sent over 150,000 tax notices to non-payers. More retailers are being drawn into the indirect-tax net. A draft budget aims to bring the budget deficit below 4% of GDP in 2015-16, from a peak of over 8%.

A privatisation drive that stalled last June resumed in April, when the government sold its stake in Habib Bank, the country’s largest lender, for $1 billion. Three-quarters of bids came from foreign investors. Pakistan’s stockmarket has doubled in dollar terms since the start of 2012, thanks in large part to such foreign interest. Privatisations will only add to the market’s variety and appeal. Listed companies are highly profitable, although in part because they often face too little competition.

Visitors to Pakistan are surprised to discover good roads and a strong business culture. The country is mid-table in the World Bank’s ease-of-doing-business rankings, well above India. The infrastructure is solid enough to support big fast-food chains: McDonald’s, KFC, Pizza Hut and Subway have 187 outlets between them, more than in all of Sub-Saharan Africa’s “frontier” economies combined, says Daniel Salter, of Renaissance Capital, a stockbrokers.

The progress in providing economic stability is encouraging. But Pakistan needs sustained growth of 5-7% a year if it is markedly to cut poverty—at the last count, nearly a quarter of Pakistanis were below the poverty line. There are doubts to whether Mr Sharif has the strength and authority to implement deeper reforms. Despite a better electricity industry, power shortages remain a bugbear. Big firms in textiles, which account for over half of Pakistan’s exports, have long taken to generating their own electricity.

Security is a less tractable problem. A textiles executive says that buyers need to look at and feel the products for themselves before they buy. Yet the representatives of big European retailers are often too scared to come to Pakistan. Fear may fade over time. Optimists point to a sharp decline in recent years in the number of deaths from terrorist attacks—despite frequent grim headline news, such as a school massacre in Peshawar in December. Now the army is stepping up operations in regions bordering Afghanistan that harbour the Pakistani Taliban and other militants. “If we had more security,” says another businessman, “we could double or triple our orders”.