One day after a government report showed that the U.S. economy had shrunk for a second consecutive quarter -- an indicator the country may indeed be in a recession -- the Nasdaq Composite is up 228 points, or about 1.9% in mid-afternoon trading on Friday. Those gains put the index up by about 10.6% for the month. If the market holds onto that rise, July will go in the books as the best month for the tech-heavy index since late 2020.

Leading Friday's move higher were tech giants Amazon (AMZN -1.65%), up 12%, and Apple (AAPL 0.52%), up 3.7% after their quarterly reports -- delivered before the market opened -- beat expectations. A host of smaller tech companies' shares are up as well, including Five9  (FIVN -0.60%), which also rose 12% after reporting its own earnings. 

Most of the clean energy stocks in the Nasdaq are also racing higher. The group includes SolarEdge Technologies (SEDG -2.16%) and Sunrun (RUN -3.09%), with shares up around 6% as of this writing. Those gains came after Thursday's news that the U.S. Senate is moving forward with a spending bill that would provide significant funding and incentives to the renewable energy industry. 

Amazon, Apple buck supply chain and macro pressures

While Amazon reported a GAAP loss for the second quarter in part due to rising costs in its e-commerce business, its shares surged due to its generally positive results and forward guidance. Revenue was up 10% (adjusted for foreign currency changes), and a significant portion of its losses were tied to the drop in value of electric vehicle maker Rivian, in which Amazon owns a large stake. Investors are rewarding Amazon because of what's working well for it -- namely, advertising and its Amazon Web Services (AWS) cloud infrastructure unit. Ad sales were up 10%, while AWS revenue was up 33% and operating income rose by 36%. The company guided for revenue growth in the 13% to 17% range in the third quarter. 

Apple also shook off investor concerns, beating expectations with modest revenue growth and reporting iPhone sales that outpaced the rest of the smartphone market, which seems to be cooling off. This is especially important for Apple. Not only is the iPhone its most important and profitable product, but it's also central to how most people access the tech giant's services ecosystem. Apple's services segment grew revenues by 12%; a significant portion of those $19.6 billion in quarterly revenues came from iPhone users. 

Tech earnings have investors growing more optimistic

Five9 investors have had a tough go of it, especially since its failed merger with Zoom Video Communications last year. But the earnings report it delivered Thursday is helping reverse that downbeat sentiment. The company reported 32% revenue growth to a record $189.4 million. In particular, its enterprise business looks great, with 41% growth in subscription revenue. Its gross margins on a GAAP and adjusted basis fell modestly to 53% and 61%, respectively, but those results were in line with expectations. Based on the accelerating momentum of its business, management raised guidance for the year for both sales and operating results. 

Like many other high-growth cloud and software-as-a-service companies, Five9 is still operating at a loss, and it generated negative operating cash flow in the quarter (though it has been operating-cash-positive in prior periods). Investors will want to keep monitoring its growth, and should also look for improved cash flow metrics. That's particularly true in today's interest rate environment, where capital access is growing more limited and borrowing is becoming more expensive. 

Clean energy stocks surge on climate bill deal

Many of the Nasdaq's clean energy stocks also moved higher Friday on Thursday's news that congressional Democrats appear to have crafted a compromise bill that can win passage in the Senate and would provide $369 billion to support technologies to combat climate change. Much of that funding would go toward various incentives that favor clean energy tech companies. These include SolarEdge, which makes power management electronics used in residential and commercial solar power systems, and Sunrun, one of the largest installers of solar power systems in the U.S. 

While government incentives will always be helpful to these companies, they're not thesis-changing or thesis-building. SolarEdge and Sunrun, for example, have grown to become significant players in their respective segments by focusing on providing high-quality products and services at competitive prices. While federal incentives can sweeten the pot, their competitors will have access to the same programs. At the end of the day, it will be the clean energy industry scaling up and global competition increasing that do the most to keep reducing the costs of wind and solar power and energy storage -- not federal subsidies or tax incentives.