Asset Correlation
The Correlation Grid reads your chart asset and returns its correlated partners with the correct exchange prefixes and the correct inversion flags, in one function call.
Asset Correlation
The correlated asset problem, solved once
01 / The problem
Cross-asset analysis fails on the plumbing
A cross-asset tool compares your chart asset with its correlated assets. Before it can do this, it must know four things.
If you enter the tickers by hand, you must enter them again after each chart change. One wrong ticker shows a divergence that does not exist.
- Which assets correlate with this one?
- The answer is different for each asset class.
- What is the exact ticker?
- The exchange prefix is part of the ticker, for example CME_MINI:ES1!.
- Does this asset move against mine?
- DXY moves against EURUSD. Without an inversion flag, the tool reads each agreement as a disagreement.
- Do the session and the back adjustment match?
- If they do not match, a futures leg compares a different time window.
The trader selects Auto and stops thinking about it.
02 / What it returns
One call, one resolved configuration
The Library reads the chart asset and returns its correlated assets. Each leg has its exchange prefix and its inversion flag. A futures leg also has the chart session and the back adjustment.
The Library uses a fixed table of asset groups. It does not calculate correlation, it requests no data, and it draws nothing.
Chart: CME_MINI:NQ1! → Asset 2: CME_MINI:ES1!
Mode: Triad Asset 3: CBOT_MINI:YM1!
Detected: yes
Category: index_futures03 / Leg Resolution
Leg Resolution — the five modes
The mode sets how many legs the Library returns. A leg is one asset in the comparison, and the chart asset is the first leg.
If a symbol has no result for the selected mode, the Library returns the Triad result.
- Dyad
- The chart asset and one partner.
- Triad
- The default. The chart asset and two partners.
- Triad (GXT)
- A different group of three. Metals use their currency crosses. Index futures use NQ, ES, and YM.
- Tetrad
- The chart asset and three partners, where a fourth leg exists.
- Hybrid
- The Tetrad result, but NQ, ES, and RTY return three legs.
04 / Coverage
Every supported market
A micro contract chart gets the full-size contracts as its legs. For example, an MNQ chart returns ES1!.
- Index futures
- NQ, ES, YM, RTY, and the micro contracts MNQ, MES, MYM, M2K
- Metal futures
- GC, SI, HG, and the micro contracts MGC, SIL, MHG
- Forex futures
- 6E, 6B, 6C, and the micro contracts M6E, M6B, M6C
- Energy futures
- CL, RB, HO, and the micro contracts MCL, MRB, MHO
- Treasury futures
- ZB, ZF, ZN
- Crypto futures
- BTC, ETH, and the micro contracts MBT, MET
- Forex CFD
- EURUSD, GBPUSD, DXY, USDJPY, USDCHF, USDCAD
- Metals CFD
- XAUUSD, XAGUSD, COPPER
- Metal crosses
- XAUEUR, XAUGBP, XAGEUR, XAGGBP
- CFD indices
- NAS100, SP500, DJ30
- EU stocks
- GER40, EU50 — dyad only, no third leg
- Crypto
- BTC, ETH, SOL, XRP, DOGE, ADA, BNB, TAO, ZEC
05 / Why it is free
Free on purpose
The Library is free and open source on TradingView. Any developer can import it.
Po3, QT, Every Gap, and Lathyrus all use the same Library. Its results are published, so you can examine them before you trust the paid tools.
01 / The configuration
What the configuration carries
The returned configuration has these fields:
- detected
- True when the Library recognizes the chart asset
- primary
- The chart ticker, in every mode
- secondary
- The second leg
- tertiary
- The third leg. Empty in Dyad
- quaternary
- The fourth leg. Tetrad and Hybrid only
- invertSecondary / invertTertiary / invertQuaternary
- True when that leg moves against the chart asset
- isTriadMode / isQuadMode
- How many legs the Library returned
- assetCategory
- The category tag, for example index_futures
02 / Auto Mode Matrix
The published result table
The Auto Mode Matrix shows which legs each symbol returns in each mode. The full Matrix is in the source file, above the main resolver.
Metals use Tetrad first, then GXT, then Triad. Index futures ignore GXT when Tetrad is on. Hybrid has the same priority as Tetrad.
V14 · All four tools call it
Auto Mode Matrix
For every supported symbol, in every mode, the source states exactly which legs come back, with exchange prefixes.
Modes
5
Asset classes
6 futures + 6 CFD
License
MPL 2.0
Selected results
| Chart | Leg 2 | Leg 3 | Leg 4 |
|---|---|---|---|
| NQ1! | ES1! | YM1! | — |
| YM1! | RTY1! | ES1! | — |
| RTY1! | YM1! | ES1! | — |
| GC1! | SI1! | HG1! | — |
| SI1! | GC1! | HG1! | — |
| HG1! | GC1! | SI1! | — |
| XAUUSD | XAGUSD | COPPER | — |
| EURUSD | GBPUSD | DXY | — |
| DXY | EURUSD | GBPUSD | — |
| BTC1! | ETHUSDT.P | TOTAL3 | — |
| Chart | Leg 2 | Leg 3 | Leg 4 |
|---|---|---|---|
| NQ1! | ES1! | YM1! | — |
| YM1! | ES1! | NQ1! | — |
| RTY1! | YM1! | ES1! | — |
| GC1! | XAUEUR | XAUGBP | — |
| SI1! | XAGEUR | XAGGBP | — |
| HG1! | GC1! | SI1! | — |
| XAUUSD | XAUEUR | XAUGBP | — |
| EURUSD | GBPUSD | DXY | — |
| DXY | EURUSD | GBPUSD | — |
| BTC1! | ETHUSDT.P | TOTAL3 | — |
| Chart | Leg 2 | Leg 3 | Leg 4 |
|---|---|---|---|
| NQ1! | ES1! | YM1! | RTY1! |
| YM1! | RTY1! | ES1! | NQ1! |
| RTY1! | YM1! | ES1! | NQ1! |
| GC1! | SI1! | XAUEUR | XAUGBP |
| SI1! | GC1! | XAGEUR | XAGGBP |
| HG1! | GC1! | SI1! | — |
| XAUUSD | XAGUSD | XAUEUR | XAUGBP |
| EURUSD | GBPUSD | DXY | — |
| DXY | EURUSD | GBPUSD | — |
| BTC1! | ETHUSDT.P | TOTAL3 | — |
| Chart | Leg 2 | Leg 3 | Leg 4 |
|---|---|---|---|
| NQ1! | ES1! | YM1! | — |
| YM1! | RTY1! | ES1! | NQ1! |
| RTY1! | YM1! | ES1! | — |
| GC1! | SI1! | XAUEUR | XAUGBP |
| SI1! | GC1! | XAGEUR | XAGGBP |
| HG1! | GC1! | SI1! | — |
| XAUUSD | XAGUSD | XAUEUR | XAUGBP |
| EURUSD | GBPUSD | DXY | — |
| DXY | EURUSD | GBPUSD | — |
| BTC1! | ETHUSDT.P | TOTAL3 | — |
- Hybrid removes the fourth leg on NQ, ES, and RTY only
- YM keeps all four legs. All other symbols return their Tetrad result.
- GXT drops Russell on purpose
- RTY and M2K return the Triad result in GXT mode.
- Copper has no GXT branch and no Tetrad branch
- HG and MHG return the Triad result in every mode.
- A cross-pair chart returns the same Triad and GXT legs
- The chart symbol is already a cross.
- A DXY chart is the third leg of its triad
- For this reason, both of its legs return inverted.
- The alt coin rows pair to the majors
- The legs stay on the same perpetual contracts on every exchange.
03 / Graceful fallback
Nothing throws, nothing guesses
If the Library does not recognize a symbol, it returns detected = false, the category fallback, and empty legs. The chart ticker stays in primary.
The Library never stops with an error and never guesses a leg. A script that tests detected first uses one asset on an unknown market.
04 / For developers
Import it in one line
Use resolveCurrentChart() in most scripts. If you must control the back adjustment yourself, use resolveAssets().
The Library also exports one detector for each asset class. You can call a detector directly.
import fstarcapital/AssetCorrelationUtils/14 as AC AC.AssetConfig config = AC.resolveCurrentChart() string asset2 = config.secondary string asset3 = config.tertiary bool inv3 = config.invertTertiary bool found = config.detected // GXT mode AC.AssetConfig gxt = AC.resolveCurrentChart(true) // Tetrad mode AC.AssetConfig tetrad = AC.resolveCurrentChart(false, true) // Hybrid mode AC.AssetConfig hybrid = AC.resolveCurrentChart(false, false, true)
- Detection
- Request data only when config.detected is true.
- Futures legs
- The returned string includes the session and the back adjustment. It is longer than the plain ticker.
- Fourth leg
- Read config.quaternary only when config.isQuadMode is true. Tetrad returns three legs where no fourth leg exists, and Hybrid returns three legs on NQ, ES, and RTY.
- Lag and repaint
- The Library requests no data. Lag and repaint come from your own data request.

