The major equity indexes closed out the trading day on Tuesday in positive territory, with the Dow Jones Industrial Average posting its fourth consecutive session of gains after Federal Reserve Chairman Jerome Powell expressed an optimistic outlook for the economy and solid earnings bolstered the outlook for a robust reporting period.

In written statement Powell signaled that an era of stable economic growth may continue, but the Fed chairman was challenged in a congressional hearing by senators worried about the Trump administration’s trade policies.

The Treasury yield curve hit its flattest in over a decade as Powell’s upbeat economic view supported more rate hikes, with 2-year yields climbed to their highest in nearly a decade.

The consensus on the Street currently is for second-quarter S&P 500 earnings growth of 21.2 percent, up from 20.7 percent on July 1. Of the 39 companies in the index that have reported so far, 84.6 percent have come in ahead of Street expectations, according to Thomson Reuters data.

Earnings optimism gained strength from a report from the Federal Reserve showing an increase in industrial production led by a rebound in manufacturing.

The Nasdaq’s advance was led by Facebook, Alphabet and Amazon, all of which hit record highs.

Of the 11 major sectors of the S&P 500, seven ended the session in positive territory, with materials and technology taking the lead.

Johnson & Johnson led the healthcare sector’s 0.5 percent advance, rising 3.5 percent after exceeding earnings and revenue estimates.

Shares of Goldman Sachs fell 0.2 percent even though the investment bank reported better-than-expected earnings and said David Solomon would replace outgoing CEO Lloyd Blankfein.

UnitedHealth Group weighed on the Dow, its shares down 2.6 percent as the largest domestic health insurer reported higher-than-expected quarterly medical costs.

Netflix gained ground, rising 5.2 percent after falling more than 14 percent following the streaming services company’s reported shortfall in second-quarter subscriber additions.

Approximately 6.00 billion shares changed hands on the major domestic equity exchanges, as compared to the 6.54 billion share average over the past 20 trading days.

Industrial Production Rises

Industrial production rose during June, helped by a sharp rebound in manufacturing and further gains in mining output, the latest sign of robust economic growth in the second quarter.

However, the outlook for the industrial sector is uncertain against the backdrop of escalating trade tensions between the United States and its major trade partners, which threaten to disrupt global trade. A strong dollar and shortage of workers also pose a risk to production, with factory surveys suggesting some strain in the supply chain.

The Federal Reserve said on Tuesday industrial production rose 0.6 percent last month after falling 0.5 percent in May. It accelerated at a 6.0 percent annualized rate in the second quarter after a 2.4 percent growth pace in the first quarter.

Manufacturing output surged 0.8 percent in June after decreasing 1.0 percent in May. A 7.8 percent jump in motor vehicle production buoyed manufacturing output last month. Motor vehicle production declined 8.6 percent in May after a fire at a parts supplier caused a sharp drop in the assembly of trucks.

Excluding motor vehicles, manufacturing production rose 0.3 percent in June. Manufacturing, which accounts for about 12 percent of the economy, is being supported by a strong domestic and global economy.

Strong industrial production and retail sales, together with smaller trade deficits in April and June suggest economic growth accelerated sharply in the second quarter.

Gross domestic product estimates for the April-June quarter are as high as a 5.3 percent rate, more than double the first quarter’s 2 percent pace.

Fed Chairman Jerome Powell struck an upbeat note on the economy when he appeared before lawmakers on Tuesday, saying it was on the cusp of “several years” of strong jobs and low inflation.

Powell, however, said “it is difficult to predict the ultimate outcome of current discussions over trade policy.”

The International Monetary Fund warned on Monday that tit-for-tat import tariffs threatened to derail the global economic recovery, adding that the U.S. was especially vulnerable to a slowdown in its exports.

The Trump’s administration’s protectionist trade policy and retaliation by other countries will likely undercut business spending. The tariffs are also seen raising prices for consumers, which could slow domestic demand.

Manufacturing output increased at a 1.9 percent rate in the second quarter after growing at a 1.7 percent pace in first quarter. In June, there was an increase in the production of wood, computer and electronic products as well as aerospace and miscellaneous transportation equipment.

Mining production increased 1.2 percent, adding to the 2.2 percent rise in May. Mining output is now at a record high.

Oil and gas well drilling rose 2.9 percent in June, with further gains likely following recent increases in oil prices. Mining output accelerated at a 19.4 percent rate in the second quarter after notching a 11.0 percent pace in the first quarter.

Utilities output fell 1.5 percent in June, despite a heat-wave which engulfed parts of the country, after declining 0.7 percent in May.

With production increasing solidly last month, capacity utilization, a measure of how fully firms are using their resources, increased to 78.0 percent from 77.7 percent in May. It is 1.8 percentage points below its 1972-to-2017 average.

Officials at the Fed tend to look at capacity use measures for signals of how much “slack” remains in the economy — how far growth has room to run before it becomes inflationary.

Powell Upbeat

Federal Reserve Chairman Jerome Powell said on Tuesday he sees the United States on track for years more of steady growth. However, he was challenged in a congressional hearing by senators worried the Trump administration’s trade policies were already damaging businesses in their districts.

Powell in written testimony to the Senate Banking Committee and in his response to questions about a possible “trade war” largely discounted the risks and said there would be a positive outcome if the administration’s bargaining ultimately produced a world of lower tariffs.

North Dakota Democrat Heidi Heitkamp said she was becoming frustrated with the idea of “short-term pain for long-term gain,” noting that the energy sector in her state already had been hit by higher steel prices because of import tariffs and farmers were worried about permanently losing market share because of retaliatory levies imposed on their goods.

While Powell steered clear of direct criticism of President Donald Trump’s tariffs on goods, particularly from China but also from U.S. allies in Europe and elsewhere, he acknowledged that tariffs were “absolutely” the wrong approach and said the United States “would feel it at the national level” if levies remained in place for too long.

The Fed’s regional bank presidents have increasingly cited local business concerns about the administration’s trade tactics, with higher input costs and uncertainty over the future offsetting the recent corporate tax cut and pushing firms to reconsider or delay investment plans.

The back and forth over trade was a chief point of friction in a Fed appearance that also saw Democrats challenge recent Fed decisions that seem to take a lighter hand in the oversight of major banks, while, in contrast, one Republican said the current positive economy and Powell’s presence at the Fed had made the central bank “boring” to oversee.

For Powell, his testimony marked one of the strongest affirmations yet by a Fed leader that the central bank is within reach of its policy targets after years of struggling to pull the country back from a deep financial crisis and recession.

“With appropriate monetary policy, the job market will remain strong and inflation will stay near 2 percent over the next several years,” Powell said in prepared remarks.

The Fed “believes that – for now – the best way forward is to keep gradually raising the federal funds rate” in a way that keeps pace with a strengthening economy but does not increase rates so high or so fast that it weakens growth, Powell said.

Powell did not offer his individual views on the appropriate pace of tightening or whether he thinks, as some of his colleagues have argued, that the Fed should pause its rate hike cycle sometime next year if inflation remains under control. But markets expect the central bank to raise rates two more times this year from the current target level of between 1.75 and 2 percent.

Powell will appear before a House committee on Wednesday.

With unemployment at 4 percent, Fed officials broadly feel they have met their mandate for “maximum employment.” To the extent wages are not growing as fast as might be expected, Powell said continued low unemployment could help, but urged lawmakers to think about longer-term policies such as improved education that will ultimately drive outcomes for workers.

While he and other Fed officials have declined to declare a full “victory” over the Fed’s other mandate of 2 percent inflation, Powell said that marker was “close.”

The Fed’s preferred measure of inflation hit 2.3 percent in May and was right at 2 percent after excluding more volatile food and energy prices.

“The recent data are encouraging,” Powell said as he laid out the reasons why he felt the United States’ near decade-long expansion was set to continue.