The third quarter is done and dusted and stocks came out of a volatile three-month period better for it. Despite big swings in oil prices, a highly-contentious election, and Federal Reserve speculation, the S&P 500 managed to squeeze out solid gains since July.

"This has been a remarkable quarter," Eric Wiegand, senior portfolio manager for The Private Client Reserve of U.S. Bank, told The Street. "It begun on the heels of a Brexit vote and concluded on heightened concerns over European banks and potential ramifications of the presidential election in the United States."

The S&P 500 closed out the third quarter with gains of 4.6%, the Dow Jones Industrial Average added 2.4%, and the Nasdaq rose 10%.

Gains over the past week weren't quite so impressive with big swings in oil and questions over the financial health of big banks fueling day-to-day choppiness. The S&P 500 closed out with weekly gains of 0.17%, the Dow rose 0.26%, and the Nasdaq climbed 0.12%.

Deutsche Bank (DB) - Get Report was one of the major drivers of the week, pulling markets into a selloff on Thursday before giving them a massive boost on Friday. The German Bank has been twisting and turning since the U.S. Justice Department proposed a $14 billion fine earlier this month over residential mortgage-backed securities.

Reports on Friday indicate that the bank had settled with the DoJ for a fraction of the original fine. A JPMorgan report indicated the penalty could be as low as $5.4 billion. Shares of the bank plummeted on Thursday on reports around 10 hedge funds had limited their exposure to the bank, another blow to the bank's liquidity.

Wells Fargo (WFC) - Get Report also dominated headlines in the past week after taking another grilling on Capitol Hill over its recent scandal. CEO CEO John Stumpf told the House Financial Services Committee that there had been no "orchestrated effort" of customer fraud. The bank has been under pressure to explain and correct a recent scandal wherein its retail-banking division created up to 2 million unauthorized customer accounts to meet sales targets. The bank has since agreed to a $185 million settlement with government officials and will discontinue all sales goals.

Late Wednesday, California State Treasurer John Chiang implemented a number of sanctions against Wells Fargo as punishment for those unethical sales practices. The year-long sanctions suspend Wells Fargo from certain activities, including underwriting state debt. The state is the largest issuer of municipal debt in the U.S.

Wells Fargo is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells WFC? Learn more now.

Crude oil ended September with a monthly gain of nearly 8%. This week's gains helped push crude to a one-month high after Organization of Petroleum Exporting Countries came to a production freeze agreement. OPEC agreed to limit oil production to 32.5 million barrels a day following a three-day energy meeting in Algeria. Members had shown reluctance to agree to any deal and cede market share.

The latest reading on oil inventories in the U.S. showed a decline for the fourth week in a row. The U.S. Energy Administration reported that domestic crude stocks fell by 1.9 million barrels in the past week. A separate reading from the American Petroleum Institute a day earlier had shown a much smaller drop. Consensus was for a build of three million barrels.

Wall Street pivoted to debate the chances of a near-term hike in interest rates again. In testimony to the House of Representatives on Wednesday, Federal Reserve Chair Janet Yellen noted that accommodative policy would need to be removed, though "probably not that much," if the economy continues to improve as expected. As usual, Yellen said there was no fixed timetable for a rate hike, though comments from the Fed last week suggested a December increase is a very real possibility.

The U.S. economy grew at a faster pace than originally expected in the second quarter, according to the final estimate of GDP growth. The economy grew 1.4% over the quarter, up from 1.1% growth previously estimated. Consumer spending, which contributes to two-thirds of the economy, increased 4.3% over the quarter.

Stocks rallied earlier in the week after Democratic presidential candidate Hillary Clinton was largely credited with a win at the first debate. Clinton and Republican presidential candidate Donald Trump and duked it out at Hofstra University in Hampstead, N.Y., on Monday night for the first of three debates before voters head to the polls on Nov. 8. The debate grew highly contentious over issues of jobs growth, national security and even birtherism but media and Twitter reaction suggested Clinton came out on top. A Clinton presidency appears to hold less uncertainty among investors than a Trump win.