Stocks ended the third quarter on an ugly note, but Bank of America sees long-term stock investments worth making. September was the worst month since March 2020 for the S & P 500 and Dow Jones Industrial Average , down 9.3% and 8.8% respectively. The Nasdaq Composite posted a greater loss at 10.5% for the month. This performance comes as market observers wonder how far the Federal Reserve will go in its fight against inflation and jittery investors sell off holdings . Treasury yields are also up, bolstering concerns of an incoming recession. But despite the bleak macroeconomic outlook that can create a risky investing landscape, Bank of America strategist Anthony Cassamassino said the pullback has created buying opportunities in the right stocks that could be smart long-term investments. Disney 's risk-reward ratio is attractive with the stock down about 38% this year, according to the bank. At the same time, the entertainment giant is expected to stay solid in a period of economic downturn because of demand for theme parks and a slate of new films. Price increases for streaming services Disney+ and Hulu, on top of a new ad-tier for Disney+ that could attract more subscribers, should benefit the company's bottom line. In all, Disney has an upside potential of roughly 35% from last close, Bank of America found. The bank indicated that Gartner is undervalued, given its free cash flow and potential for upside on sales and per-share earnings. Its focus on core technology research also gives the company staying power in a recessionary period, according to Bank of America. Mattel has not yet been "fully rewarded" for its turnaround, according to the bank. Decreasing headwinds related to freight costs are expected to give the stock a boost. Meanwhile, its new toy offerings, paired with the "Barbie" movie expected for 2023 and other media ventures, make the company likely to see 8% to 10% sales growth this year with single-digit gains also expected in following years, the bank found. The stock has an upside of 63% from Friday's close. Dexcom is also poised for a potential upside of around 30% as the glucose monitoring company reported patient volume increases that exceeded internal estimates each month in the second quarter, the bank found. The company is also expected to have its new glucose monitoring system, the G7, approved by the end of the year. – CNBC's Michael Bloom contributed reporting.