Openness-adjusted effective appreciation #
The category group contains effective exchange rate appreciation metrics that are adjusted by the economic openness of the currency area. Higher openness means that effective appreciation has a greater impact on local financial conditions. Effective appreciation here refers mainly to real appreciation. Real-time versions of appreciation metrics are based on vintages that use J.P. Morgan’s CPI-based effective exchange rate measures and estimates of CPI deflators for recent weeks.
Adjustment here means that the appreciation is multiplied with the ratio of external trade flows (exports and imports) to GDP. The metrics are based on vintages and simulate the publication lag of consumer price indices relative to nominal exchange rates. The category also includes nominal effective appreciation measures for convenience. These do not require data vintages as they are not subject to significant systematic revisions.
Openness-adjusted effective real appreciation (based on merchandise trade) #
Ticker : REEROADJ_NSA_P1W4WL1 / REEROADJ_NSA_P1M1ML12 / REEROADJ_NSA_P1M12ML1 / REEROADJ_NSA_P1M60ML1
Label : Adjusted real appreciation (merchandise trade): % latest week over previous 4 weeks / % latest 21 days over a year ago / % latest 21 days over previous year average / % latest 21 days over previous 5-year average
Definition : Openness-adjusted real effective exchange rate appreciation, real-time, based on external merchandise trade flows and using estimates of recent CPIs: % latest week (5-day period) over previous 4 weeks / % latest month (21-day period) over a year ago / % latest month (21-day period) over the average of the previous year / % latest month (21-day period) over the average of the previous 5 years.
Notes :
-
Openness-adjustment means that the (estimated) rate of real appreciation is multiplied by the ratio of merchandise exports and imports to GDP (5-year moving averages). The trade data is based on external current accounts or custom trade figures. The adjustment for external trade ratios makes the economic impact of effective exchange rate dynamics comparable across currency areas.
-
J.P. Morgan effective exchange rates are trade-weighted indexes, focusing on the impact of currency fluctuations via international trade linkages. For a primer on J.P. Morgan effective exchange rates click here .
-
Real effective exchange rates take into account the role of high, rising, and often widely divergent inflation rates in amplifying or offsetting the economic impact of swings in bilateral nominal exchange rates. In the present case, they use headline CPI to make the adjustment.
-
Time series’ of real effective exchange rate indices are continuously revised and updated as new CPI data for recent months is released. The real-time quantamental appreciation measure is calculated based on concurrent vintages and, thus, uses a prediction of CPIs for the latest month(s) used, based on a simple formula.
Openness-adjusted effective real appreciation (based on national accounts) #
Ticker : REEROTADJ_NSA_P1W4WL1 / REEROTADJ_NSA_P1M1ML12 / REEROTADJ_NSA_P1M12ML1 / REEROTADJ_NSA_P1M60ML1
Label : Adjusted real appreciation (national accounts): % latest week over previous 4 weeks / % latest 21 days over a year ago / % latest 21 days over previous year average / % latest 21 days over previous 5-year average
Definition : Openness-adjusted real effective exchange rate appreciation, real-time, based on external merchandise and services trade flows and using estimates of recent CPIs: % latest week (5-day period) over previous 4 weeks / % latest month (21-day period) over a year ago / % latest month (21-day period) over the average of the previous year / % latest month (21-day period) over the average of the previous 5 years.
Notes :
-
Openness-adjustment means that the (estimated) rate of real appreciation is multiplied by the ratio of merchandise and services exports and imports to GDP (5-year moving averages). The trade data is based on the national accounts. The adjustment for external trade ratios makes the economic impact of effective exchange rate dynamics comparable across currency areas.
-
J.P. Morgan effective exchange rates are trade-weighted indexes, focusing on the impact of currency fluctuations via international trade linkages. For a primer on J.P. Morgan effective exchange rates click here .
-
Real effective exchange rates take into account the role of high, rising, and often widely divergent inflation rates in amplifying or offsetting the economic impact of swings in bilateral nominal exchange rates. In the present case, they use headline CPI to make the adjustment.
-
Time series’ of real effective exchange rate indices are continuously revised and updated as new CPI data for recent months is released. The real-time quantamental appreciation measure is calculated based on concurrent vintages and, thus, uses a prediction of CPIs for the latest month(s) used, based on a simple formula.
Openness-adjusted effective nominal appreciation (based on merchandise trade) #
Ticker : NEEROADJ_NSA_P1W4WL1 / NEEROADJ_NSA_P1M1ML12 / NEEROADJ_NSA_P1M12ML1 / NEEROADJ_NSA_P1M60ML1
Label : Adjusted nominal appreciation (merchandise trade): % latest week over previous 4 weeks / % latest 21 days over a year ago / % latest 21 days over previous year average / % latest 21 days over previous 5-year average
Definition : Openness-adjusted nominal effective exchange rate appreciation: % latest week (5-day period) over previous 4 weeks / % latest month (21-day period) over a year ago / % latest month (21-day period) over the average of the previous year / % latest month (21-day period) over the average of the previous 5 years.
Notes :
-
Openness-adjustment means that the (estimated) rate of appreciation is multiplied by the ratio of merchandise exports and imports to GDP (5-year moving averages). The trade data is based on external current accounts or custom trade figures. The adjustment for external trade ratios makes the economic impact of effective exchange rate dynamics comparable across currency areas.
-
Unlike real effective exchange rates, nominal effective exchange rates do not require data vintages to be replicated in real-time. Openness-adjusted nominal appreciation can be calculated by multiplying any change of J.P. Morgan’s effective exchange rates with the openness ratios of JPMaQS. The appreciation rates used here have been added to the system for user convenience.
-
J.P. Morgan effective exchange rates are trade-weighted indices, focusing on the impact of currency fluctuations via international trade linkages. For a primer on J.P. Morgan effective exchange rates click here .
Openness-adjusted effective nominal appreciation (based on national accounts) #
Ticker : NEEROTADJ_NSA_P1W4WL1 / NEEROTADJ_NSA_P1M1ML12 / NEEROTADJ_NSA_P1M12ML1 / NEEROTADJ_NSA_P1M60ML1
Label : Adjusted nominal appreciation (national accounts): % latest week over previous 4 weeks / % latest 21 days over a year ago / % latest 21 days over previous year average / % latest 21 days over previous 5-year average
Definition : Openness-adjusted nominal effective exchange rate appreciation: % latest week (5-day period) over previous 4 weeks / % latest month (21-day period) over a year ago / % latest month (21-day period) over the average of the previous year / % latest month (21-day period) over the average of the previous 5 years.
Notes :
-
Openness-adjustment means that the (estimated) rate of appreciation is multiplied by the ratio of services and merchandise exports and imports to GDP (5-year moving averages). The trade data is based on the national accounts. The adjustment for external trade ratios makes the economic impact of effective exchange rate dynamics comparable across currency areas.
-
Unlike real effective exchange rates, nominal effective exchange rates do not require data vintages to be replicated in real-time. Openness-adjusted nominal appreciation can be calculated by multiplying any change in J.P. Morgan’s effective exchange rates with the openness ratios of JPMaQS. The appreciation rates used here have been added to the system for user convenience.
-
J.P. Morgan effective exchange rates are trade-weighted indexes, focusing on the impact of currency fluctuations via international trade linkages. For a primer on J.P. Morgan effective exchange rates click here .
Imports #
Only the standard Python data science packages and the specialized
macrosynergy
package are needed.
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import math
import json
import yaml
import macrosynergy.management as msm
import macrosynergy.panel as msp
import macrosynergy.signal as mss
import macrosynergy.pnl as msn
from macrosynergy.download import JPMaQSDownload
from timeit import default_timer as timer
from datetime import timedelta, date, datetime
import warnings
warnings.simplefilter("ignore")
The
JPMaQS
indicators we consider are downloaded using the J.P. Morgan Dataquery API interface within the
macrosynergy
package. This is done by specifying
ticker strings
, formed by appending an indicator category code
<category>
to a currency area code
<cross_section>
. These constitute the main part of a full quantamental indicator ticker, taking the form
DB(JPMAQS,<cross_section>_<category>,<info>)
, where
<info>
denotes the time series of information for the given cross-section and category. The following types of information are available:
-
value
giving the latest available values for the indicator -
eop_lag
referring to days elapsed since the end of the observation period -
mop_lag
referring to the number of days elapsed since the mean observation period -
grade
denoting a grade of the observation, giving a metric of real time information quality.
After instantiating the
JPMaQSDownload
class within the
macrosynergy.download
module, one can use the
download(tickers,start_date,metrics)
method to easily download the necessary data, where
tickers
is an array of ticker strings,
start_date
is the first collection date to be considered and
metrics
is an array comprising the times series information to be downloaded.
# Cross-sections of interest
cids_dmca = [
"AUD",
"CAD",
"CHF",
"EUR",
"GBP",
"JPY",
"NOK",
"NZD",
"SEK",
"USD",
] # DM currency areas
cids_dmec = ["DEM", "ESP", "FRF", "ITL", "NLG"] # DM euro area countries
cids_latm = ["BRL", "COP", "CLP", "MXN", "PEN"] # Latam countries
cids_emea = ["CZK", "HUF", "ILS", "PLN", "RON", "RUB", "TRY", "ZAR"] # EMEA countries
cids_emas = [
"CNY",
# "HKD",
"IDR",
"INR",
"KRW",
"MYR",
"PHP",
"SGD",
"THB",
"TWD",
] # EM Asia countries
cids_dm = cids_dmca + cids_dmec
cids_em = cids_latm + cids_emea + cids_emas
cids = sorted(cids_dm + cids_em)
main = [
"REEROADJ_NSA_P1M1ML12",
"REEROADJ_NSA_P1W4WL1",
"REEROADJ_NSA_P1M12ML1",
"REEROADJ_NSA_P1M60ML1",
"REEROTADJ_NSA_P1M1ML12",
"REEROTADJ_NSA_P1W4WL1",
"REEROTADJ_NSA_P1M12ML1",
"REEROTADJ_NSA_P1M60ML1",
]
add = [
"NEEROADJ_NSA_P1M1ML12",
"NEEROADJ_NSA_P1W4WL1",
"NEEROADJ_NSA_P1M12ML1",
"NEEROADJ_NSA_P1M60ML1",
"NEEROTADJ_NSA_P1M1ML12",
"NEEROTADJ_NSA_P1W4WL1",
"NEEROTADJ_NSA_P1M12ML1",
"NEEROTADJ_NSA_P1M60ML1",
]
econ = ["FXCRR_VT10", "RIR_NSA"] # economic context
mark = ["EQXR_NSA", "FXXR_NSA", "DU05YXR_NSA", "DU05YXR_VT10"] # market links
xcats = main + add + econ + mark
# Download series from J.P. Morgan DataQuery by tickers
start_date = "2000-01-01"
tickers = [cid + "_" + xcat for cid in cids for xcat in xcats]
print(f"Maximum number of tickers is {len(tickers)}")
# Retrieve credentials
client_id: str = os.getenv("DQ_CLIENT_ID")
client_secret: str = os.getenv("DQ_CLIENT_SECRET")
# Download from DataQuery
with JPMaQSDownload(client_id=client_id, client_secret=client_secret) as downloader:
start = timer()
df = downloader.download(
tickers=tickers,
start_date=start_date,
metrics=["value", "eop_lag", "mop_lag", "grading"],
suppress_warning=True,
show_progress=True,
)
end = timer()
dfd = df
print("Download time from DQ: " + str(timedelta(seconds=end - start)))
Maximum number of tickers is 814
Downloading data from JPMaQS.
Timestamp UTC: 2023-07-19 14:47:19
Connection successful!
Number of expressions requested: 3256
Requesting data: 100%|███████████████████████████████████████████████████████████████| 163/163 [00:51<00:00, 3.15it/s]
Downloading data: 100%|██████████████████████████████████████████████████████████████| 163/163 [02:28<00:00, 1.10it/s]
Download time from DQ: 0:04:26.505601
Availability #
cids_exp = sorted(list(set(cids) - set(cids_dmec))) # cids expected in category panels
msm.missing_in_df(dfd, xcats=main, cids=cids_exp)
Missing xcats across df: []
Missing cids for REEROADJ_NSA_P1M12ML1: []
Missing cids for REEROADJ_NSA_P1M1ML12: []
Missing cids for REEROADJ_NSA_P1M60ML1: []
Missing cids for REEROADJ_NSA_P1W4WL1: []
Missing cids for REEROTADJ_NSA_P1M12ML1: ['CNY']
Missing cids for REEROTADJ_NSA_P1M1ML12: ['CNY']
Missing cids for REEROTADJ_NSA_P1M60ML1: ['CNY']
Missing cids for REEROTADJ_NSA_P1W4WL1: ['CNY']
Openness-adjusted appreciation metrics are available by 2000 for all developed markets and most emerging markets. South Africa, Columbia and India are notable late-starters, with data only available for some indicators post-2010. Openness-adjustment by national accounts data is not possible for China due to lack of transparency in the official data.
xcatx = main
cidx = cids_exp
dfx = msm.reduce_df(dfd, xcats=xcatx, cids=cidx)
dfs = msm.check_startyears(
dfx,
)
msm.visual_paneldates(dfs, size=(18, 6))
print("Last updated:", date.today())
Last updated: 2023-07-19
plot = msm.check_availability(
dfd, xcats=main, cids=cids_exp, start_size=(18, 6), start_years=False
)
Vintage grading is perfect for all cross-sections and available indicator categories.
plot = msp.heatmap_grades(
dfd,
xcats=main,
cids=cids_exp,
size=(18, 6),
title=f"Average vintage grades from {start_date} onwards",
)
xcatx = main[:2]
cidx = cids_exp
msp.view_ranges(
dfd,
xcats=xcatx,
cids=cidx,
val="eop_lag",
title="End of observation period lags (ranges of time elapsed since end of observation period in days)",
start="2000-01-01",
kind="box",
size=(16, 4),
)
msp.view_ranges(
dfd,
xcats=xcatx,
cids=cidx,
val="mop_lag",
title="Median of observation period lags (ranges of time elapsed since middle of observation period in days)",
start="2000-01-01",
kind="box",
size=(16, 4),
)
History #
Short-term openness-adjusted real appreciation #
Short-term real openness-adjusted effective exchange rate swings have been widest in small EM countries and smallest in large countries. The adjustment that uses national accounts data gives rise naturally to greater absolute values since it considers services trade in addition to merchandise trade.
xcatx = ["REEROADJ_NSA_P1W4WL1", "REEROTADJ_NSA_P1W4WL1"]
cidx = cids_exp
msp.view_ranges(
dfd,
xcats=xcatx,
cids=cidx,
sort_cids_by="std",
start=start_date,
title="Boxplots for short-term openness-adjusted real appreciation metrics",
xcat_labels=["Merchandise trade", "Services and merchandise trade"],
kind="box",
size=(16, 8),
)
xcatx = ["REEROADJ_NSA_P1W4WL1"]
cidx = cids_exp
msp.view_timelines(
dfd,
xcats=xcatx,
cids=cidx,
start=start_date,
title="Openness-adjusted real effective appreciation, based on merchandise trade, % of the latest week over previous 4 weeks",
title_adj=1.03,
title_xadj=0.52,
title_fontsize=27,
legend_fontsize=17,
ncol=4,
same_y=True,
size=(12, 7),
aspect=1.7,
all_xticks=True,
)
For smaller countries, real effective exchange rate changes are predominantly against USD, EUR and CNY. This explains why these three large currency areas have recorded real currency trends that were negatively correlated with most other currency areas. Put simply, short-term real effective currency trends often entail economic divergences between small and large currency areas.
xcatx = ["REEROADJ_NSA_P1W4WL1"]
cidx = cids_exp
dfdx = dfd.loc[dfd["xcat"].isin(xcatx), :]
dfmx = (
dfdx.groupby(["cid", "xcat"])
.resample("M", on="real_date")
.last()["value"]
.reset_index()
)
msp.correl_matrix(
dfmx,
xcats="REEROADJ_NSA_P1W4WL1",
cids=cidx,
size=(20, 14),
start=start_date,
title="Cross-sectional correlations of openness-adjusted real effective appreciation, agglomerative clustering of cross-sections",
cluster=True,
)
Annual openness-adjusted real appreciation #
As with the short-term metric, real openness-adjusted effective appreciation has displayed the greatest variance in small EM countries and smallest variance in large countries. The annual metric is less sensitive to outliers than the 4-week metric.
xcatx = ["REEROADJ_NSA_P1M1ML12", "REEROTADJ_NSA_P1M1ML12"]
cidx = cids_exp
msp.view_ranges(
dfd,
xcats=xcatx,
cids=cidx,
sort_cids_by="std",
start=start_date,
kind="box",
title="Boxplots for annual openness-adjusted real appreciation metrics",
xcat_labels=["Merchandise trade", "Services and merchandise trade"],
size=(16, 8),
)
xcatx = ["REEROADJ_NSA_P1M1ML12"]
cidx = cids_exp
msp.view_timelines(
dfd,
xcats=xcatx,
cids=cidx,
start=start_date,
title="Openness-adjusted real effective appreciation, based on merchandise trade, % latest 21 days over a year ago",
title_adj=1.02,
title_xadj=0.52,
title_fontsize=27,
ncol=4,
same_y=True,
size=(12, 7),
aspect=1.7,
all_xticks=True,
)
Medium-term openness-adjusted real appreciation #
As with the short-term and annual appreciation metrics, medium-term fluctuations are largest for small countries. Interestingly, this is true even for those that have historically made big efforts in controlling their currency dynamics, such as Singapore, Malaysia and Thailand.
xcatx = ["REEROADJ_NSA_P1M12ML1", "REEROTADJ_NSA_P1M12ML1"]
cidx = cids_exp
msp.view_ranges(
dfd,
xcats=xcatx,
cids=cids_exp,
sort_cids_by="std",
start=start_date,
kind="box",
title="Boxplots for medium-term openness-adjusted real appreciation metrics",
xcat_labels=["Merchandise trade", "Services and merchandise trade"],
size=(16, 8),
)
xcatx = ["REEROADJ_NSA_P1M12ML1"]
cidx = cids_exp
msp.view_timelines(
dfd,
xcats=xcatx,
cids=cidx,
start=start_date,
title="Openness-adjusted real effective appreciation, based on merchandise trade, % of the latest month over previous year average",
title_adj=1.02,
title_xadj=0.5,
title_fontsize=27,
ncol=4,
same_y=True,
size=(12, 7),
aspect=1.7,
all_xticks=True,
)
Long-term real appreciation #
There have been large differences in means and variances across countries, illustrating the important role of effective openness-adjusted exchange rate trends in creating divergent financial conditions.
xcatx = ["REEROADJ_NSA_P1M60ML1", "REEROTADJ_NSA_P1M60ML1"]
msp.view_ranges(
dfd,
xcats=xcatx,
cids=cidx,
sort_cids_by="std",
start=start_date,
title="Boxplots for long-term openness-adjusted real appreciation metrics",
xcat_labels=["Merchandise trade", "Services and merchandise trade"],
kind="box",
size=(16, 8),
)
xcatx = ["REEROADJ_NSA_P1M60ML1", "REEROTADJ_NSA_P1M60ML1"]
cidx = cids_exp
msp.view_timelines(
dfd,
xcats=xcatx,
cids=cidx,
start=start_date,
title="Long-term openness-adjusted real effective appreciation trends",
xcat_labels=["Merchandise trade based", "National accounts based"],
title_adj=1.03,
title_xadj=0.43,
title_fontsize=27,
legend_fontsize=17,
label_adj=0.075,
ncol=4,
same_y=True,
size=(12, 7),
aspect=1.7,
all_xticks=True,
)
Importance #
Research links #
“We investigate the relationship between real effective exchange rates and growth explicitly taking into account balance sheet or external debt vulnerabilities…Our results suggest that, real effective depreciations are contractionary for developing economies with high external debt and expansionary for advanced economies. However, higher trade openness decreases the contractionary impact of depreciations in both advanced economies and developing economies. These results are robust for different real effective exchange rates and real income measures.” Duygu and Erdal
Empirical clues #
In accordance with the intuition that openness-adjusted appreciation reduces inflation and growth predictions, there is some evidence that real appreciation has positive short-term predictive power with respect to subsequent IRS returns.
xcatx = ["REEROADJ_NSA_P1W4WL1", "DU05YXR_NSA"]
cidx = list(set(cids_exp) - set(["BRL", "PEN", "PHP", "RON"]))
cr = msp.CategoryRelations(
dfd,
xcats=xcatx,
cids=cidx,
freq="W",
lag=1,
xcat_aggs=["mean", "sum"],
start="2000-01-01",
xcat_trims=[6, 20],
)
cr.reg_scatter(
title="Real short-term openness-adjusted appreciation and subsequent weekly IRS returns since 2000",
labels=False,
coef_box="lower right",
# prob_est="map",
ylab="5-year IRS returns (next week)",
xlab="Real appreciation last week versus previous 4 weeks",
# separator=2015,
)
Analogously, there is some evidence that real appreciation has negative short-term predictive power with respect to subsequent local equity index returns. Equity suffers through reduced growth prospects and lower foreign revenues in local currency terms.
xcatx = ["REEROADJ_NSA_P1W4WL1", "EQXR_NSA"]
cidx = list(
set(cids_exp)
- set(
[
"CLP",
"COP",
"CZK",
"HUF",
"IDR",
"ILS",
"NOK",
"NZD",
"PEN",
"PHP",
"RON",
"RUB",
]
)
)
cr = msp.CategoryRelations(
dfd,
xcats=xcatx,
cids=cidx,
freq="W",
lag=1,
xcat_aggs=["mean", "sum"],
start="2000-01-01",
xcat_trims=[6, 20],
)
cr.reg_scatter(
title="Real short-term openness-adjusted appreciation and subsequent weekly IRS returns since 2000",
labels=False,
coef_box="lower right",
# prob_est="map",
ylab="5-year IRS returns (next week)",
xlab="Real appreciation last week versus previous 4 weeks",
# separator=2015,
)
Appendices #
Appendix 1: Currency symbols #
The word ‘cross-section’ refers to currencies, currency areas or economic areas. In alphabetical order, these are AUD (Australian dollar), BRL (Brazilian real), CAD (Canadian dollar), CHF (Swiss franc), CLP (Chilean peso), CNY (Chinese yuan renminbi), COP (Colombian peso), CZK (Czech Republic koruna), DEM (German mark), ESP (Spanish peseta), EUR (Euro), FRF (French franc), GBP (British pound), HKD (Hong Kong dollar), HUF (Hungarian forint), IDR (Indonesian rupiah), ITL (Italian lira), JPY (Japanese yen), KRW (Korean won), MXN (Mexican peso), MYR (Malaysian ringgit), NLG (Dutch guilder), NOK (Norwegian krone), NZD (New Zealand dollar), PEN (Peruvian sol), PHP (Phillipine peso), PLN (Polish zloty), RON (Romanian leu), RUB (Russian ruble), SEK (Swedish krona), SGD (Singaporean dollar), THB (Thai baht), TRY (Turkish lira), TWD (Taiwanese dollar), USD (U.S. dollar), ZAR (South African rand).