US Equities Post Best Monthly Performance Since 1987 – Can This Continue?

May 4, 2020

[fusion_builder_container hundred_percent=”no” equal_height_columns=”no” menu_anchor=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=”” background_color=”” background_image=”” background_position=”center center” background_repeat=”no-repeat” fade=”no” background_parallax=”none” parallax_speed=”0.3″ video_mp4=”” video_webm=”” video_ogv=”” video_url=”” video_aspect_ratio=”16:9″ video_loop=”yes” video_mute=”yes” overlay_color=”” video_preview_image=”” border_size=”” border_color=”” border_style=”solid” padding_top=”” padding_bottom=”” padding_left=”” padding_right=””][fusion_builder_row][fusion_builder_column type=”1_6″ spacing=”” center_content=”no” link=”” target=”_self” min_height=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=”” hover_type=”none” border_size=”0″ border_color=”” border_style=”solid” border_position=”all” border_radius=”” box_shadow=”no” dimension_box_shadow=”” box_shadow_blur=”0″ box_shadow_spread=”0″ box_shadow_color=”” box_shadow_style=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”” margin_bottom=”” background_type=”single” gradient_start_color=”” gradient_end_color=”” gradient_start_position=”0″ gradient_end_position=”100″ gradient_type=”linear” radial_direction=”center” linear_angle=”180″ background_color=”” background_image=”” background_image_id=”” background_position=”left top” background_repeat=”no-repeat” background_blend_mode=”none” animation_type=”” animation_direction=”left” animation_speed=”0.3″ animation_offset=”” filter_type=”regular” filter_hue=”0″ filter_saturation=”100″ filter_brightness=”100″ filter_contrast=”100″ filter_invert=”0″ filter_sepia=”0″ filter_opacity=”100″ filter_blur=”0″ filter_hue_hover=”0″ filter_saturation_hover=”100″ filter_brightness_hover=”100″ filter_contrast_hover=”100″ filter_invert_hover=”0″ filter_sepia_hover=”0″ filter_opacity_hover=”100″ filter_blur_hover=”0″ last=”no”][/fusion_builder_column][fusion_builder_column type=”2_3″ layout=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” border_position=”all” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” center_content=”no” last=”no” min_height=”” hover_type=”none” link=””][fusion_text]

U.S. Markets:

U.S. stocks ended the week mixed as investors weighed some hopeful developments in the battle against the coronavirus pandemic against poor economic news and a possible resumption of the U.S.-China trade war.  Small and mid-cap stocks outperformed for the week, as the major indexes rounded out their best monthly performance since 1987.

The Dow Jones Industrial Average declined -0.2% and closed at 23,724 while the technology-heavy NASDAQ Composite retreated -0.3%.

By market cap, the large cap S&P 500 ticked down -0.2%, while the S&P 400 midcap index and Russell 2000 small cap indexes gained 2.6% and 2.2%, respectively.

International Markets:

Most major international markets rebounded from last week’s declines with almost all finishing this week in the green.  Canada’s TSX rose for a sixth consecutive week, finishing up 1.4%.  The United Kingdom’s FTSE added 0.2%.

Markets were strong on Europe’s mainland.  France’s CAC 40 rallied 4.1% and Germany’s DAX gained 5.1%.

In Asia, China’s Shanghai Composite rose 1.8%, while Japan’s Nikkei gained 1.9%.  As grouped by Morgan Stanley Capital International, developed markets rose 0.2% while emerging markets were off -0.7%.

Commodities:

Precious metals finished the week in the red.  Gold declined 2.0% to finish the week at $1700.90 an ounce, while Silver gave up -2.1% finishing the week at $14.94 per ounce.

Oil managed to rebound from last week’s plunge.  West Texas Intermediate crude oil rallied 16.8% to finish the week at $19.78 per barrel.

The industrial metal Copper, viewed by some analysts as a barometer of global economic health due to its wide variety of uses, finished the week down -1.1%.

U.S. Economy:

The number of Americans claiming first time unemployment benefits fell by 603,000 last week to 3.839 million.  Economists had expected a reading of 3.5 million.  The reading was the fourth decline in a row as the initial wave of layoffs appears to have receded somewhat, but the level is still extreme and some states are still struggling to process all their applications.

Continuing claims increased by 2.174 million to a new record of 17.992 million.  That number corresponds to a 12.4% insured jobless rate—also a record.  Based on the number of jobless claims over the past four weeks, the unemployment rate will approach 17.0% for April.

The National Association of Realtors (NAR) reported the number of homes in which a contract has been signed, but not yet closed, plunged -20.8% in March.  The reading was worse than the consensus forecast of a -13.5% decline.  It was the biggest decline since May of 2010, and the second most on record.

All four regions of the U.S. posted double-digit declines in contract signings.  The West suffered the largest decline, down -26.8%, while in the Northeast, contract signings decreased by -14.5%.  Analysts look at pending home sales as an indicator for the existing-home sales reports in the coming months.

The confidence of America’s consumers experienced the biggest drop on record last month, but respondents were also starting to think the worst might be over.  The Conference Board’s Consumer Confidence Index plunged a record 31.9 points last month to 86.9—its lowest level since June 2014.  The reading was worse than economists’ forecasts of 90.0.  However, while Americans were very pessimistic about the condition of the country at the current time they were more hopeful that the economy would begin to recover in the near future.

The gauge that measures how Americans feel about the next six months, called the “future expectations index”, actually improved 7 points to 93.8.  Lynn Franco, director of economic indicators at the Board stated, “Consumers’ short-term expectations for the economy and labor market improved, likely prompted by the possibility that stay-at-home restrictions will loosen soon, along with a re-opening of the economy.”

The collapse in the U.S. economy caused by the coronavirus pandemic triggered the biggest drop in GDP since 2008.  The Bureau of Economic Analysis reported the economy shrank at a -4.8% annual rate in the first quarter as stay-at-home orders were issued across the country to curb the spread of COVID-19.  Economists had expected just a -3.9% decrease.  Furthermore, economists estimate the economy is likely to contract by 25% or more in the second quarter, with some forecasts putting the decline at a record 40%.  Prior to the crisis, the U.S. had been expanding at a steady 2% pace during what had become the longest expansion in history at 11 years.  The contraction in activity in the first quarter was broad-based and deep.  There were steep declines in consumer spending, capital expenditures, inventory investment, and exports.

The Federal Reserve wrapped up its two-day meeting stating the Fed will do all it can to help the economy still facing considerable risk.  The Federal Reserve committed itself to using its full range of tools it has available.  “The ongoing public health crisis will weigh heavily on economic activity, employment and inflation in the near term, and poses considerable risks to the economic outlook over the medium term,” the Fed said in a statement.  The Fed kept its benchmark rate near zero and repeated it would hold policy steady until the economy has weathered recent events and “is on track” to achieve full employment and price stability.

A pair of manufacturing indexes both showed sharp contraction in factory activity in April.  The Institute for Supply Management (ISM) reported its Manufacturing Index dropped 7.6 points in April to 41.5—its lowest level in 11 years.  Few industries were spared as 15 of the 18 industries tracked declined—the worst breadth since April of 2009.  ISM reported respondents’ comments about the near-term outlook were “strongly negative”.

Nearly all ISM components fell sharply, and in some cases reaching lower levels than during the Great Recession of 2008.  Similarly, Markit reported its Manufacturing Purchasing Managers’ Index (PMI) sank a record 12.5 points to 36.1, also its lowest reading since 2009.  Like ISM, the PMI components reflected a similar broad-based deterioration in activity.

Chart of the Week:

Analysts at Deutsche Bank have ingeniously charted a relationship between the global spread of covid-19 and the stock market’s major fear gauge, called the VIX index.  They found a very close relationship between the number of countries with a greater than 5% daily growth in the number of new covid-19 cases and the level of the VIX.

Happily, the number of countries with high daily growth rates is coming steadily down, and so has the VIX index.  And as the VIX index comes down, so should the wild daily swings recently experienced in the stock market.

Market Indicators:

Counting-up of the number of all our indicators that are ‘Up’ for U.S. Equities the current tally is that three of four are Positive, representing a multitude of timeframes (two that can be solely days/weeks, or months+ at a time; another, a quarter at a time; and lastly, the {typically} years-long reading, that being the Cyclical Bull or Bear status).

The long-term valuation of the market is commonly measured by the Cyclically Adjusted Price to Earnings ratio, or “CAPE”, which smooths-out shorter-term earnings swings in order to get a longer-term assessment of market valuation.  A CAPE level of 30 is considered to be the upper end of the normal range, and the level at which further PE-ratio expansion comes to a halt (meaning that further increases in market prices only occur as a general response to earnings increases, instead of rising “just because”).  The market was recently at that level.

Of course, a “mania” could come along and drive prices higher – much higher, even – and for some years to come.  Manias occur when valuation no longer seems to matter, and caution is thrown completely to the wind – as buyers rush in to buy first, and ask questions later.  Two manias in the last century – the “Roaring Twenties” of the 1920s, and the “Tech Bubble” of the late 1990s – show that the sky is the limit when common sense is overcome by a blind desire to buy.  But, of course, the piper must be paid, and the following decade or two were spent in Secular Bear Markets, giving most or all of the mania-gains back.

The CAPE is now at 26.50, slightly down from the prior week’s 26.56 and now well below 30.  Since 1881, the average annual return for all ten-year periods that began with a CAPE in the 20-30 range have been slightly-positive to slightly-negative.

The Week Ahead:

Monday: U.S. Factory Orders m/m -9.2% exp, +0.0% prior Reserve Bank of Australia Rate Statement Earnings: TSN, L, AIG, PFGC

Tuesday: U.S. Trade Balance -41.0 bln exp, -39.9 bln prior U.S. ISM Non-Manufacturing PMI 37.5 exp, 52.5 prior Earnings: MPC, DIS, SYY,

Wednesday: U.S. ADP Non-Farm Employment Change -20 mln exp, -27k prior China USD-Denominated Trade Balance 15.8 bln exp, 19.9 bn prior Earnings: CVS, GM, BG, PGR, PAG Thursday: Bank of England Monetary Policy Summary U.S. Unemployment Claims 3000k exp, 3839k prior Earnings: ABC, MT, MGA, DHR, HLT, JBLU

Friday: Jobs Report German Trade Balance +20.1 bln exp, +21.6 bln prior U.S. Non-Farm Payroll Change -21 mln exp, -701k prior Unemployment Rate 16.0% exp, 4.4% prior

(Sources:  All index- and returns-data from Yahoo Finance; news from Reuters, Barron’s, Wall St. Journal, Bloomberg.com, ft.com, guggenheimpartners.com, zerohedge.com, ritholtz.com, markit.com, financialpost.com, Eurostat, Statistics Canada, Yahoo! Finance, stocksandnews.com, marketwatch.com, wantchinatimes.com, BBC, 361capital.com, pensionpartners.com, cnbc.com, FactSet.)

[/fusion_text][fusion_code]PHN0eWxlPgogI19mb3JtXzE3M18geyBmb250LXNpemU6MTRweDsgbGluZS1oZWlnaHQ6MS42OyBmb250LWZhbWlseTphcmlhbCwgaGVsdmV0aWNhLCBzYW5zLXNlcmlmOyBtYXJnaW46MDsgfQogI19mb3JtXzE3M18gKiB7IG91dGxpbmU6MDsgfQogLl9mb3JtX2hpZGUgeyBkaXNwbGF5Om5vbmU7IHZpc2liaWxpdHk6aGlkZGVuOyB9CiAuX2Zvcm1fc2hvdyB7IGRpc3BsYXk6YmxvY2s7IHZpc2liaWxpdHk6dmlzaWJsZTsgfQogI19mb3JtXzE3M18uX2Zvcm0tdG9wIHsgdG9wOjA7IH0KICNfZm9ybV8xNzNfLl9mb3JtLWJvdHRvbSB7IGJvdHRvbTowOyB9CiAjX2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lbXNbaV0uZ2V0QXR0cmlidXRlKCdyZXF1aXJlZCcpID09PSBudWxsKSBjb250aW51ZTsKICAgICAgICAgIGlmICghZm91bmQgJiYgZWxlbXNbaV0gIT09IGVsZW0pIHJldHVybiB0cnVlOwogICAgICAgICAgZm91bmQgPSB0cnVlOwogICAgICAgICAgZWxlbXNbaV0uY2xhc3NOYW1lID0gZWxlbXNbaV0uY2xhc3NOYW1lLnJlcGxhY2UoLyA/X2hhc19lcnJvciA/L2csICcnKTsKICAgICAgICAgIGlmICghZWxlbXNbaV0uY2hlY2tlZCkgewogICAgICAgICAgICBub19lcnJvciA9IGZhbHNlOwogICAgICAgICAgICBlbGVtc1tpXS5jbGFzc05hbWUgPSBlbGVtc1tpXS5jbGFzc05hbWUgKyAnIF9oYXNfZXJyb3InOwogICAgICAgICAgICBlcnIucHVzaCgiQ2hlY2tpbmcgJXMgaXMgcmVxdWlyZWQiLnJlcGxhY2UoIiVzIiwgZWxlbXNbaV0udmFsdWUpKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKCFub19lcnJvcikgewogICAgICAgICAgdG9vbHRpcCA9IGNyZWF0ZV90b29sdGlwKGVsZW0sIGVyci5qb2luKCc8YnIvPicpKTsKICAgICAgICB9CiAgICAgIH0gZWxzZSBpZiAoZWxlbS50YWdOYW1lID09ICdTRUxFQ1QnKSB7CiAgICAgICAgdmFyIHNlbGVjdGVkID0gdHJ1ZTsKICAgICAgICBpZiAoZWxlbS5tdWx0aXBsZSkgewogICAgICAgICAgc2VsZWN0ZWQgPSBmYWxzZTsKICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZWxlbS5vcHRpb25zLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGlmIChlbGVtLm9wdGlvbnNbaV0uc2VsZWN0ZWQpIHsKICAgICAgICAgICAgICBzZWxlY3RlZCA9IHRydWU7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICAgIH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NbaV07CiAgICAgICAgaWYgKG5lZWRzX3ZhbGlkYXRlKGlucHV0KSkgewogICAgICAgICAgaWYgKGlucHV0LnR5cGUgPT0gJ3RleHQnKSB7CiAgICAgICAgICAgIGFkZEV2ZW50KGlucHV0LCAnYmx1cicsIGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgIHRoaXMudmFsdWUgPSB0aGlzLnZhbHVlLnRyaW0oKTsKICAgICAgICAgICAgICB2YWxpZGF0ZV9maWVsZCh0aGlzLCB0cnVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGFkZEV2ZW50KGlucHV0LCAnaW5wdXQnLCBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICB2YWxpZGF0ZV9maWVsZCh0aGlzLCB0cnVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LnR5cGUgPT0gJ3JhZGlvJyB8fCBpbnB1dC50eXBlID09ICdjaGVja2JveCcpIHsKICAgICAgICAgICAgKGZ1bmN0aW9uKGVsKSB7CiAgICAgICAgICAgICAgdmFyIHJhZGlvcyA9IGZvcm1fdG9fc3VibWl0LmVsZW1lbnRzW2VsLm5hbWVdOwogICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcmFkaW9zLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICBhZGRFdmVudChyYWRpb3NbaV0sICdjbGljaycsIGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgICB2YWxpZGF0ZV9maWVsZChlbCwgdHJ1ZSk7CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pKGlucHV0KTsKICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQudGFnTmFtZSA9PSAnU0VMRUNUJykgewogICAgICAgICAgICBhZGRFdmVudChpbnB1dCwgJ2NoYW5nZScsIGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgIHZhbGlkYXRlX2ZpZWxkKHR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FkZEV2ZW50KGZvcm1fdG9fc3VibWl0LCAnc3VibWl0JywgZm9ybV9zdWJtaXQpOwp9KSgpOwoKPC9zY3JpcHQ+[/fusion_code][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container hundred_percent=”no” hundred_percent_height=”no” hundred_percent_height_scroll=”no” hundred_percent_height_center_content=”yes” equal_height_columns=”no” menu_anchor=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” status=”published” publish_date=”” class=”” id=”” border_size=”” border_color=”” border_style=”solid” margin_top=”” margin_bottom=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” gradient_start_color=”” gradient_end_color=”” gradient_start_position=”0″ gradient_end_position=”100″ gradient_type=”linear” radial_direction=”center” linear_angle=”180″ background_color=”” background_image=”” background_position=”center center” background_repeat=”no-repeat” fade=”no” background_parallax=”none” enable_mobile=”no” parallax_speed=”0.3″ background_blend_mode=”none” video_mp4=”” video_webm=”” video_ogv=”” video_url=”” video_aspect_ratio=”16:9″ video_loop=”yes” video_mute=”yes” video_preview_image=”” filter_hue=”0″ filter_saturation=”100″ filter_brightness=”100″ filter_contrast=”100″ filter_invert=”0″ filter_sepia=”0″ filter_opacity=”100″ filter_blur=”0″ filter_hue_hover=”0″ filter_saturation_hover=”100″ filter_brightness_hover=”100″ filter_contrast_hover=”100″ filter_invert_hover=”0″ filter_sepia_hover=”0″ filter_opacity_hover=”100″ filter_blur_hover=”0″][fusion_builder_row][/fusion_builder_row][/fusion_builder_container]

By John Rothe, CMT

Founder & Chief Investment Officer

Riverbend Investment Management

Stay Connected