$npx -y skills add SKE-Labs/agent-trading-skills --skill market-correlation-tradingMeasure time-varying cross-asset correlation, beta, lead-lag, and spread stationarity. Use when evaluating hedges, common factors, regime breaks, divergences, or convergence hypotheses.
| 1 | # Market Correlation Trading |
| 2 | |
| 3 | Measure time-varying co-movement and test whether a hedge, factor exposure, or stationary spread exists. Divergence can reflect a regime change; correlation alone does not imply convergence, causation, or lead-lag. |
| 4 | |
| 5 | ## Measurement |
| 6 | |
| 7 | - Align exchange calendars, timestamps, currencies, and return intervals; do not correlate price levels. |
| 8 | - Compute rolling Pearson and rank correlation over predeclared short and long windows, with confidence intervals and enough observations. |
| 9 | - Estimate rolling beta or a multi-factor model when the objective is hedging. |
| 10 | - Require an economically linked, stationary spread and out-of-sample half-life before proposing convergence. |
| 11 | - Test lead-lag with lagged returns while controlling common factors and multiple comparisons. |
| 12 | |
| 13 | ## Divergence Signals |
| 14 | |
| 15 | | Scenario | Signal | |
| 16 | | --- | --- | |
| 17 | | BTC rallies but Nasdaq flat/down | BTC overextended, watch for pullback | |
| 18 | | Gold falls but real yields also fall | Gold undervalued, potential buy | |
| 19 | | Oil rises but energy stocks lag | Energy stocks may catch up | |
| 20 | | VIX rises but S&P holds | Hedging without selling, watch for resolution | |
| 21 | |
| 22 | Use 20/60 bars only as example windows. Calibrate the windows and breakdown threshold in training data, then report estimates, uncertainty, and observation count. |
| 23 | |
| 24 | ## Lead-Lag Hypotheses |
| 25 | |
| 26 | For every proposed leader/follower pair, state the economic mechanism, data clock, lags tried, common-factor controls, and held-out result. Never copy a fixed lag table into a trade. |
| 27 | |
| 28 | ## Regime-Dependent Correlations |
| 29 | |
| 30 | | Regime | Correlation Behavior | |
| 31 | | --- | --- | |
| 32 | | Risk-on (normal) | Traditional correlations hold | |
| 33 | | Risk-off (crisis) | Everything correlates -- stocks, crypto, commodities drop; only USD/treasuries/gold rise | |
| 34 | | Inflation | Stocks and bonds fall together (atypical positive correlation) | |
| 35 | | Deflation | Stocks fall, bonds rise (traditional inverse) | |
| 36 | |
| 37 | ## Workflow |
| 38 | |
| 39 | ### 1. Check Related Assets |
| 40 | |
| 41 | ``` |
| 42 | get_candles(symbol="SPY", exchange=<exchange>, interval="1D", count=250) |
| 43 | get_candles(symbol="QQQ", exchange=<exchange>, interval="1D", count=250) |
| 44 | get_candles(symbol="TLT", exchange=<exchange>, interval="1D", count=250) |
| 45 | get_candles(symbol="GLD", exchange=<exchange>, interval="1D", count=250) |
| 46 | ``` |
| 47 | |
| 48 | Compare recent performance (1W, 1M, 3M) across correlated pairs. |
| 49 | |
| 50 | ### 2. Research Macro Context |
| 51 | |
| 52 | ``` |
| 53 | get_financial_news(topic="correlation stocks bonds regime shift <current year>", max_results=10) |
| 54 | get_economics_calendar(from_date=<start>, to_date=<end>, impact="high") |
| 55 | ``` |
| 56 | |
| 57 | Determine whether current correlations are driven by Fed policy, inflation, or event-specific factors. High-impact macro events can trigger regime shifts. |
| 58 | |
| 59 | ### 3. Identify and Report Divergences |
| 60 | |
| 61 | Report return definition, windows, estimates/uncertainty, beta/factor exposures, divergence z-score, stationarity result, costs, and `hedge`, `watch`, or `no trade`. Do not call an asset mispriced from correlation alone. |
| 62 | |
| 63 | ## Evidence and Validation |
| 64 | |
| 65 | - Treat the setup as a testable hypothesis, not a prediction. Define thresholds, entry, invalidation, and exit before evaluating outcomes. |
| 66 | - Calibrate on the same instrument, venue, session, and timeframe. Use closed candles and a held-out or walk-forward sample; record every variant tried. |
| 67 | - Include spread, fees, slippage, borrow or funding, partial fills, and latency. Reject the setup when net expectancy is not positive or depends on one narrow parameter. |
| 68 | - Return observed inputs, missing data, cost assumptions, entry, invalidation, exit, and a valid, watch, or no-trade status. |
| 69 | - Research basis: [Ang & Bekaert](https://www.nber.org/papers/w7056) finds correlations and volatilities vary by regime and often rise in bad times; a static correlation table is not a trading signal. |
| 70 | |
| 71 | ## Key Rules |
| 72 | |
| 73 | - Never assume correlations are permanent; show rolling estimates and adverse stresses toward +1 or -1. |
| 74 | - Include macro/factor regime and stress correlations; diversification can weaken without every asset moving together. |
| 75 | - Aggregate positions with shared beta/factor/scenario risk rather than relying on one pair correlation. |
| 76 | - Correlation is not causation or convergence; control for common drivers where possible. |
| 77 | - When a historical relationship changes, test for a regime break before proposing convergence. |
| 78 | |
| 79 | ## Related Skills |
| 80 | |
| 81 | - **sector-rotation** -- Sector correlations reveal rotation opportunities |
| 82 | - **economic-calendar-trading** -- Macro events drive correlation regime shifts |