Dashboard update: Inaction has reactions

Dashboard PDF file:

Macro and Markets Dashboard: United States (April 30, 2016 — PDF)

Dashboard update summary:

Markets closed down slightly on the week following inaction from both the Fed and Bank of Japan. Oil and Yen both still became five percent more expensive in dollar terms. Advance estimate 2016 Q1 real GDP growth was weak at 0.6 percent, but in line with expectations. Labor markets continue to be a bright spot, with eyes on next Friday’s April jobs report.

rgdpgrowth_apr302016

Real GDP ticked up 0.6 percent in log terms in the first quarter of 2016. Personal consumption expenditures and residential fixed investment helped to keep GDP growth positive despite a decrease in nonresidential fixed and inventory investment, and growth in the trade gap. The personal savings rate also increased slightly, in quarterly terms, to 5.2 percent in Q1 from 5.0 percent the previous quarter.

FOMC meeting statement changes are kindly highlighted by the Wall Street Journal and include removal of the language about global risks and, some suggestion in my view, based on labor market growth, household income, and consumer sentiment, of a June rate hike. This would depend on continued labor market strength and price pressure plus an upward revision of Q1 GDP.

pcecomp_apr302016

Personal consumption expenditures (PCE) continued to increase in Q1, led by higher spending on services. However, monthly data on PCE as a share of GDP decreased slightly in March over its February level. PCE on durable goods as a percentage of GDP was also down slightly in March, to 7.3 percent from 7.4 percent in February.

Labor market data continues to be spotless. The weekly 257,000 new jobless claims is still near the multi-decade low. Next Friday is jobs day. Both the labor force participation rate and wages should continue to improve.

nasdaq_apr302016

Disappointing earnings data from Apple includes the first decline in iPhone sales nearly since its introduction and a slowdown in sales in China. This hit the Nasdaq particularly hard, as the composite index was down 2.7 percent while the S&P 500 and Dow Jones industrial average fell 1.3 percent each during the week.

oil_apr302016

Oil prices still managed to climb five percent over the past five days. West Texas Intermediate (WTI) crude oil was trading above $46 a barrel at several points during the week. Two recent stories reminded me how oil price fluctuations cause enormous transfers of wealth between countries. Jamaica was praised in this week’s Alphachat series on sovereign debt, while noting that their recent fiscal fortune is aligned with lower prices on their fuel imports. Likewise, a recent IMF publication noted that oil exporting economies in the middle east and central Asia have enacted powerful fiscal stimulus measures to keep their economies moving while they suffer the oil revenue slowdown. Those who believe in the resource curse might note that government measures to shift the economy away from oil are both important and difficult to achieve.

Lastly, the Yen had a volatile week, closing with a five percent appreciation against the dollar. The Brazilian real appreciated nearly four percent during the week, the Swiss franc and Turkish lira appreciated nearly two percent each, the pound sterling nearly one and a half percent and the Canadian dollar nearly one percent.

The full dashboard is here: Macro and Markets Dashboard: United States (April 30, 2016 — PDF)

Dollar-indices: hitting recent lows (and how to plot with Python)

While the dollar has depreciated against most major currencies over the past month (notably 4.4% against the Canadian dollar, 3.3% against the Yen, 4.2% against the Real, and 8.6% against the Rand), the Fed H.10 release provides measures of exactly how much the value of the greenback has fallen relative to a weighted set of its trading partners. The latest data show that the U.S. dollar has fallen on April 12 to its lowest level since June 2015 compared to other major currencies, and its lowest level since October 2015 compared to a broad index of currencies.

This post covers the trade-weighted dollar and is split into two segments: a description of the index and its recent behavior, and a short python script showing how you can use the pandas and matplotlib libraries to retrieve the time series and plot it.

Two trade-weighted dollar indices, described

The Fed’s two most common trade-weighted indices of the foreign exchange value of the U.S. dollar are the major-currencies index and the broad-index. Both measure the value of the dollar relative to other countries’ currencies and intend to be aligned, through their weighting system, with the currencies closely related to U.S. trade patterns. The broad index, however, covers more currencies, and especially more emerging market currencies.

Discrepancies between even the broad index and the way the dollar is actually traded are inevitable. For example, the broad index weight in 2016 for Canada is 12.664 percent (broad index weights are updated yearly), whereas year-t0-date, 15.2 percent of total U.S. trade has been with Canada. From a share-of-total-U.S.-trade perspective, the broad index is somewhat overweight the Yuan, Euro, and Yen, and underweight the Canadian dollar and Mexican peso.

dtwexm_apr152016
The major currencies index contains fewer currencies than the broad index, and has fallen to a 22-month low. (plot from dashboard)

From 2005 through 2015, the major currencies index remained largely within a range of 70-85. After a steep climb through 2015, in January, the measure peaked at 95.8, to the frustration of U.S. exporters whose customers essentially pay more for the same goods (and as a result buy fewer). On April 12, the major currencies index hit its lowest level since June 2015.

Meanwhile, the broad index has moved in the same direction, hitting a five month low on April 12. The plot of the broad index is below, including how to obtain it. You can substitute DTWEXB with DTWEXM if you are interested in the major currencies index.

Python: Retrieve and plot the trade-weighted dollar

Next we show how Python can be used to gather and plot data on the Fed’s broad index of the foreign exchange value of the dollar. The script gathers data from Fred and plots each business day’s index value since the start of 2014.

Gathering data

First, we import pandas, numpy, and matplotlib and give them conventional short names. We will also use datetime and date.

In [1]:
# Import libraries
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
import datetime
from datetime import date

Next, we use the pandas.io.data package to request the data from Fred. I’ve found the code for our series of interest, DTWEXB, by searching, but you can also find it on the Fred site by source (Board of Governors of the Federal Reserve System), or by release (H.10). We paste the series code into the datareader and provide start and end dates. Pandas retrieves the data into a dataframe.

In [2]:
import pandas_datareader.data as webdata
tstart = datetime.datetime(2014, 1, 1)
#retrieve trade-weighted dollar data from fred
dtwexb = webdata.DataReader("DTWEXB", "fred", tstart);
#display five most recent observations
dtwexb.tail(5)
Out[2]:
DTWEXB
DATE
2016-04-11 119.4527
2016-04-12 119.2860
2016-04-13 119.6278
2016-04-14 119.6472
2016-04-15 119.6701

When was the last time the measure was as low as its April 12 value?

In [3]:
print dtwexb[119.29>=dtwexb].dropna().tail(2)
              DTWEXB
DATE                
2015-10-21  119.1786
2016-04-12  119.2860

Line plot of data

Lastly, we can use matplotlib to plot the data.

In [4]:
#Create figure and plot dtwexb
fig = plt.figure(figsize=[7,5])
ax1 = plt.subplot(111)
line = dtwexb.DTWEXB.plot(color='blue',linewidth=2)

#Add a title
ax1.set_title('Trade-Weighted U.S. Dollar, Broad Index (1997=100)', fontsize=15)

#Add y label and no x-label since it is dates
ax1.set_ylabel('Index')
ax1.set_xlabel('')

#Axis options
ax1.spines["top"].set_visible(False)  
ax1.spines["right"].set_visible(False)  
ax1.get_xaxis().tick_bottom()
ax1.get_yaxis().tick_left()
ax1.tick_params(axis='x', which='major', labelsize=8)
ax1.yaxis.grid(True)

#Annotate with text
fig.text(0.15, 0.85,'Last: ' + str(dtwexb.DTWEXB[-1]) \
         + ' (as of: ' + str(dtwexb.index[-1].strftime('%Y-%m-%d'))\
         + ')');
url = 'https://research.stlouisfed.org/fred2/series/TWEXB'
fig.text(0.05, 0.025, 'Source: ' + url)
fig.text(0.65, 0.16, 'briandew.wordpress.com')

#Save as png
plt.savefig('dtwexb.png', dpi=1000)
dtwexb
The broad index hit a five-month low on April 12.