market-correlation-trading
Skill17 starsChanged 4 months agoApache-2.0View on GitHub
Measure time-varying cross-asset correlation, beta, lead-lag, and spread stationarity. Use when evaluating hedges, common factors, regime breaks, divergences, or convergence hypotheses.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- IngAs8/ClaudeSkilledited, first seen Sep 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- IngAs8/ClaudeSkill★ 026% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository56 other files it gives its agents.
- candlestick-patternsSkill
- channel-tradingSkill
- cup-and-handleSkill
- double-top-bottomSkill
- flag-pennantSkill
- head-and-shouldersSkill
- triangle-patternsSkill
- wedge-patternsSkill
- altcoin-rotationSkill
- arbitrage-tradingSkill
- dca-strategySkill
- funding-rate-tradingSkill
- on-chain-analysisSkill
- breakout-tradingSkill
- gap-tradingSkill
- momentum-tradingSkill
- news-tradingSkill
- pullback-tradingSkill
- range-tradingSkill
- scalping-strategySkill
- earnings-tradingSkill
- economic-calendar-tradingSkill
- insider-activity-tradingSkill
- sector-rotationSkill
- sentiment-analysisSkill
- breaker-blocksSkill
- fair-value-gapsSkill
- kill-zonesSkill
- liquidity-zonesSkill
- market-structure-shiftSkill
- optimal-trade-entrySkill
- order-blocksSkill
- premium-discountSkill
- correlation-riskSkill
- drawdown-managementSkill
- leverage-managementSkill
- partial-profit-takingSkill
- position-sizingSkill
- risk-reward-ratioSkill
- stop-loss-strategiesSkill
- trailing-stopSkill
- bollinger-bandsSkill
- divergence-tradingSkill
- fibonacci-tradingSkill
- ichimoku-cloudSkill
- macd-tradingSkill
- market-regime-detectionSkill
- mean-reversionSkill
- moving-average-crossoverSkill
- multi-timeframe-analysisSkill
- rsi-divergenceSkill
- stochastic-tradingSkill
- supply-demand-zonesSkill
- volume-profile-tradingSkill
- vwap-tradingSkill
- skill-nameSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Test lead-lag with lagged returns while controlling common factors and multiple comparisons.
- Distinctive: line 31
Use 20/60 bars only as example windows.
- Distinctive: line 74
Treat the setup as a testable hypothesis, not a prediction.
- Distinctive: line 82
Never assume correlations are permanent.
- Distinctive: line 86
When a historical relationship changes, test for a regime break before proposing convergence.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Market Correlation Trading
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.
Measurement
- Align exchange calendars, timestamps, currencies, and return intervals; do not correlate price levels.
- Compute rolling Pearson and rank correlation over predeclared short and long windows, with confidence intervals and enough observations.
- Estimate rolling beta or a multi-factor model when the objective is hedging.
- Require an economically linked, stationary spread and out-of-sample half-life before proposing convergence.
- Test lead-lag with lagged returns while controlling common factors and multiple comparisons.
Divergence Signals
| Scenario | Signal |
| BTC rallies but Nasdaq flat/down | BTC overextended, watch for pullback |
| Gold falls but real yields also fall | Gold undervalued, potential buy |
| Oil rises but energy stocks lag | Energy stocks may catch up |
| VIX rises but S&P holds | Hedging without selling, watch for resolution |
Use 20/60 bars only as example windows. Calibrate the windows and breakdown threshold in training data, then report estimates, uncertainty, and observation count.
Lead-Lag Hypotheses
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.
Regime-Dependent Correlations
| Regime | Correlation Behavior |
| Risk-on (normal) | Traditional correlations hold |
| Risk-off (crisis) | Everything correlates -- stocks, crypto, commodities drop; only USD/treasuries/gold rise |
| Inflation | Stocks and bonds fall together (atypical positive correlation) |
| Deflation | Stocks fall, bonds rise (traditional inverse) |
Workflow
1. Check Related Assets
get_candles(symbol="SPY", exchange=<exchange>, interval="1D", count=250)
get_candles(symbol="QQQ", exchange=<exchange>, interval="1D", count=250)
get_candles(symbol="TLT", exchange=<exchange>, interval="1D", count=250)
get_candles(symbol="GLD", exchange=<exchange>, interval="1D", count=250)Compare recent performance (1W, 1M, 3M) across correlated pairs.
2. Research Macro Context
get_financial_news(topic="correlation stocks bonds regime shift <current year>", max_results=10)
get_economics_calendar(from_date=<start>, to_date=<end>, impact="high")Determine whether current correlations are driven by Fed policy, inflation, or event-specific factors. High-impact macro events can trigger regime shifts.
3. Identify and Report Divergences
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.
Evidence and Validation
- Treat the setup as a testable hypothesis, not a prediction. Define thresholds, entry, invalidation, and exit before evaluating outcomes.
- Calibrate on the same instrument, venue, session, and timeframe. Use closed candles and a held-out or walk-forward sample; record every variant tried.
- 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.
- Return observed inputs, missing data, cost assumptions, entry, invalidation, exit, and a valid, watch, or no-trade status.
- Research basis: Ang & Bekaert finds correlations and volatilities vary by regime and often rise in bad times; a static correlation table is not a trading signal.
Key Rules
- Never assume correlations are permanent; show rolling estimates and adverse stresses toward +1 or -1.
- Include macro/factor regime and stress correlations; diversification can weaken without every asset moving together.
- Aggregate positions with shared beta/factor/scenario risk rather than relying on one pair correlation.
- Correlation is not causation or convergence; control for common drivers where possible.
- When a historical relationship changes, test for a regime break before proposing convergence.
Related Skills
- sector-rotation -- Sector correlations reveal rotation opportunities
- economic-calendar-trading -- Macro events drive correlation regime shifts
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

