EquationDB

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.

  1. 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.timestamp
    Try it →
  2. A 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 timestamp
    Try it →
  3. Currencies, 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
    Try it →
  4. 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
    Try it →
  5. 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
    Try it →
  6. Majors side by side

    Returns, volatility, drawdown and Sharpe ratio for four majors over the same window.

    ANALYZE compare (EURUSD, GBPUSD, USDJPY, AUDUSD)
    Try it →

Run it on your own question

Sign in and press Try it on any step, or ask for a short demo on your data.

Request a trial

More financial markets use cases