Compare linear price relationships
Add 2 to 12 supported stock or ETF symbols, select 3 months, 6 months, 1 year or 3 years, then generate the matrix. Sector buttons select ETF tickers; they do not aggregate every company in a sector. Coverage depends on the FMP history response.
From prices to correlations
The tool intersects the dates available for every selected symbol and sorts them chronologically. It computes rᵢ = Pᵢ / Pᵢ₋₁ − 1 on successive common dates, then Pearson correlation for each pair. If a session is missing for one symbol, a return interval may span multiple sessions for all symbols. At least 20 common prices are required.
ρ = Σ[(x − x̄)(y − ȳ)] / √(Σ(x − x̄)² Σ(y − ȳ)²)
Both return series must vary: a constant series has zero variance and an undefined correlation. The calculator reports an error for that case rather than converting it to zero. Values near +1 or −1 describe strong linear association in this sample; zero does not rule out a nonlinear relationship.
Read the heatmap with its sample
Red shades indicate positive correlation and blue shades negative correlation. Neutral shading covers −0.3 through +0.3. These display bands are conventions, not statistical significance tests. The matrix diagonal is 1 for valid varying series. Highest, lowest and average summaries use off-diagonal pairs once each.
Results show the actual common-date span and interval count. A longer request does not ensure a stable relationship. Prices are used as returned; this tool does not verify dividend or split adjustment, normalize currencies or calculate total returns.
What this cannot establish
A low correlation does not make an asset a suitable investment or guarantee downside protection. Portfolio variance also depends on weights and volatility, while liquidity and nonlinear losses require separate analysis. This calculator has no optimizer, allocation recommendation or calibrated diversification score.
Formula reference: SciPy Pearson correlation definition and constant-input limitation. Data endpoint: FMP historical price light documentation.