Real effective appreciation #
This category group contains real-time versions of appreciation metrics. They are based on vintages of J.P. Morgan’s CPI-based effective exchange rate measures and estimates of deflators for recent weeks. Estimation is needed due to the publication lag of consumer price indices relative to nominal exchange rates.
Short-term real appreciation #
Ticker : REER_NSA_P1W4WL1
Label : Real effective appreciation, % of the latest week over previous 4 weeks.
Definition : Real effective exchange rate index, real-time, using estimates of recent CPIs, % increase of latest week (5 trading days) over previous 4 weeks (5-trading day periods).
Notes :
-
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 .
-
Real effective exchange rates take into account the role of high, rising, and often widely divergent inflation rates in offsetting or amplifying the economic impact of swings in bilateral nominal exchange rates. In the present case, real exchange rates use headline CPI to make the adjustment.
-
Time series’ of real effective exchange rate indices are continuously revised and updated as new CPI data is released for recent months. The real-time quantamental appreciation measure is calculated based on concurrent vintages and, thus, uses a prediction of CPIs for the latest month(s), based on a trend extrapolation formula.
-
The impact of revisions on short-term real effective appreciation is naturally much stronger than on medium-term appreciation measures.
Medium-term real appreciation #
Ticker : REER_NSA_P1M12ML1
Label : Real effective appreciation, % of the latest month over previous 12 months.
Definition : Real effective exchange rate index, real-time, using estimates of recent CPIs, % increase of latest month (21 trading days) over the previous 12 months (21 trading day periods).
Notes :
-
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 .
-
Real effective exchange rates take into account the role of high, rising, and often widely divergent inflation rates in offsetting or amplifying 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 is released for recent months. The real-time quantamental appreciation measure is calculated based on concurrent vintages and, thus, uses a prediction of CPIs for the latest month(s), based on a trend extrapolation formula.
-
This medium-term measure is particularly relevant as a predictor of the % changes in nominal indicators (such as consumer prices indices) over a year ago.
Longer-term real appreciation #
Ticker : REER_NSA_P1M60ML1
Label : Real effective appreciation, % of the latest month over previous 5 years.
Definition : Real effective exchange rate index, real-time, using estimates of recent CPIs, % increase of latest month (21 trading days) over the previous 5 years.
Notes :
-
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 offsetting or amplifying 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 are being 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), based on a trend extrapolation formula.
-
This long-term measure is particular relevant for capturing the impact of currency appreciation on competitiveness and investment conditions.
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 = ["REER_NSA_P1W4WL1", "REER_NSA_P1M12ML1", "REER_NSA_P1M60ML1"]
econ = ["FXCRR_VT10", "RIR_NSA"] # economic context
mark = [
"EQXR_NSA",
"FXXR_NSA",
"FXXRHvGDRB_NSA",
"FXXR_VT10",
"FXTARGETED_NSA",
"FXUNTRADABLE_NSA",
] # market links
xcats = main + 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,
end_date="2023-05-20",
metrics=["value", "eop_lag", "mop_lag", "grading"],
suppress_warning=True,
)
end = timer()
dfd = df
print("Download time from DQ: " + str(timedelta(seconds=end - start)))
Maximum number of tickers is 407
Downloading data from JPMaQS.
Timestamp UTC: 2023-07-19 14:47:31
Connection successful!
Number of expressions requested: 1628
Download time from DQ: 0:02:43.507014
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 REER_NSA_P1M12ML1: []
Missing cids for REER_NSA_P1M60ML1: []
Missing cids for REER_NSA_P1W4WL1: []
Quantamental indicators of real effective appreciation are available by 2000 for all presented currency areas.
For the explanation of currency symbols, which are related to currency areas or countries for which categories are available, please view Appendix 1 .
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, 2))
print("Last updated:", date.today())

Last updated: 2023-07-19
xcatx = main
cidx = cids_exp
plot = msm.check_availability(
dfd, xcats=xcatx, cids=cidx, start_size=(18, 2), start_years=False
)

Since the real effective appreciation indicators are based on J.P. Morgan estimates, all vintages are Grade 2.
xcatx = main
cidx = cids_exp
plot = msp.heatmap_grades(
dfd,
xcats=xcatx,
cids=cidx,
size=(18, 2),
title=f"Average vintage grades from {start_date} onwards",
)

xcatx = main
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=start_date,
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=start_date,
kind="box",
size=(16, 4),
)


History #
Short-term real appreciation #
Short-term real effective exchange rate swings have been widest in large EM countries. Some Asian economies with large external surpluses and exchange rate management have posted the smallest fluctions.
Short-term real appreciation or depreciation has occasionally exceeded 10% in EM countries. This implies that short-term exchange rate swings can cause a significant changes in economic conditions and can become a significant factor of economic divergences.
xcatx = ["REER_NSA_P1W4WL1"]
cidx = cids_exp
msp.view_ranges(
dfd,
xcats=xcatx,
cids=cidx,
sort_cids_by="std",
start=start_date,
kind="box",
title="Boxplots of short-term real effective exchange rate appreciation, % over 4 weeks ago, since 2000",
size=(16, 8),
)

xcatx = ["REER_NSA_P1W4WL1"]
cidx = cids_exp
msp.view_timelines(
dfd,
xcats=xcatx,
cids=cidx,
start=start_date,
title="Real effective exchange rate appreciation, % of the latest week over previous 4 weeks",
title_adj=1.03,
title_xadj=0.5,
title_fontsize=27,
legend_fontsize=17,
ncol=4,
same_y=False,
size=(12, 7),
aspect=1.7,
all_xticks=True,
)

For smaller countries, real effective exchange rate changes are predominantly against the US dollar, the Euro and the Chinese yen. This explains why the latter three currency areas post real currency trends that are negatively correlated with most other currency areas. Put simply, short-term real effective currency shifts often entail economic divergences between small and large currency areas.
xcatx = "REER_NSA_P1W4WL1"
cidx = cids_exp
msp.correl_matrix(
dfd,
xcats=xcatx,
cids=cidx,
size=(20, 14),
title="Cross-sectional correlations of short-term real effective exchange rate appreciation, since 2000",
cluster=True,
)

Medium-term real appreciation #
Medium-term appreciation rates also display vast differences across currencies. The swing frequency here corresponds to economic “minicycles”.
xcatx = ["REER_NSA_P1M12ML1"]
cidx = cids_exp
msp.view_ranges(
dfd,
xcats=xcatx,
cids=cidx,
sort_cids_by="std",
start=start_date,
title="Boxplots of medium-term real effective exchange rate appreciation, % over a year ago, since 2000",
kind="box",
size=(16, 8),
)

xcatx = ["REER_NSA_P1M12ML1"]
cidx = cids_exp
msp.view_timelines(
dfd,
xcats=xcatx,
cids=cidx,
start=start_date,
title="Real effective appreciation, % of the latest month over previous 12 months",
title_fontsize=27,
legend_fontsize=17,
title_adj=1.02,
title_xadj=0.51,
ncol=4,
same_y=False,
size=(12, 7),
aspect=1.7,
all_xticks=True,
)

Long-term real appreciation #
The long-term real appreciation metric has displayed the widest fluctuations in some large EM countries. The frequency of these swings correpond to standard business cycle lengths.
xcatx = ["REER_NSA_P1M60ML1"]
cidx = cids_exp
msp.view_ranges(
dfd,
xcats=xcatx,
cids=cidx,
sort_cids_by="std",
start=start_date,
title="Boxplots of long-term real effective exchange rate appreciation, % over 5 years ago, since 2000",
kind="box",
size=(16, 8),
)

xcatx = ["REER_NSA_P1M60ML1", "REER_NSA_P1M12ML1"]
cidx = cids_exp
msp.view_timelines(
dfd,
xcats=xcatx,
cids=cidx,
start=start_date,
title="Long and medium term real effective appreciation",
title_adj=1.03,
title_fontsize=27,
legend_fontsize=17,
title_xadj=0.43,
label_adj=0.075,
xcat_labels=["Long term (% over 5 years ago)", "Medium term (% over a year ago)"],
ncol=4,
same_y=False,
size=(12, 7),
aspect=1.7,
all_xticks=True,
)

Importance #
Research links #
“New empirical research provides guidance as to how to use real exchange rates for currency strategies. First, real exchange rates can serve as a basis for value-based strategies, but only if they are adjusted for key secular structural factors, such as productivity growth and product quality. Second, real exchange rates in conjunction with macroeconomic indicators can serve as indicators for the risk premia paid on currency positions.” Macrosynergy
Empirical clues #
Historically, there has been some evidence of a negative long-term relation between real effective currency strength and subsequent medium-term FX returns.
dfb = dfd[dfd["xcat"].isin(["FXTARGETED_NSA", "FXUNTRADABLE_NSA"])].loc[
:, ["cid", "xcat", "real_date", "value"]
]
dfba = (
dfb.groupby(["cid", "real_date"])
.aggregate(value=pd.NamedAgg(column="value", aggfunc="max"))
.reset_index()
)
dfba["xcat"] = "FXBLACK"
fxblack = msp.make_blacklist(dfba, "FXBLACK")
fxblack
{'BRL': (Timestamp('2012-12-03 00:00:00'), Timestamp('2013-09-30 00:00:00')),
'CHF': (Timestamp('2011-05-02 00:00:00'), Timestamp('2016-06-30 00:00:00')),
'CNY': (Timestamp('2000-01-03 00:00:00'), Timestamp('2023-05-19 00:00:00')),
'CZK': (Timestamp('2014-01-01 00:00:00'), Timestamp('2017-07-31 00:00:00')),
'ILS': (Timestamp('2000-01-03 00:00:00'), Timestamp('2005-12-30 00:00:00')),
'INR': (Timestamp('2000-01-03 00:00:00'), Timestamp('2004-12-31 00:00:00')),
'MYR_1': (Timestamp('2000-01-03 00:00:00'), Timestamp('2007-11-30 00:00:00')),
'MYR_2': (Timestamp('2018-07-02 00:00:00'), Timestamp('2023-05-19 00:00:00')),
'PEN': (Timestamp('2021-07-01 00:00:00'), Timestamp('2021-07-30 00:00:00')),
'RON': (Timestamp('2000-01-03 00:00:00'), Timestamp('2005-11-30 00:00:00')),
'RUB_1': (Timestamp('2000-01-03 00:00:00'), Timestamp('2005-11-30 00:00:00')),
'RUB_2': (Timestamp('2022-02-01 00:00:00'), Timestamp('2023-05-19 00:00:00')),
'SGD': (Timestamp('2000-01-03 00:00:00'), Timestamp('2023-05-19 00:00:00')),
'THB': (Timestamp('2007-01-01 00:00:00'), Timestamp('2008-11-28 00:00:00')),
'TRY_1': (Timestamp('2000-01-03 00:00:00'), Timestamp('2003-09-30 00:00:00')),
'TRY_2': (Timestamp('2020-01-01 00:00:00'), Timestamp('2023-05-19 00:00:00'))}
xcatx = ["REER_NSA_P1M60ML1", "FXXR_NSA"]
cidx = list(set(cids_exp) - set(["USD"]))
cr = msp.CategoryRelations(
dfd,
xcats=xcatx,
cids=cidx,
freq="Q",
lag=1,
xcat_aggs=["last", "sum"],
fwin=1,
blacklist=fxblack,
start="2000-01-01",
)
cr.reg_scatter(
title="Real long-term appreciation and subsequent quarterly FX returns since 2000",
labels=False,
prob_est="map",
coef_box="upper right",
ylab="Quarterly FX forward return",
xlab="Estimated long-term real appreciation (latest month, % over previous 5 years)",
)

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).