Quant BuffetRelax, Not Over Thinking

Conditional FX Correlation Risk

Log in to collect

Academic paper

Dynamic Allocations for Currency Investment Strategies

AuthorsKei Nakagawa; Ryuta Sakemoto

Institute
  • JPNomura Holdings (Japan)
  • ?Nomura Asset Mamagement Co,Ltd
  • JPOkayama University
  • JPKeio University

Strategy in a nutshell

The dataset consists of daily spot and one-month forward exchange rates sourced from Datastream, analyzed from the perspective of a U.S. investor with the U.S. dollar as the base currency. Conditional correlations between FX spot rate changes are estimated over rolling three-month windows across nine FX pairs, generating 36 correlation measures.

At each month-end, the correlations are ranked into deciles, and the cross-sectional dispersion of conditional FX correlations (FXC) is calculated as the difference between the top and bottom deciles. The innovation in FXC (ΔFXC) is then extracted. Currency pairs are sorted based on their factor betas with respect to ΔFXC, and three portfolios are constructed: long in low-beta currencies, short in high-beta currencies, with the intermediate group excluded.

Currency excess returns are measured using forward premiums: for long positions, as the difference between the bid price of the one-month forward and the spot ask price (scaled by the ask); and for short positions, as the difference between the spot bid and the one-month forward ask (scaled by the bid). The total portfolio excess return equals the sum of long and short position excess returns.

Economic rationale

The strategy builds on Mueller et al. (2017), who show that FX correlations become more dispersed during periods of financial stress: high-correlation pairs become even more correlated, while low-correlation pairs diverge. This widening of the cross-section creates priced risk exposure.

Currencies that serve as hedges in stressful periods (high-beta pairs with respect to ΔFXC) deliver lower average returns in normal times, while currencies that perform poorly in stress (low-beta pairs) deliver higher average returns. The negative relation between ΔFXC betas and excess returns supports the presence of a priced FX correlation risk factor. Thus, the strategy profits from systematically exploiting this risk premium embedded in cross-sectional FX correlation dynamics.

Backtest performance

Annualised return2.91%
Volatility8.32%
Beta-0.024
Sharpe ratio0.35
Sortino ratio0.181
Win rate66%

Full Python code

from AlgorithmImports import *
import data_tools
import statsmodels.api as sm
# endregion

class ConditionalFXCorrelationRisk(QCAlgorithm):

def Initialize(self):
self.SetStartDate(2000, 7, 1)
self.SetCash(100000)

self.quantpedia_futures:bool = False
self.leverage:int = 5

self.tickers:list[str] = [
    'CME_AD1', 'CME_BP1', 'CME_NE1',
    'CME_CD1', 'CME_SF1', 'CME_JY1'
]

if not self.quantpedia_futures:
    self.tickers = [
        'AUDUSD', 'GBPUSD', 'NZDUSD', 'USDCAD',
        'USDCHF', 'USDCNH', 'USDCZK', 'USDDKK',
        'USDHUF', 'USDINR', 'USDJPY', 'USDNOK',
        'USDPLN', 'USDSAR', 'USDSEK', 'USDTHB',
        'USDTRY',
    ]

self.corr_period:int = 66 + 1       # need n days of daily closes
self.regression_period:int = 36     # need m monthly values
self.min_prices:int = 15            # need l daily prices in one month
self.max_missing_days:int = 15

self.quantile:int = 10
self.traded_currency_count:int = 2

self.fxc_beta_index:int = 1
self.prev_fxc:float = None
self.fxc_delta_values:RollingWindow = RollingWindow[float](self.regression_period)
self.data:dict[Symbol, SymbolData] = {}

for ticker in self.tickers:
    security = self.AddData(data_tools.QuantpediaFutures, ticker, Resolution.Daily) if self.quantpedia_futures \
            else self.AddForex(ticker, Resolution.Daily, Market.Oanda)
    
    if self.quantpedia_futures:
        security.SetFeeModel(data_tools.CustomFeeModel())
    security.SetLeverage(self.leverage)
    
    symbol:Symbol = security.Symbol
    self.data[symbol] = data_tools.SymbolData(self.corr_period, self.regression_period)

self.recent_month:int = -1

def OnData(self, data: Slice):
curr_date:datetime.date = self.Time.date()

# update daily prices
for symbol, symbol_obj in self.data.items():
    if symbol in data and data[symbol] and data[symbol].Value != 0:
        symbol_obj.update_prices(data[symbol].Value, curr_date)

# rebalance monthly
if self.recent_month == self.Time.month:
    return
self.recent_month = self.Time.month

corr_ready_currencies:list[Symbol] = []
for symbol, symbol_obj in self.data.items():
    # reset currencies, which prices stopped coming, because data are required consecutive
    if symbol_obj.data_still_coming(curr_date, self.max_missing_days) and symbol_obj.curr_monthly_prices_ready(self.min_prices):
        symbol_obj.update_monthly_returns()
    else:
        # monthly prices have to be consecutive for regression
        symbol_obj.reset_prices_and_monthly_returns()

    # filter only currencies, which prices are ready for correlation calculation
    if symbol_obj.correlation_prices_ready():
        corr_ready_currencies.append(symbol)

    symbol_obj.reset_curr_month_prices()

total_ready_currencies:int = len(corr_ready_currencies)
correlations:list[float] = []

for i in range(total_ready_currencies):
    symbol1:Symbol = corr_ready_currencies[i]
    returns1:list[float] = self.data[symbol1].get_daily_returns()

    for j in range(i + 1, total_ready_currencies, 1):
        symbol2:Symbol = corr_ready_currencies[j]
        returns2:list[float] = self.data[symbol2].get_daily_returns()

        correlation:float = np.corrcoef(returns1, returns2)[0][1]
        correlations.append(correlation)

if len(correlations) < self.quantile:
    # regression data has to be consecutive
    self.fxc_delta_values.Reset()
    self.prev_fxc = None
    self.Liquidate()
    return

correlations.sort()
quantile:int = int(len(correlations) / self.quantile)
top_part_sum:float = sum(correlations[-quantile:])
bottom_part_sum:float = sum(correlations[:quantile])

fxc:float = top_part_sum - bottom_part_sum
if self.prev_fxc != None: # previous value of FXC factor is required in FXC delta calculation
    # take the innovation part of FXC
    fxc_delta:float = fxc - self.prev_fxc
    # fxc_delta:float = fxc / self.prev_fxc - 1
    self.fxc_delta_values.Add(fxc_delta)
self.prev_fxc = fxc

if not self.fxc_delta_values.IsReady:
    self.Liquidate()
    return

beta_fxc_by_symbols:dict[Symbol, float] = {}
regression_x:list[float] = list(self.fxc_delta_values)

for symbol, symbol_obj in self.data.items():
    if not symbol_obj.monthly_returns_ready():
        continue

    regression_y:list[float] = symbol_obj.get_monthly_returns()

    regression_model = self.MultipleLinearRegression(regression_x, regression_y)

    beta_fxc:float = regression_model.params[self.fxc_beta_index]

    beta_fxc_by_symbols[symbol] = beta_fxc

if len(beta_fxc_by_symbols) < (self.traded_currency_count * 2):
    self.Liquidate()
    return

# the low (high) beta currency pairs are in the long (short) position
sorted_by_beta_fxc:list[Symbol] = [x[0] for x in sorted(beta_fxc_by_symbols.items(), key=lambda item: item[1])]
long_leg:list[Symbol] = sorted_by_beta_fxc[:self.traded_currency_count]
short_leg:list[Symbol] = sorted_by_beta_fxc[-self.traded_currency_count:]

# trade execution
invested:list[Symbol] = [x.Key for x in self.Portfolio if x.Value.Invested]
for symbol in invested:
    if symbol not in long_leg + short_leg:
        self.Liquidate(symbol)

for symbol in long_leg:
    weight:float = 1 / self.traded_currency_count

    if symbol.Value[:3] == 'USD':
        weight = weight * -1

    self.SetHoldings(symbol, weight)

for symbol in short_leg:
    weight:float = -1 / self.traded_currency_count
    
    if symbol.Value[:3] == 'USD':
        weight = weight * -1

    self.SetHoldings(symbol, weight)

def MultipleLinearRegression(self, x:list, y:list):
x:np.array = np.array(x).T
x = sm.add_constant(x)
result = sm.OLS(endog=y, exog=x).fit()
return result