FX: dollar & cross-asset
For cross-asset allocators and macro strategists
The dollar against gold, equities and itself: correlations, betas and pair relationships, joined on daily bars.
- Financial markets
- 6 steps
- Runs on live data
How EquationDB answers it
Each step is one query on live data. Run them in order, or open any one and adapt it: change the symbol, the station, the dates or the filter.
Dollar strength vs gold
An equal-weight dollar index built from the seven majors (sign-flipped where the dollar is the quote currency), against gold.
WITH fx AS (SELECT timestamp, CASE WHEN starts_with(symbol, 'USD') THEN ret ELSE -ret END AS usd_ret FROM bars WHERE symbol IN ('EURUSD', 'USDJPY', 'GBPUSD', 'USDCHF', 'AUDUSD', 'USDCAD', 'NZDUSD') AND timestamp >= '2025-01-01'), usd AS (SELECT timestamp, avg(usd_ret) AS usd FROM fx GROUP BY timestamp), g AS (SELECT timestamp, ret AS gold FROM bars WHERE symbol = 'GLD' AND timestamp >= '2025-01-01') SELECT corr(usd.usd, g.gold) AS corr, beta(g.gold, usd.usd) AS gold_beta_to_usd, count(*) AS days FROM usd JOIN g ON usd.timestamp = g.timestampA daily dollar index
The equal-weight dollar return per day this year. Chart its running sum for a simple DXY-style line.
SELECT timestamp, avg(CASE WHEN starts_with(symbol, 'USD') THEN ret ELSE -ret END) AS usd_ret FROM bars WHERE symbol IN ('EURUSD', 'USDJPY', 'GBPUSD', 'USDCHF', 'AUDUSD', 'USDCAD', 'NZDUSD') AND timestamp >= '2026-01-01' GROUP BY timestamp ORDER BY timestampCurrencies, stocks and gold: correlations
One year of pairwise return correlations: AUD usually tracks risk appetite, the yen often moves against it.
ANALYZE correlation (EURUSD, USDJPY, AUDUSD, SPY, GLD) LAST 1y
Is the yen still a haven?
A positive beta of USDJPY to SPY means the yen weakens when stocks rise and strengthens when they fall: the haven behaviour.
WITH j AS (SELECT timestamp, ret AS usdjpy FROM bars WHERE symbol = 'USDJPY' AND timestamp >= '2024-01-01'), s AS (SELECT timestamp, ret AS spy FROM bars WHERE symbol = 'SPY' AND timestamp >= '2024-01-01') SELECT corr(j.usdjpy, s.spy) AS corr, beta(j.usdjpy, s.spy) AS beta_to_spy, count(*) AS days FROM j JOIN s ON j.timestamp = s.timestamp
EURUSD vs GBPUSD as a pair
Hedge ratio, correlation, the spread's z-score and its half-life: the check before trading EUR against GBP through the dollar legs.
ANALYZE pairs EURUSD VS GBPUSD
Majors side by side
Returns, volatility, drawdown and Sharpe ratio for four majors over the same window.
ANALYZE compare (EURUSD, GBPUSD, USDJPY, AUDUSD)
Run it on your own question
Sign in and press Try it on any step, or ask for a short demo on your data.
More financial markets use cases
- Global & emerging markets: Dubai vs USEM funds, Gulf allocators, global macro PMs
- FX: market snapshotFX traders, macro desks and treasury teams
- FX: trend & momentumFX trend followers and systematic macro
- FX: volatility & riskFX risk managers, options traders and treasury
- FX: backtests & seasonalitySystematic FX traders