= (
JPY 'JPY=X',
yf.download(='2000-01-01')
start
.reset_index()={'Close': 'USD/JPY'})
.rename(columnsfilter(items=['Date', 'USD/JPY'])
. )
Exchange Rates
The Dollar
In our Chapter on interest rates, we noted that interest rates can be thought of as the most important price in the world, the price of money or the price of time. The interest rate policy set by the Fed impacts the price of money for the U.S. Dollar but also for other currencies in the world because any currency can be priced in terms of another currency, this is what an exchange rate represents. When the Fed alters the price of the U.S. Dollar through its interest rate choices, the relative price of other currencies is also affected. Given that the U.S. Dollar is the reserve currency for the world (i.e. the currency against which other currencies are measured), any action by the Fed carries important implications for exchange rates.1
For an example, let’s have a look at the exchange rate between the Japanese Yen (JPY) and the U.S. Dollar (USD). When we talk about exchange rates, it’s important to note that there are two ways to express them: how many JPY does it take to buy 1 USD; or, how many USD does it take to buy 1 JPY. The convention in exchange rates is to express currency quotes as BASE/QUOTE where you receive 1 unit of the BASE currency for a variable amount of the QUOTE currency. For example, if we have USD/JPY = 135 it means you can exchange 1 USD for 135 JPY; of course we would also have JPY/USD = 1/135.2 Most exchange rate quotes use the USD as the base currency though notable exceptions are the Euro (EUR) and the British Pound (GBP).
We can obtain historical exchange rate information from Yahoo! Finance using the yfinance
package. We pull the Japanese Yen quote with the U.S Dollar as base currency using the symbol “JPY=X”.
Date USD/JPY
0 2000-01-03 101.690002
1 2000-01-04 103.139999
2 2000-01-05 104.089996
3 2000-01-06 105.230003
4 2000-01-07 105.330002
Let’s now have a look at the USD/JPY exchange rate. One small technical note, to get the Yen symbol in our y-axis we need to find the unicode character code for yen, which is “u00a5”, and include it in our labelExpr
.
(
alt.Chart(JPY,=alt.Title(
title'USD/JPY Exchange Rate',
= 'source: Yahoo! Finance'))
subtitle
.mark_line()
.encode('Date:T')
alt.X(None),
.title('USD/JPY:Q')
alt.Y(None)
.title(=False)
.scale(zero='"\u00a5" + datum.value')
.axis(labelExpr
) )
Note that exchange rate charts are somewhat peculiar. The USD/JPY rate almost halves from 2002 until 2012. If this was a stock price chart we would conclude the JPY struggled mightily during this period, but because this an exchange rate where the JPY is the quote currency it actually means the JPY outperformed the USD. Back in 2002, 1 USD bought about 135 JPY, but by 2012 1 USD could only buy about 75 JPY; we say the JPY strengthened against the USD. For this reason, exchange rate plots sometimes have an inverted scale in the y-axis, so that when the quote currency strengthens the plot goes up instead of down. We can easily code an inverted scale in Altair
by using the reverse=True
in the scale
argument, as we do below.
(
alt.Chart(JPY,=alt.Title(
title'USD/JPY Exchange Rate (inverted scale)',
= 'source: Yahoo! Finance'))
subtitle
.mark_line()
.encode('Date:T')
alt.X(None),
.title('USD/JPY:Q')
alt.Y(None)
.title(=False,
.scale(zero=True)
reverse='"\u00a5" + datum.value')
.axis(labelExpr
) )
When we invert the scale on the y-axis, it is now straightforward to see the Yen outperformed the U.S. Dollar from 2002 until 2012, but has since substantially weakened, specially in 2021 and 2022. As the Fed increased U.S. Dollar rates to fight inflation, the Bank of Japan kept Yen denominated rates low, this diverging rates made the USD more attractive for investment vis-a-vis the JPY which contributed to the Yen’s sudden drop.
The DXY
Conclusion
Footnotes
Readers with an Economics academic background will recall that one of the foundational theories of exchange rate determination is the interest rate parity.↩︎
More information on the basics of the foreign exchange market can be found in the CME’s Introduction to FX lessons at https://www.cmegroup.com/education/courses/introduction-to-fx/what-is-fx.html↩︎