This past year was a roller coaster for the markets; there were many unexpected events that caused markets to jump up and down, but the overall result was a relatively flat year.

Nobody would have expected a Brexit or a Donald Trump victory this year, but those things happened. Many pundits believed that a market crash would result from either or both events, but this clearly didn’t happen, and the contrary was true for the latter event.

Timing the market is a loser’s game, and if you’re a Foolish investor, then you’ve got to focus on finding value in the markets should an event cause a sell-off. These are buying opportunities, and you should capitalize on them if they present themselves.

Many investors missed out on the Trump rally because they were very fearful of what the implications of a Trump victory were. Nobody saw the rally coming, and it looks like the rally is going to continue for the last month leading up to the Santa Clause rally.

You can ride this rally by picking up these two fantastic TSX stocks that have gone out of favour in recent months.

Canadian Tire Corporation Limited (TSX:CTC.A)

This is one of Canada’s best retail brands, and it’s cheap right now. The company has an impressive history of growing earnings as well as its dividend over the past decade.

The company recently reported a strong quarter, which saw retail sales jump by 3.4%; the company responded by raising the dividend by 13%. I believe this quarter could be the start of a sustained rally to higher levels.

The stock currently trades at a very modest 16.1 price-to-earnings with a 1.83% dividend yield. Given the terrific earnings predictability over the long term, and the history of dividend hikes, I believe the stock is a terrific pick up right now before the holiday season arrives.

Loblaw Companies Limited (TSX:L)

Loblaw is Canada’s largest grocery retailer and the owner of the fantastic pharmacy chain Shoppers Drug Mart. The stock has pulled back in the last few months, and I believe opportunistic investors would benefit greatly from picking up shares of this beaten-up, forever business right now.

Loblaw reported a very strong Q2 quarter; it reported same-store sales growth of 4% in its Shoppers Drug Mart business, which is growing very fast.

Shoppers Drug Mart is interested in dispensing medical marijuana in its store once it becomes legalized. This move will give a gigantic boost to the company’s top and bottom line, and I believe it will be the biggest distributor of marijuana when the drug inevitably becomes legalized.

The stock trades at a 0.6 price-to-sales and a 2.2 price-to-book, which is quite cheap considering the growth potential of Shoppers Drug Mart and its impressive network of grocery stores, which I believe acts as a moat to entrants who want a piece of the Canadian grocery market.

If you’re a follower of the principals of Warren Buffett, then pick up shares of one or both of these companies, as they’re out of favour right now and could deliver huge upside with a nice margin of safety.

Stock buy alert hits astounding 96% success rate!

The hand-picked investing team inside Stock Advisor Canada recently issued a buy alert for one special type of "bread-and-butter" stock where The Motley Fool U.S. has banked profits on 23 out of 24 recommendations. Frankly, with an astounding 96% success rate that has delivered average returns of 260%, chances are this new pick could deliver life-changing returns as well. Because the team at Stock Advisor Canada fully embraces the same time-tested investing philosophies that have led to countless Motley Fool winners globally. So simply click here to unlock the full details behind this new recommendation and join Stock Advisor Canada.

*96% accuracy includes restaurant stock recommendations from Motley Fool U.S. services Stock Advisor, Rule Breakers, Hidden Gems, Income Investor and Inside Value since each services inception. Returns as of 5/27/16.

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Joey Frenette has no position in any stocks mentioned.