[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″ layout=”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. stocks recorded one of their best weekly gains on record, as some encouraging trends in global coronavirus infection and hospitalization rates lifted hopes that stay-at-home orders might soon be eased.
The Dow Jones Industrial Average rose almost 2,670 points to close at 23,719, a gain of 12.7%. The technology-heavy NASDAQ Composite rose 10.6% and finished at 8,154.
By market cap, the large cap S&P 500 gained 12.1%, while the mid cap S&P 400 and small cap Russell 2000 surged 18.6% and 18.5%, respectively.
International Markets: International markets, though not as strong as their U.S. counterparts, were nonetheless also a sea of green following last week’s declines. Canada’s TSX rose 9.5% while the United Kingdom’s FTSE added 7.9%.
On Europe’s mainland France’s CAC 40 added 8.5%, Germany’s DAX rose 10.9%, and Italy’s Milan FTSE gained 7.6%.
In Asia, China’s Shanghai Composite added 2.2% and Japan’s Nikkei rallied 8.6%.
As grouped by Morgan Stanley Capital International, developed markets rose 9.2% while emerging markets added 6.7%.
Commodities
Gold hit its highest level in seven years, rising 6.5% to close at $1752.80 an ounce. Silver also rallied, gaining 10.8% to close at $16.05.
Oil, however, retraced most of last week’s increase, plunging almost 20% to finish the week at $22.76 per barrel of West Texas Intermediate.
The industrial metal copper, viewed by some analysts as an indicator of world economic health due to its wide variety of uses, rose for a third consecutive week by gaining 3.1%.
U.S. Economic News
There was no respite from the coronavirus outbreak for the labor market. The number of Americans seeking first-time unemployment benefits posted another near-record level of 6.606 million last week, far above the consensus forecast of 4.5 million. Optimists note that the number of new claims were 261,000 fewer than the week before, but that’s hardly a sign of a turn-around.
Over the last three weeks, more than 16.8 million jobs have been lost. And analysts don’t expect these numbers to let up anytime soon.
Economists Dante DeAntonio and Matt Colyar of Moody’s Analytics stated, “The harsh reality is that the level of initial unemployment insurance claims is unlikely to recede in the coming weeks.” The current pace of job losses suggest the unemployment rate will soon move past 15% and perhaps even exceed 20% – levels not seen since the Great Depression of the 1930s.
With millions of jobs lost and large parts of the economy shutdown, the confidence expressed by the nation’s consumers has plunged to a nine-year low. Thedropped 18.1 points to 71 in early April—its biggest-ever one-month decline.
The rapid spread of COVID-19 has arguably delivered the deepest blow to the U.S. economy since the Great Depression. Just two months ago, the index stood close to a 15-year high. If the crisis continues, the survey may very well fall below its previous record low of 55.3, recorded in 2008 in the midst of the Financial Crisis.
The National Federation of Independent Business (NFIB) reported its Small Business Optimism Index plunged a record 8.1 points in March to 96.4—its lowest reading since October 2016. The NFIB reported large numbers of smaller firms scaled back operations or shut down altogether amid the spread of COVID-19 and social distancing.
Nine of the ten NFIB components decreased. In the report the NFIB noted that firms are expecting a steep decline in sales over the next three months. Plans for capital expenditures dropped to their lowest point since January 2013 and hiring expectations fell by the most on record.
According to minutes from the Federal Reserve’s two policy meetings in early March, the central bank stated its worst‑case scenario for the economy is “no recovery until next year.” Staff economists stated there were two plausible scenarios for the U.S. economy dealing with the coronavirus outbreak.
One scenario sees a recovery begin to take place in the second half of 2020. The more adverse scenario is an economic recovery “much slower to take hold and not materially under way until next year”.
Under both scenarios, inflation is expected to move lower. Faced with these scenarios, Fed officials slashed interest rates to zero and launched open-ended purchases of Treasury and asset-backed securities.
Since March 15, the Fed has taken several additional steps to get funds into all corners of the financial system, introducing six lending facilities. The central bank is also working on a program to make loans to medium-size businesses.
Prices declined at the producer level for a second consecutive month, though less than expected. The Producer Price Index for final demand fell -0.2% in March. Analysts had expected a decline of -0.4%.
The weakness was primarily in goods prices, which dropped 1%. Nearly all of it was due to lower energy prices, reflecting the steep drop in oil prices. Food prices were flat. Year-over-year, the PPI for final demand was up just 0.7% – the least since August 2016.
Prices also fell at the consumer level, the most since early 2015. The Consumer Price Index declined -0.4% in March. Analysts had expected a decline of -0.3%.
Energy prices fell -5.8%, reflecting the sharp drop in oil prices. Food, on the other hand, rose in price by 0.3%. Core CPI, which excludes the often-volatile food and energy categories, fell -0.1%, down for the first time since January 2010. The declines in prices for apparel, transportation services, and new vehicles were notable as social distancing and stay-at-home orders slashed consumer shopping and travel. On an annual basis, the CPI eased to 1.5%, its slowest pace in over a year.
Chart of the Week
With stocks surging this week and now more than 20% higher from their mid-March lows, many wonder whether the great coronavirus bear market of 2020 is now history or whether the stock market will hit a new low later this year.
Mark Hulbert, writing for MarketWatch, looked at past bear markets for the answer and is convinced the answer is “lower low later”.
The Dow fell by more than 37% from February’s high to its March low; market data shows such declines have occurred 11 other times in history. On average across those 11, as shown on the chart below, the final bear market low came 137 days after first registering such a loss.
Adding that average number of days to the day of the March low projects another potentially lower low on Aug. 7.
Riverbend Equity Indicators
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.32, up from the prior week’s 23.49 and now well below 30. Since 1881, the average annual return for all ten-year periods that began with a CAPE around the 30 level have been flat to slightly-negative.
Note: We do not use CAPE as an official input into our methods. However, if history is any guide – and history is typically ‘some’ kind of guide – it’s always good to simply know where we are on the historic continuum, where that may lead, and what sort of expectations one may wish to hold in order to craft an investment strategy that works in any market ‘season’ … whether current one, or one that may be ‘coming soon’.
Riverbend Technical Indicators Status
As a reading of our Bull-Bear Indicator for U.S. Equities (comparative measurements over a rolling one-year timeframe), we remain in Cyclical Bull territory.
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 Week Ahead
Monday: China USD-Denominated Trade Balance +19.7 bln, -7.1 bln prior
Tuesday: U.S. Import Prices m/m -3.1% exp, -0.5% mln prior Earnings: JPM, WFC, JNJ, FAST
Wednesday: Retail U.S. Retail Sales m/m -8.0% exp, -0.5% prior U.S. Core Retail Sales m/m -5.0% exp, -0.4% prior Australia Employment Change -30.0k exp, +26.7k prior Earnings: UNH, BAC, C, GS, USB
Thursday: Jobless Claims U.S. Unemployment Claims 5 mln exp, 6.6 mln prior U.S. Building Permits 1.30 mln exp, 1.45 mln prior China GDP q/y -6.0% exp, +6.0% prior China Industrial Production y/y -7.0% exp, -13.5% prior Earnings: ABT, BLK, TSM, RAD, BK
Friday: U.S. CB Leading Index -7.0% exp, +0.1% prior
[/fusion_text][fusion_code]PHN0eWxlPgogI19mb3JtXzE3M18geyBmb250LXNpemU6MTRweDsgbGluZS1oZWlnaHQ6MS42OyBmb250LWZhbWlseTphcmlhbCwgaGVsdmV0aWNhLCBzYW5zLXNlcmlmOyBtYXJnaW46MDsgfQogI19mb3JtXzE3M18gKiB7IG91dGxpbmU6MDsgfQogLl9mb3JtX2hpZGUgeyBkaXNwbGF5Om5vbmU7IHZpc2liaWxpdHk6aGlkZGVuOyB9CiAuX2Zvcm1fc2hvdyB7IGRpc3BsYXk6YmxvY2s7IHZpc2liaWxpdHk6dmlzaWJsZTsgfQogI19mb3JtXzE3M18uX2Zvcm0tdG9wIHsgdG9wOjA7IH0KICNfZm9ybV8xNzNfLl9mb3JtLWJvdHRvbSB7IGJvdHRvbTowOyB9CiAjX2Zvcm1fMTczXy5fZm9ybS1sZWZ0IHsgbGVmdDowOyB9CiAjX2Zvcm1fMTczXy5fZm9ybS1yaWdodCB7IHJpZ2h0OjA7IH0KICNfZm9ybV8xNzNfIGlucHV0W3R5cGU9InRle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ybiB0cnVlOwogICAgICAgICAgZm91bmQgPSB0cnVlOwogICAgICAgICAgZWxlbXNbaV0uY2xhc3NOYW1lID0gZWxlbXNbaV0uY2xhc3NOYW1lLnJlcGxhY2UoLyA/X2hhc19lcnJvciA/L2csICcnKTsKICAgICAgICAgIGlmICghZWxlbXNbaV0uY2hlY2tlZCkgewogICAgICAgICAgICBub19lcnJvciA9IGZhbHNlOwogICAgICAgICAgICBlbGVtc1tpXS5jbGFzc05hbWUgPSBlbGVtc1tpXS5jbGFzc05hbWUgKyAnIF9oYXNfZXJyb3InOwogICAgICAgICAgICBlcnIucHVzaCgiQ2hlY2tpbmcgJXMgaXMgcmVxdWlyZWQiLnJlcGxhY2UoIiVzIiwgZWxlbXNbaV0udmFsdWUpKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKCFub19lcnJvcikgewogICAgICAgICAgdG9vbHRpcCA9IGNyZWF0ZV90b29sdGlwKGVsZW0sIGVyci5qb2luKCc8YnIvPicpKTsKICAgICAgICB9CiAgICAgIH0gZWxzZSBpZiAoZWxlbS50YWdOYW1lID09ICdTRUxFQ1QnKSB7CiAgICAgICAgdmFyIHNlbGVjdGVkID0gdHJ1ZTsKICAgICAgICBpZiAoZWxlbS5tdWx0aXBsZSkgewogICAgICAgICAgc2VsZWN0ZWQgPSBmYWxzZTsKICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZWxlbS5vcHRpb25zLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGlmIChlbGVtLm9wdGlvbnNbaV0uc2VsZWN0ZWQpIHsKICAgICAgICAgICAgICBzZWxlY3RlZCA9IHRydWU7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgewogICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBlbGVtLm9wdGlvbnMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgaWYgKGVsZW0ub3B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ZW50KGlucHV0LCAnYmx1cicsIGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgIHRoaXMudmFsdWUgPSB0aGlzLnZhbHVlLnRyaW0oKTsKICAgICAgICAgICAgICB2YWxpZGF0ZV9maWVsZCh0aGlzLCB0cnVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGFkZEV2ZW50KGlucHV0LCAnaW5wdXQnLCBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICB2YWxpZGF0ZV9maWVsZCh0aGlzLCB0cnVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LnR5cGUgPT0gJ3JhZGlvJyB8fCBpbnB1dC50eXBlID09ICdjaGVja2JveCcpIHsKICAgICAgICAgICAgKGZ1bmN0aW9uKGVsKSB7CiAgICAgICAgICAgICAgdmFyIHJhZGlvcyA9IGZvcm1fdG9fc3VibWl0LmVsZW1lbnRzW2VsLm5hbWVdOwogICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcmFkaW9zLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICBhZGRFdmVudChyYWRpb3NbaV0sICdjbGljaycsIGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgICB2YWxpZGF0ZV9maWVsZChlbCwgdHJ1ZSk7CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pKGlucHV0KTsKICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQudGFnTmFtZSA9PSAnU0VMRUNUJykgewogICAgICAgICAgICBhZGRFdmVudChpbnB1dCwgJ2NoYW5nZScsIGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgIHZhbGlkYXRlX2ZpZWxkKHRoaXMsIHRydWUpOwogICAgICAgICAgICB9KTsKICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQudHlwZSA9PSAndGV4dGFyZWEnKXsKICAgICAgICAgICAgYWRkRXZlbnQoaW5wd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UubWluLmpzIiwgZnVuY3Rpb24oKSB7CiAgICB3aW5kb3cuX2Zvcm1fc2VyaWFsaXplID0gd2luZG93LnNlcmlhbGl6ZTsKICAgIGlmICh3aW5kb3cuX29sZF9zZXJpYWxpemUpIHdpbmRvdy5zZXJpYWxpemUgPSB3aW5kb3cuX29sZF9zZXJpYWxpemU7CiAgfSk7CiAgdmFyIGZvcm1fc3VibWl0ID0gZnVuY3Rpb24oZSkgewogICAgZS5wcmV2ZW50RGVmYXVsdCgpOwogICAgaWYgKHZhbGlkYXRlX2Zvcm0oKSkgewogICAgICAvLyB1c2UgdGhpcyB0cmljayB0byBnZXQgdGhlIHN1Ym1pdCBidXR0b24gJiBkaXNhYmxlIGl0IHVzaW5nIHBsYWluIGphdmFzY3JpcHQKICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI19mb3JtXzE3M19zdWJtaXQnKS5kaXNhYmxlZCA9IHRydWU7CiAgICAgICAgICAgIHZhciBzZXJpYWxpemVkID0gX2Zvcm1fc2VyaWFsaXplKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdfZm9ybV8xNzNfJykpOwogICAgICB2YXIgZXJyID0gZm9ybV90b19zdWJtaXQucXVlcnlTZWxlY3RvcignLl9mb3JtX2Vycm9yJyk7CiAgICAgIGVyciA/IGVyci5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKGVycikgOiBmYWxzZTsKICAgICAgX2xvYWRfc2NyaXB0KCdodHRwczovL3JpdmVyYmVuZGludmVzdG1lbnRtYW5hZ2VtZW50LmFjdGl2ZWhvc3RlZC5jb20vcHJvYy5waHA/JyArIHNlcmlhbGl6ZWQgKyAnJmpzb25wPXRydWUnKTsKICAgIH0KICAgIHJldHVybiBmYWxzZTsKICB9OwogIGFkZEV2ZW50KGZvcm1fdG9fc3VibWl0LCAnc3VibWl0JywgZm9ybV9zdWJtaXQpOwp9KSgpOwoKPC9zY3JpcHQ+[/fusion_code][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]