Solid earnings and evidence of a soft economic landing sent the market higher this week:

Dow +3.2%
Nasdaq +3.7%
S&P 500 +3.1%
S&P Midcap 400 +3.9%
S&P Smallcap 600 +3.7%

Monday kicked off the good week with positive merger and acquisition news, led by HCA's (HCA) announcement that it would use a leveraged buyout to go private. At $33 billion including debt, it marked the largest such deal in history.

Then, Advanced Micro Devices (AMD) bid to acquire ATI Technologies (ATYT) for $5.4 billion, 24% higher than the market cap.

After a few months of sinking stock prices, investors concluded that slower earnings were already priced into stocks, and that the M&A activity proved balance sheets are strong.

From the depressed tech sector came a Citigroup upgrade for Dell (DELL), lifting it 4.2%. When Merck (MRK) reported that Q2 profits had doubled and then raised its full-year earnings outlook, all the ingredients were in place for bargain hunting. The Dow rose 1.7%, the Nasdaq 2.1%.

Tuesday morning found investors bracing themselves. Would the market's recent see-saw action continue with a sell-off following Monday's rise? Bulls were looking for a follow-through, bears for a breakdown. The bulls won.

Altria Group (MO) raised full-year guidance. AT&T (T) posted 81% year-over-year earnings growth. DuPont (DD) reaffirmed guidance. McDonald's (MCD) reported 56% earnings growth. 3M (MMM) disappointed by coming in below already-lowered forecasts and providing cautious guidance.

3M was joined in the doubter's circle by United Parcel Service (UPS), which missed estimates for the first time since 2002, said it sees signs of a slowing economy, and pointed to high fuel costs as the reason for its miss. It also lowered expectations for full-year earnings growth.

That was no good and the market looked tepid until two things happened. First, UPS received an analyst upgrade and then oil prices dropped 1.7% to under $74. The market ended modestly higher with the Dow up 0.5% and the Nasdaq up 0.6%.

Wednesday brought some modest profit-taking, but nothing that could be called a sell-off. The Fed's Beige Book showed half of its 12 districts reporting that the pace of economic growth has slowed, supporting the argument for a pause in rate hikes on Aug. 8. By the end of the day, Fed funds futures’ odds of an August rate hike had slipped from 51% to 43%.

The earnings picture was mixed. Amazon.com (AMZN) disappointed and fell 22%. Boeing (BA) reported a loss for the first time since 2003, and reduced guidance. Norfolk Southern (NSC) missed estimates and blamed high fuel costs. On the plus side of high fuel costs, ConocoPhillips (COP) reported a 65% year-over-year profit surge.

The day closed with the Dow flat and the Nasdaq down 0.2%.

Thursday wasn't much more exciting. Odd, considering that it was the biggest earnings reporting day ever.

ConocoPhillips' oil buddy ExxonMobil (XOM) popped the champagne over its second-biggest quarterly profit ever. Dow Chemical, however, missed and lowered guidance. The tech sector as a whole didn't fare well. At a meeting with analysts, Microsoft (MSFT) co-president Kevin Johnson mentioned that Vista will ship when it's ready, hardly what the nervous crowd wanted to hear. A date would have been nice. Then Tellabs (TLAB) missed and fell 16%.

The day's economic reports weren't so hot. June durable goods went up 3.1%, which shows potential inflationary pressure and the need to bump rates up one more time. Jobless claims came in at 298,000, the first time they've been below 300,000 since February. The downward trend shows an improving labor market, which can also contribute to inflation.

However, new home sales in June fell 3% from a month ago and 11% from a year ago. That augurs a pause in interest rates.

The Dow ended flat again, but the Nasdaq slipped 0.8%.

Friday brought the gross domestic product report. At 8:30 a.m., the Commerce Dept. reported a Q2 GDP of just 2.5%, well below Q1's 5.6% and expectations for 3.2%.  The deflator came in steady at 3.3%, the same as Q1 and a tad lower than expectations of 3.5%.

This was a party starter.

It looked precisely like the Fed's desired soft landing scenario. Investors concluded that the end of rate tightening is at hand. Fed futures put the chances of an August increase at just 27%.

However, the consumer price component jumped to an annualized 2.9% from 2.1% in Q1. That's a sign of inflation, and the one most felt by folks on the street.

To heck with that, though. Earnings have been decent, stock prices have come way down since April, and now there's reason to believe rate increases are winding down. It was time to buy stocks.

Technology fared particularly well because the threat of an overaggressive Fed was one of the sector's weighing points. Applied Materials (AMAT) gained 3.3%, Dell 3.1%, eBay (EBAY) 3.1%, Intel (INTC) 4.1%, and Yahoo (YHOO) 2.9%.

Energy didn't skip a beat. Chevron (CVX) reported its largest quarterly profit ever, and it's been around for 127 years.

Earnings have come in better than I expected, and the guidance is positive, too. If the economy can slow just modestly while earnings continue to be healthy, we'll have a swell formula for the year-end rally I've been forecasting.

Prior to that, however, I still think we're going to see lower prices. We're not out of the slow stock season yet. We're not sure about interest rates yet. We're not finished with the war in the oil-sensitive Middle East. We're not out of hurricane season.

August has been the S&P 500's worst month since 1987. In mid-term election years like this one, the Dow has averaged a monthly loss of 1.5%, the S&P 500 0.9%, and the Nasdaq 2.8%. In 1998, the Nasdaq lost almost 20% in August alone.

Keep your shopping list handy. We'll probably see a sale before the surge.