Skip to main content
AuctionFoundry
Menu

INDICATOR MANUAL

Correlation and beta indicatorCorrelation Matrix [AFD] · full manual · published to TradingView

Compare the chart symbol with up to eight instruments using matched returns, correlation, beta, spread, history, and coverage.

102 documented settingsPublished on TradingView · Jul 27, 2026

Start here

What the indicator does, the questions it can help answer, and its fresh-install defaults.

The indicator compares the chart symbol with up to eight configured symbols. It is not a full pairwise matrix between every comparison symbol; each row is measured against the chart symbol.

Returns are built only from consecutive accepted endpoint pairs whose chart and comparison timestamps both advance. Missing bars and session gaps accumulate both instruments over the same shared interval.

Dashboard calculations and comparison-line drawings have separate controls. Measurement preset selects the sampling clock and windows; Dashboard view changes columns; Comparison line starting point changes only rebased visual paths.

Fresh-install defaults9 documented defaults

Swipe or scroll horizontally to see every column.

Correlation Matrix fresh-install defaults
AreaDefaultResult
Measurement presetIntradayRequests 5-minute measurements with Long 78 and Short 20 windows.
Dashboard viewContextShows Symbol, Long, Short, Spread, Coverage, plus Difference because its switch starts on.
Symbol setCustomUses the per-slot symbol and display-name fields.
Slots 1–3QQQ · DIA · IWMAll three are enabled and show comparison lines.
Slots 4–8Enabled · blankBlank slots remain inactive and hidden while retaining their fixed request sites.
Dashboard and linesOnBoth visual layers start visible when usable data exists.
Line starting pointAutoIntraday resolves to Session Open; Swing resolves to Year Open.
Main correlation windowShortMain Correlation, History, and line-end correlation text use the Short result.
Historical comparisonOffHistory is not calculated for display until enabled.

How it works

How the indicator turns chart data into the states and drawings you see.

Measurement clock

Scalper uses 1-minute 60/15 windows, Intraday 5-minute 78/20, Swing 1-day 120/20, and Custom uses user values. A requested timeframe below the chart falls back to the chart timeframe and shows an amber warning.

Confirmed comparison snapshots

Equal-timeframe data commits on chart confirmation. Fixed higher-timeframe tuples use the last completed measurement bar and commit when the first chart bar that sees the tuple confirms, which can add one chart-bar delay.

Shared-endpoint returns

The latest causally available comparison endpoint maps to the nearer current or prior chart-base endpoint. Both timestamps must advance before log returns are admitted; unmatched positions remain unavailable in the rolling window.

Correlation, Difference, and Beta

Long and Short use centered Pearson moments over pairwise-valid matched returns. Difference is Short minus Long. Beta is covariance(chart returns, comparison returns) divided by variance(comparison returns) over the Long sample.

Matched Spread

Non-negative Long correlation selects log(chart) − log(comparison); negative Long correlation selects their sum. The current value is reported as a population z-score against its matched Long-window history.

History and Coverage

History ranks the current Main Correlation against prior valid readings using tie-aware midrank. Coverage is fresh comparison endpoints divided by eligible Long-window positions; it is availability, not quality or confidence.

Dashboard views

Context, Compact, Full, Minimal, and Custom choose columns only. Show correlation difference can add Difference to every view. An advanced override can use custom columns without changing the selected view.

Rebased comparison lines

Each path starts from a shared chart boundary and applies the comparison symbol’s percentage change to the chart scale. Session Open, Year Open, Fixed Date, and Rolling N Bars affect drawings only.

Output and state reference12 documented states

Swipe or scroll horizontally to see every column.

Correlation Matrix outputs and states
Output or stateWhen it appearsMeaning
LONG CORRELATIONComplete Long windowCentered Pearson correlation over usable matched returns.
SHORT CORRELATIONComplete Short windowFaster centered Pearson correlation over the shorter matched sample.
DIFFERENCELong and Short availableShort minus Long, displayed in rounded percentage points.
MAIN CORRELATIONLong or Short selectedReuses the selected result for Minimal view, History, and line-end text.
BETALong sample with variationChart-return sensitivity relative to comparison returns.
SPREADMatched price history with variationSigned ratio- or product-form population z-score.
DATA COVERAGEComplete Long windowFresh comparison endpoints divided by eligible measurement positions.
HISTORYHistorical comparison enabledTie-aware percentile of Main Correlation against prior valid pair readings.
LAG STARFresh comparison mapped to prior baseMarks that the latest accepted endpoint aligned to the preceding chart-base close.
NO DATAInvalid or unavailable symbolKeeps the row unavailable without stopping other rows.
NO ACTIVE SYMBOLSNo enabled nonblank slotsDashboard empty state; fixed request architecture remains.
AMBER WARNINGLower-timeframe fallback or Short adjustmentNames the requested and effective measurement contract.

Settings

The 102-input reference begins with the eight five-control slot rows, then documents measurement, dashboard, custom-column, appearance, rebased-line, baseline, shading, label, and global-opacity controls.

Eight comparison slots

40 mapped inputs

Swipe or scroll horizontally to see every column.

Eight comparison slots default matrix
RowEnabledSymbolDisplay nameColorLine
Slot 1OnToggleNASDAQ:QQQSymbol · conditionalChoice / text · conditional#64B5F6ColorOnToggle
Slot 2OnToggleAMEX:DIASymbol · conditionalChoice / text · conditional#FFB74DColorOnToggle
Slot 3OnToggleAMEX:IWMSymbol · conditionalChoice / text · conditional#4DD0E1ColorOnToggle
Slot 4OnToggleSymbol · conditionalChoice / text · conditional#BA68C8ColorOnToggle
Slot 5OnToggleSymbol · conditionalChoice / text · conditional#81C784ColorOnToggle
Slot 6OnToggleSymbol · conditionalChoice / text · conditional#FFD54FColorOnToggle
Slot 7OnToggleSymbol · conditionalChoice / text · conditional#F06292ColorOnToggle
Slot 8OnToggleSymbol · conditionalChoice / text · conditional#BCAAA4ColorOnToggle
Quick Setup7 inputs

Swipe or scroll horizontally to see every column.

Quick Setup settings and defaults
SettingControlDefaultChoices, limits & availability
Measurement presettrading_horizonChoice / textIntraday · 5-minute measurements · Long 78 / Short 20Scalper · 1-minute measurements · Long 60 / Short 15 · Intraday · 5-minute measurements · Long 78 / Short 20 · Swing · 1-day measurements · Long 120 / Short 20 · Custom
Dashboard viewvisual_presetChoice / textContextContext · Compact · Full · Minimal · Custom
Show correlation differenceshow_differenceToggleOn—
Symbol setpreset_groupChoice / textCustomCustom · United States Indices · Risk On / Off · Major Foreign Exchange Pairs · Energy & Metals · Crypto
Show dashboarddash_enToggleOn—
Show comparison linesoverlay_enToggleOn—
Comparison line starting point (visual only)line_startChoice / textAuto from measurement presetAuto from measurement preset · Session Open · Rolling N Bars · Year Open · Fixed Date | Conditional
Custom Measurements — Advanced6 inputs

Swipe or scroll horizontally to see every column.

Custom Measurements — Advanced settings and defaults
SettingControlDefaultChoices, limits & availability
Custom measurement timeframecustom_calc_tfTimeframeBlankConditional
Long correlation windowcustom_long_lenWhole number120Min 10 · Max 1000 | Conditional
Short correlation windowcustom_short_lenWhole number20Min 5 · Max 200 | Conditional
Main correlation windowpct_srcChoice / textShortLong · Short
Historical comparisonhist_enToggleOff—
Historical windowhist_lenWhole number750Min 100 · Max 5000 | Conditional
Dashboard3 inputs

Swipe or scroll horizontally to see every column.

Dashboard settings and defaults
SettingControlDefaultChoices, limits & availability
Positiondash_posChoice / textTop RightTop Left · Top Center · Top Right · Middle Left · Middle Center · Middle Right · Bottom Left · Bottom Center · Bottom Right
Sort rows bydash_sortChoice / textSlot orderSlot order · Strongest correlation · Widest spread
Cell coloringcolor_modeChoice / textHeatHeat · Mono
Dashboard Columns — Advanced8 inputs

Swipe or scroll horizontally to see every column.

Dashboard Columns — Advanced settings and defaults
SettingControlDefaultChoices, limits & availability
Use custom dashboard columnscustom_columns_overrideToggleOff—
Show main correlationcol_pctToggleOnConditional
Show long correlationcol_rlToggleOffConditional
Show short correlationcol_rcToggleOffConditional
Show betacol_betaToggleOffConditional
Show spreadcol_zToggleOffConditional
Show historycol_histToggleOffConditional
Show data coveragecol_matchToggleOffConditional
Dashboard Appearance — Advanced15 inputs

Swipe or scroll horizontally to see every column.

Dashboard Appearance — Advanced settings and defaults
SettingControlDefaultChoices, limits & availability
Header text sizehdr_sizeChoice / textSmallTiny · Small · Normal · Large · Huge
Body text sizebody_sizeChoice / textSmallTiny · Small · Normal · Large · Huge
Header text colorhdr_txt_cColorWhite—
Body text colorbody_txt_cColorWhite—
Header backgroundhdr_bg_cColor#1E222D—
Body backgroundbody_bg_cColor#131722—
Background transparencytbl_bg_transpWhole number10Min 0 · Max 100
Alternating row shadingstripe_enToggleOn—
Row shading colorstripe_cColor#1E222DConditional
Row shading transparencystripe_transpWhole number40Min 0 · Max 100 | Conditional
Border widthborder_wWhole number1Min 0 · Max 4
Border colorborder_cColor#2A2E39—
Frame widthframe_wWhole number1Min 0 · Max 4
Frame colorframe_cColor#2A2E39—
Mono coloringmono_cColor#787B86Conditional
Comparison Line Style3 inputs

Swipe or scroll horizontally to see every column.

Comparison Line Style settings and defaults
SettingControlDefaultChoices, limits & availability
Line appearancereb_styleChoice / textSolid lineSolid line · Dashed line · Dotted line · Step line · Step line with diamonds · Points · Crosses | Conditional
Line widthreb_widthWhole number2Min 1 · Max 4 | Conditional
Line transparencyline_transpWhole number50Min 0 · Max 100 | Conditional
Comparison Line Starting Point — Advanced7 inputs

Swipe or scroll horizontally to see every column.

Comparison Line Starting Point — Advanced settings and defaults
SettingControlDefaultChoices, limits & availability
Rolling barsanchor_barsWhole number120Min 10 · Max 1000 | Conditional
Fixed dateanchor_dateDate / timetimestamp("01 Jan 2026 00:00 +0000")Conditional
Show starting-point markermarker_enToggleOnConditional
Marker styleanc_styleChoice / textDottedSolid · Dashed · Dotted | Conditional
Marker coloranc_colColor#787B86Conditional
Marker transparencyanc_transpWhole number50Min 0 · Max 100 | Conditional
Marker widthanc_widthWhole number1Min 1 · Max 4 | Conditional
Comparison Line Gap Shading — Advanced5 inputs

Swipe or scroll horizontally to see every column.

Comparison Line Gap Shading — Advanced settings and defaults
SettingControlDefaultChoices, limits & availability
Shaded slotshade_slotWhole number0Min 0 · Max 8 | Conditional
Shade the gapfill_enToggleOnConditional
Chart above colorfill_up_cColor#4CAF50Conditional
Chart below colorfill_dn_cColor#FF5252Conditional
Fill transparencyfill_transpWhole number85Min 0 · Max 100 | Conditional
Comparison Line Labels — Advanced7 inputs

Swipe or scroll horizontally to see every column.

Comparison Line Labels — Advanced settings and defaults
SettingControlDefaultChoices, limits & availability
Show line-end labelsend_lbl_enToggleOnConditional
Include symbol nameend_lbl_symToggleOnConditional
Include main correlationend_lbl_pctToggleOnConditional
Include spreadend_lbl_zToggleOnConditional
Text sizeend_lbl_sizeChoice / textNormalAuto · Tiny · Small · Normal · Large · Huge | Conditional
Text colorend_lbl_cmodeChoice / textSlot colorSlot color · Custom | Conditional
Custom text colorend_lbl_cColorWhiteConditional
Global Appearance — Advanced1 input

Swipe or scroll horizontally to see every column.

Global Appearance — Advanced settings and defaults
SettingControlDefaultChoices, limits & availability
Master opacity shiftmaster_opacityWhole number0Min 0 · Max 100

Alerts and limitations

What can notify you, what can change the output, and what the indicator cannot establish.

Alerts

Limits to keep visible

  • Every comparison is against the chart symbol; the dashboard is not an all-against-all pairwise matrix.
  • Standard time-based candles are required. Non-standard chart types and tick charts stop with a runtime message.
  • A requested measurement timeframe below the chart falls back to the chart timeframe, so the sample changes.
  • Fixed higher-timeframe readings can appear up to one confirming chart bar after a newly completed measurement tuple becomes visible.
  • Coverage measures fresh endpoint availability, not statistical quality, confidence, significance, or the exact count used by every metric.
  • A full configured window, at least three usable pairs, and measurable variation are required before correlation appears.
  • All eight comparison request sites remain active by architecture; disabling a slot hides it but does not reduce request cost.
  • Rebased lines can stretch the price scale when a comparison path moves far from the chart. Change the visual starting point or hide lines when needed.
  • The indicator is not a hedge-sizing model, portfolio-risk engine, significance test, cointegration model, or trade signal.

Troubleshooting

Start with what you see on the chart. Each answer explains the likely cause and the first setting, timeframe, or data condition to check.

Why does the Swing preset work on a 30-minute chart?

Swing measures completed daily returns even when you view a 30-minute chart. The chart timeframe controls what you see; the preset controls the comparison clock. They do not need to match.

Why is the timeframe warning amber?

Your requested measurement timeframe is smaller than the chart timeframe, so TradingView cannot supply the finer comparison from that chart. The indicator falls back to the chart timeframe. Choose the same or a higher measurement timeframe to remove the fallback.

Why is one comparison row marked No data?

TradingView could not return usable history for that ticker in the current chart context. Check the exact exchange-qualified symbol and whether your data plan includes it. The other rows continue working independently.

Why is correlation blank even though Coverage is high?

Coverage only says that many recent endpoints arrived. Correlation still needs a full window, at least three matched returns, and actual movement in both symbols. Load more history or shorten the window, then check that neither series is flat.

Why is Spread blank when I compare the chart symbol with itself?

A symbol divided by itself does not move, so its spread has no variation and no meaningful z-score. Choose a different comparison symbol if you want a Spread reading.

Why didn’t changing the line starting point change the dashboard?

The starting point only changes how the rebased comparison lines are drawn. Correlation, Beta, Spread, History, and Coverage use the same matched returns either way, so the dashboard should not change.

Why is the effective Short window different from what I entered?

In Custom mode, Short must be smaller than Long. If you enter an equal or larger value, the script uses Long minus one. Set Short below Long and compare the selected and effective values in the dashboard.

Risk disclosure

Auction Foundry LLC provides educational charting tools and general market commentary only. This is not investment, financial, legal or tax advice, and nothing here is a recommendation, offer or solicitation to buy or sell any instrument. Auction Foundry is not registered with the SEC as an investment adviser, nor with the CFTC as a commodity trading advisor, and is not an NFA member.

Trading involves risk, including loss of principal. Losses can exceed a modeled stop and, for leveraged or margin products, can exceed the amount initially deposited or invested. Indicators can be wrong, delayed or unsuitable for your circumstances, and past or hypothetical results do not predict future results. Free access does not change any of this. Consider your objectives and consult a licensed professional before acting. Using these tools does not create an advisory or brokerage relationship.

Auction Foundry LLC is an independent publisher and is not affiliated with, endorsed by, or sponsored by TradingView, Inc. “TradingView” is a trademark of TradingView, Inc., used here only to identify the platform our scripts are published on. Scripts are published to TradingView as a community author on the same terms as any other author.

Read the full Risk Disclosure for the dated, versioned document this summarizes.