Stock drops around the world "triggered a contrarian 'buy' signal," Merrill says.

A funny thing happened in global financial markets last week, which could be a warning for future volatility. Stock markets in China and Europe tanked, spilling over into the U.S. and other markets despite the fact that weekly inflows into equity markets had reached their highest level for the year.

Altogether $25 billion flowed into global stock markets for the week ended July 8, led by China’s stock market, which captured $13 billion, primarily in domestic A-shares ETFs, according to Bank of America Merrill Lynch’s weekly fund flow report.

U.S. stock markets followed with inflows of $10.7 billion, up 0.3% from the previous week, then Japan with inflows of $2.3 billion, up 0.8%. Europe lagged but still had positive flows, up $1.4 billion, or 0.1%, despite the Greek vote opposing additional austerity measures that were required for an extended bailout fund from the European Central Bank, International Monetary Fund and European Commission. Two billion dollars left global bond markets, capping five weeks of redemptions totalling $28 billion, the largest outflow in two years.

Despite inflows into global stock markets, major indexes fell, pushing almost all global equity markets below their 200-day and 50-day moving averages. Those declines “triggered a contrarian ‘buy’ signal,” according to the report, which historically lead to a rally that averages 6.5% in the three months that follow, the report noted.

The rebound appears to have already started. China’s Shanghai and Shenzhen stock indexes are up between 12% and 13% since July 8. The iShares European index (IEV) has gained 6%, the Dow Jones industrial average is up about 2.5%, and the Nikkei 1.8%. Whether the rebound will continue will depend on what happens next in China and Greece.

China’s stock markets finally recovered last week after a series of moves by the Chinese government to limit volatility in the domestic stock market, including restrictions on new IPOs and on margin lending to finance stock purchases, pledges of additional liquidity for the state-backed China Securities Finance Corp. and a push for major shareholders and top executives to buy back company shares. Initially the intervention failed to slow the slide, so the Chinese government took additional steps.

The Chinese government is “quite interventionist still,” says Garrett Roche, investment strategist at Bank of America Merrill Lynch. The government is concerned about slowing economic growth and the impact on consumption, but the reality is only 5% of corporate fundraising comes from the stock market, says Roche. Still, he notes, that even though China’s economy is only 16% of global GDP, it accounts for two-thirds of global GDP growth which is “why it’s so important to keep an eye on China.”

In Greece, all eyes now are on the country’s parliament, which is required to approve the bailout agreement reached this weekend among Greece’s creditors and endorsed by Greek Prime Minister Alexis Tsipras, who initially opposed a new deal with austerity measures and orchestrated a public referendum on it. The parliaments of various eurozone nations, including Germany, also have to vote on the deal.

Under the agreement, Greece could receive as much as 86 billion euros ($95 billion) in aid over three years and remain in the eurozone if it meets a tight timetable to enact budget cuts, pension reforms, a value-added tax, bankruptcy rules and an EU banking law that could lead to losses for some big depositors.

“The agreement was laborious, but it has been concluded,” said European Commission President Jean-Claude Juncker. “There is no Grexit.”

— Related on ThinkAdvisor: