TORONTO -- Buyers returned to North American markets Tuesday after frantic selling the previous session sparked by the Greek debt crisis drove most indexes into the red for the year to date.

The S&P/TSX composite index was up a solid 87.29 points to 14,577.44 at mid-afternoon, but still poised to show a slight loss for the first six months of the year after an almost 318-point plunge on Monday. The loonie was down 0.62 of a U.S. cent at 80.08 cents.

In New York, indexes were also higher after big drops Tuesday, with the Dow Jones industrial average advancing 77.24 points to 17,673.59. But it too looked to finish the half year at a slight loss after a 350-point drop Monday that was its worst of the year.

Meanwhile, the Nasdaq bounced back 40.54 points to 4,999.01 and the S&P 500 added 11.58 points to 2,069.22, climbing back into positive territory for the year to date.

On the New York Mercantile Exchange, oil prices rose 87 cents to US$59.20 a barrel, while the August gold fell $7.40 to US$1,171.60 an ounce.

Canadian markets will be closed Wednesday for the Canada Day holiday. New York markets will remain open but close Friday in advance of the July 4th Independence Day holiday, which falls on Saturday this year.

Despite a return to stability on the markets, Greece's debt woes remained top of mind among investors as Athens's faced a midnight deadline Tuesday night to make a 1.6-billion-euro repayment to the International Monetary Fund.

But with the collapse of negotiations between Athens and its creditors, and German chancellor Angela Merkel ruling out a resumption of talks before Greece holds a referendum on the issue on Sunday, the country appeared certain to miss that payment.

If Greece defaults on its debts, it could be forced to leave the euro currency bloc and perhaps the 28-member European Union as well. Should that happen, many investors fear it would have serious knock-on effects on the euro and perhaps the world economy.

In other economic news, Statistics Canada reported that gross domestic product suffered its fourth consecutive monthly decline in April, contracting 0.1 per cent and missing the consensus expectations of economists, who forecast a 0.1 per cent gain.

"This latest growth disappointment -- along with the rumbling uncertainty surrounding Greece -- has simply cranked up the odds of another Bank of Canada rate cut at some point this year, and heaped renewed downward pressure on the Canadian dollar," Bank of Montreal chief economist Doug Porter wrote in a report.