ISM Index, PMI Down Worldwide! Not Good for the Economy! Hands-on Market Analysis with Python
Introduction
The ISM Manufacturing Index also referred to as Purchasing Manager's Index (PMI), is down almost across the board. Let's download the raw data, breakout a Jupyter notebook and check this out for ourselves. The ISM/PMI is an economic number released monthly that hovers around a 50 line. Above means the outlook of the economy is expanding, below, contracting.
Code
from IPython.display import Image
Image(filename='viralml-book.png')
ISM Manufacturing Index Also Referred to as Purchasing Manager's Index (PMI), Is Down Almost Everywhere¶
What is the ISM/PMI?¶
It is a montly number part of an index indicator. It is a diffusion index as it hovers around a 50 line, above means the outlook of the economy is expanding, below, contracting. The data comes from a montly survey sent out to leading purchasing managers and supply management executives. Questions cover the ares of new orders, production, employment, supplier deliveries, and inventories.
From investopedia (https://www.investopedia.com/terms/p/pmi.asp
"The direction of the trend in the PMI tends to precede changes in the trend in major estimates of economic activity and output, such as the GDP, Industrial Production, and Employment. Paying attention to the value and movements in the PMI can yield profitable foresight into developing trends in the overall economy."
Let's get some data:
PMI Composite Index¶
https://www.quandl.com/data/ISM/MAN_PMI-PMI-Composite-Index
S&P 500 (^GSPC)¶
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import io, base64, os, json, re
import pandas as pd
import numpy as np
import datetime
import warnings
warnings.filterwarnings('ignore')
path_to_market_data = '/Users/manuel/Documents/financial-research/market-data/2019-09-30/'
# Load PMI data
pmi_df = pd.read_csv(path_to_market_data + 'ISM-MAN_PMI.csv')
pmi_df['Date'] = pd.to_datetime(pmi_df['Date'])
print(np.min(pmi_df['Date'] ),np.max(pmi_df['Date'] ))
pmi_df = pmi_df.sort_values('Date', ascending=True) # sort in ascending date order
pmi_df.tail()
# Load S&P 500 Index data
gspc_df = pd.read_csv(path_to_market_data + '^GSPC.csv')
gspc_df['Date'] = pd.to_datetime(gspc_df['Date'])
gspc_df = gspc_df[['Date', 'Adj Close', 'Volume']]
gspc_df.columns = ['Date', 'SP500_Close', 'SP500_Volume']
gspc_df = gspc_df.sort_values('Date', ascending=True)
print(min(gspc_df['Date']), max(gspc_df['Date']))
print(gspc_df.shape)
gspc_df.head()
cut_off_date = '1948-01-01'
pmi_df_tmp = pmi_df.copy()
pmi_df_tmp = pmi_df_tmp[pmi_df_tmp['Date'] >= cut_off_date]
fig, ax = plt.subplots(figsize=(16, 8))
plt.plot(pmi_df_tmp['Date'],
pmi_df_tmp['PMI'], color='blue', label='PMI')
plt.grid()
plt.title("Purchasing Manager's Index (PMI) Composite Index")
plt.legend(loc='upper left')
plt.axhline(50, color ='black')
cut_off_date = '2000-01-01'
pmi_df_tmp = pmi_df.copy()
pmi_df_tmp = pmi_df_tmp[pmi_df_tmp['Date'] >= cut_off_date]
fig, ax = plt.subplots(figsize=(16, 8))
plt.plot(pmi_df_tmp['Date'],
pmi_df_tmp['PMI'], color='blue', label='PMI')
plt.grid()
plt.title("Purchasing Manager's Index (PMI) Composite Index")
plt.legend(loc='upper left')
plt.axhline(50, color ='black')
cut_off_date = '2006-01-01'
pmi_df_tmp = pmi_df.copy()
pmi_df_tmp = pmi_df_tmp[pmi_df_tmp['Date'] >= cut_off_date]
gspc_df_tmp = gspc_df.copy()
gspc_df_tmp = gspc_df_tmp[gspc_df_tmp['Date'] >= cut_off_date]
fig, ax = plt.subplots(figsize=(16, 8))
plt.plot(pmi_df_tmp['Date'],
pmi_df_tmp['PMI'], color='blue', label='PMI')
plt.grid()
plt.title("Purchasing Manager's Index (PMI) Composite Index")
plt.legend(loc='upper left')
plt.axhline(50, color ='black')
ax.twinx()
plt.plot(gspc_df_tmp['Date'],
gspc_df_tmp['SP500_Close'] , color='red', label='S&P 500')
plt.legend(loc='lower left')
Show Notes
(pardon typos and formatting -these are the notes I use to make the videos)
The ISM Manufacturing Index also referred to as Purchasing Manager's Index (PMI), is down almost across the board. Let's download the raw data, breakout a Jupyter notebook and check this out for ourselves. The ISM/PMI is an economic number released monthly that hovers around a 50 line. Above means the outlook of the economy is expanding, below, contracting.