Stock Correlation Calculator
Paste two price series and get the correlation between them — then the number that matters more: how many separate bets those positions are actually worth, and what each one may risk.
At a glance
- The demonstration pair loaded in the tool gives r = 0.91, and r² = 82.58%. Squared, the coefficient is a share of movement: four fifths of each day's move in the first series is the same move as the second's, and only 17.42% is its own.
- Four open tickets at r = 0.91 are 1.07 bets, not four. The divisor is 1 + (k − 1) × r = 1 + 3 × 0.9087 = 3.73, and 4 ÷ 3.73 = 1.07. Adding the fourth ticket to that book added almost nothing but exposure.
- Those four tickets at 1% each put 3.86% on the book, and a 2% cap allows 0.52% per ticket. The multiplier is the square root of k × 3.73 = 3.86; the naive sum of 4.00% and the independent case of 2.00% are the two ends of the same row.
Loaded series is a demonstration sequence, not market data — replace it with your own closes.
The summary route takes centred deviations — each value already has its own mean subtracted. r = Σxy ÷ √(Σx² × Σy²).
The cap is the most you want the whole book to carry at once. The tool works out what each ticket may risk so the total lands on it.
How the coefficient is actually computed
Someone typing a correlation stock calculator into a search box is after the same quantity this page opens with, and the phrase is worth pinning down before anything else: it is the correlation between two return series, not between two price charts. Two stocks that both drift upwards for a year produce a coefficient near 1.00 on price levels that says nothing at all about anything except that both went up. The number carries meaning only once each price has been turned into a change.
- The coefficient is bounded and symmetric. It runs from −1.00 through 0 to +1.00, and it does not care which series you call A. A value of 0.91 means the same thing in either direction.
- It is a straight-line measure only. Two series can be tied together by something a line will never describe — one leads the other by a day, or they only move together when they fall — and the coefficient will understate that without saying so.
- The square is the part worth reading. r = 0.91 sounds like near-total overlap; r² = 82.58% is what that actually amounts to. The remaining 17.42% is the only part of the position that is diversifying anything.
- It is an estimate, not a constant. Eleven observations give a wide interval. Correlations are also unstable in the direction that hurts: they tend to climb towards 1.00 exactly when the whole book is falling.
The four lines at the bottom of the formula block are the reason this page exists rather than a statistics page. A coefficient on its own is a fact about two charts; divided into the number of positions you hold, it becomes a fact about your account.
Worked example: eleven days of two tickers
The two series loaded in the tool above are a demonstration sequence — twelve prices each, chosen by hand, with no market behind them. Every step below can be checked with a phone calculator, and the same figures appear when you switch the tool to the summary route and type 6.1875, 6.0886 and 7.6143 into the three fields.
| Day | Return A | Return B | dx | dy | dx × dy | dx² | dy² |
|---|---|---|---|---|---|---|---|
| 1 | 1.20% | 0.90% | 0.6368 | 0.4816 | 0.3067 | 0.4056 | 0.2320 |
| 2 | -0.40% | 0.10% | -0.9584 | -0.3193 | 0.3060 | 0.9186 | 0.1019 |
| 3 | 0.90% | 1.31% | 0.3396 | 0.8886 | 0.3018 | 0.1153 | 0.7895 |
| 4 | 1.49% | 1.09% | 0.9313 | 0.6762 | 0.6298 | 0.8673 | 0.4573 |
| 5 | -0.80% | -1.18% | -1.3672 | -1.5978 | 2.1845 | 1.8692 | 2.5530 |
| 6 | 0.60% | 0.39% | 0.0325 | -0.0271 | -0.0009 | 0.0011 | 0.0007 |
| 7 | 1.10% | 0.80% | 0.5338 | 0.3807 | 0.2032 | 0.2850 | 0.1449 |
| 8 | -0.30% | -0.60% | -0.8608 | -1.0178 | 0.8761 | 0.7410 | 1.0358 |
| 9 | 1.40% | 1.60% | 0.8334 | 1.1766 | 0.9806 | 0.6945 | 1.3845 |
| 10 | 0.20% | -0.50% | -0.3637 | -0.9162 | 0.3332 | 0.1323 | 0.8394 |
| 11 | 0.81% | 0.69% | 0.2426 | 0.2743 | 0.0666 | 0.0589 | 0.0753 |
| Sum | 6.1947% | 4.6021% | 0.0000 | 0.0000 | 6.1875 | 6.0886 | 7.6143 |
- Eleven paired returns. Twelve prices give eleven changes; the first price has nothing before it to change from.
- Mean of A: 6.1947 ÷ 11 = 0.5632%. Mean of B: 4.6021 ÷ 11 = 0.4184%.
- Deviations. Day 1: 1.20 − 0.5632 = 0.6368, and 0.90 − 0.4184 = 0.4816. The dx and dy columns sum to zero by construction, which is the check worth doing before anything else — if they do not, a mean is wrong.
- Cross-products: 0.6368 × 0.4816 = 0.3067 on day 1, added down the column to 6.1875.
- Squared deviations: 6.0886 for A and 7.6143 for B.
- The denominator: 6.0886 × 7.6143 = 46.3607, and its square root is 6.8089. This is the step people skip and then wonder why a coefficient came out above 1.
- r: 6.1875 ÷ 6.8089 = 0.9087, or 0.91 to two places.
- Shared variance: 0.9087² = 82.58%. The other 17.42% of each series is its own.
- Bets, at four positions: 1 + 3 × 0.9087 = 3.73, and 4 ÷ 3.73 = 1.07.
- What the book carries at 1% a ticket: the square root of 4 × 3.73 = the square root of 14.90 = 3.86, so 3.86% rather than the 1% the ticket says.
- What fits a 2% cap: 2.00 ÷ 3.86 = 0.52% per ticket, which is 52% of the size the 1% rule would have given each one.
Step 11 is the one that changes an order. Nothing about the entry, the stop or the method moved between steps 10 and 11 — only the recognition that four tickets at 0.91 are one bet wearing four names.
From one coefficient to how many bets you hold
The divisor 1 + (k − 1) × r is the whole trick, and it is worth seeing across a grid before trusting it on one number. Read it as: k tickets each holding the same risk behave like k ÷ (1 + (k − 1) × r) tickets that have nothing to do with one another. At r = 0 the divisor is 1 and the answer is k, as it should be. At r = 1 the divisor is k and the answer is 1, however many tickets are open.
| Tickets | r = 0.00 | 0.25 | 0.50 | 0.75 | 0.90 | 1.00 |
|---|---|---|---|---|---|---|
| 2 | 2.00 | 1.60 | 1.33 | 1.14 | 1.05 | 1.00 |
| 3 | 3.00 | 2.00 | 1.50 | 1.20 | 1.07 | 1.00 |
| 4 | 4.00 | 2.29 | 1.60 | 1.23 | 1.08 | 1.00 |
| 5 | 5.00 | 2.50 | 1.67 | 1.25 | 1.09 | 1.00 |
| 6 | 6.00 | 2.67 | 1.71 | 1.26 | 1.09 | 1.00 |
| 8 | 8.00 | 2.91 | 1.78 | 1.28 | 1.10 | 1.00 |
| 10 | 10.00 | 3.08 | 1.82 | 1.29 | 1.10 | 1.00 |
The r = 0.90 column is the uncomfortable one and it is where most equity books actually sit. Ten tickets at that correlation are worth 1.10 bets — the nine extra tickets bought a rounding error in diversification and ten times the exposure. Even at a middling 0.50, five tickets are worth 1.67 bets, and the sixth adds 0.04.
What the book carries, ticket by ticket
The count of bets is the intuition; the multiplier is the number that sizes the order. With k tickets each risking the same amount and a pairwise correlation of r, the whole book moves as one position of size risk × √(k × (1 + (k − 1) × r)). The table below is that square root, and it is also the factor by which the naive "sum the tickets" figure overstates nothing at all — at r = 1 the two agree exactly.
| Tickets | r = 0.00 | 0.25 | 0.50 | 0.75 | 0.90 | 1.00 |
|---|---|---|---|---|---|---|
| 2 | 1.41 | 1.58 | 1.73 | 1.87 | 1.95 | 2.00 |
| 3 | 1.73 | 2.12 | 2.45 | 2.74 | 2.90 | 3.00 |
| 4 | 2.00 | 2.65 | 3.16 | 3.61 | 3.85 | 4.00 |
| 5 | 2.24 | 3.16 | 3.87 | 4.47 | 4.80 | 5.00 |
| 6 | 2.45 | 3.67 | 4.58 | 5.34 | 5.74 | 6.00 |
| 8 | 2.83 | 4.69 | 6.00 | 7.07 | 7.64 | 8.00 |
| 10 | 3.16 | 5.70 | 7.42 | 8.80 | 9.54 | 10.00 |
Read the r = 0.00 column first, because it is the case most sizing advice silently assumes. Four uncorrelated tickets at 1% carry 2.00%, not 4.00% — and that gap is the entire reason diversification is worth anything. Now read across to 0.90: the same four tickets carry 3.85%, which is 93% of the way to the 4.00% you would get from holding one ticket four times over.
Run it the other way and it sizes the trade. A 2.00% cap divided by 3.86 leaves 0.52% per ticket on the worked example — a little over half of what the 1% rule would have allowed, and the number you actually type into the position size calculator to get the unit count.
Five tickets in one afternoon: what the streak rows say it costs
Correlation decides how likely the whole book goes at once. The streak table decides what that costs. The five rows below are the site's own published data — consecutive losses of one to five, at 0.5%, 1% and 2% risked per trade, printed exactly as the file has them with nothing applied on top.
| Losers | Equity left, 0.5% | Drawdown | Gain needed | Equity left, 1% | Drawdown | Gain needed | Equity left, 2% | Drawdown | Gain needed |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 99.50% | 0.50% | 0.50% | 99.00% | 1.00% | 1.01% | 98.00% | 2.00% | 2.04% |
| 2 | 99.00% | 1.00% | 1.01% | 98.01% | 1.99% | 2.03% | 96.04% | 3.96% | 4.12% |
| 3 | 98.51% | 1.49% | 1.51% | 97.03% | 2.97% | 3.06% | 94.12% | 5.88% | 6.25% |
| 4 | 98.01% | 1.99% | 2.03% | 96.06% | 3.94% | 4.10% | 92.24% | 7.76% | 8.41% |
| 5 | 97.52% | 2.48% | 2.54% | 95.10% | 4.90% | 5.15% | 90.39% | 9.61% | 10.63% |
Those rows are written for losers arriving one after another, and each one compounds off a smaller balance. A correlated book loses them together instead, and together they add rather than compound. The difference is worth measuring rather than assuming, so here it is.
| Losers | Together, 1% | In sequence, 1% | Gap | Together, 2% | In sequence, 2% | Gap |
|---|---|---|---|---|---|---|
| 1 | 99.00% | 99.00% | 0.00 pp | 98.00% | 98.00% | 0.00 pp |
| 2 | 98.00% | 98.01% | 0.01 pp | 96.00% | 96.04% | 0.04 pp |
| 3 | 97.00% | 97.03% | 0.03 pp | 94.00% | 94.12% | 0.12 pp |
| 4 | 96.00% | 96.06% | 0.06 pp | 92.00% | 92.24% | 0.24 pp |
| 5 | 95.00% | 95.10% | 0.10 pp | 90.00% | 90.39% | 0.39 pp |
The gaps are small and that is the useful finding: at ordinary risk sizes the streak table is a good enough yardstick for the correlated book, and you do not need a second table. Four tickets at 1% each going together leaves 96.00%; four losers in a row at 1% leaves 96.06%. Ten basis points of difference at the deepest row of the 1% column is noise next to the decision that put four correlated tickets on at once.
What follows is where the two tables meet. Pick the depth you are willing to wear from the first table — five at 1% is 4.90% down and needs 5.15% to earn back — and divide that drawdown by the number of tickets that can go together. That is the ceiling on each one.
| Tickets | Budget 2.48% | Budget 4.90% | Budget 9.61% |
|---|---|---|---|
| 2 | 1.240% | 2.450% | 4.805% |
| 3 | 0.827% | 1.633% | 3.203% |
| 4 | 0.620% | 1.225% | 2.403% |
| 5 | 0.496% | 0.980% | 1.922% |
| 6 | 0.413% | 0.817% | 1.602% |
| 8 | 0.310% | 0.613% | 1.201% |
The middle column is the one to hold against habit. A book that can lose four tickets at once has 1.225% of room per ticket if five straight 1% losers is the pain you planned for — and the fourth ticket is what makes "at once" true. Eight tickets at the same budget get 0.613%, which on a 25,000.00 account is 153.25 per position before a single pip of stop distance has been considered.
That table assumes the worst: every ticket goes together. It rarely does, and the coefficient says how far from the worst you actually are. Swap the divisor k for the book multiplier out of the previous section and the same 4.90% budget stretches.
| Tickets | r = 0.50 | r = 0.75 | r = 0.90 | All together (r = 1) |
|---|---|---|---|---|
| 2 | 2.832% | 2.620% | 2.513% | 2.450% |
| 3 | 2.000% | 1.788% | 1.690% | 1.633% |
| 4 | 1.551% | 1.357% | 1.273% | 1.225% |
| 5 | 1.266% | 1.096% | 1.021% | 0.980% |
| 6 | 1.070% | 0.918% | 0.854% | 0.817% |
| 8 | 0.817% | 0.693% | 0.641% | 0.613% |
The last column is the earlier table's middle column, and the distance between it and its neighbour is smaller than most people expect. Four tickets at r = 0.90 get 1.273% against 1.225% if they were a single position — 4.8 basis points of relief for a correlation that is not quite one. The honest reading is that the worst case is the useful planning case: at the correlations equity books actually run at, the discount for being merely highly correlated is not worth the arithmetic.
This page and its neighbours, side by side
Three pages on this site touch the same book, and they split it at the counting line.
- This page turns two series into a coefficient, then into a bet count and a per-ticket ceiling. It is the only one that asks whether the tickets are separate.
- The combined risk across open positions page adds the tickets up. It deliberately does not discount for correlation, because the sum is what you lose if every stop is reached and correlation only changes how likely reaching them is. Read the two together: this page says how many bets you have, that one says what the worst afternoon costs.
- The risk per trade percentage guide is where the 0.5%, 1% and 2% columns come from. The ceilings in the last table above are only as good as the column you picked out of it.
None of the three decide how many units or shares an order is. That is the position size calculator, and it needs the per-ticket figure this page produces plus a stop distance.
Questions traders ask
How do I calculate the correlation between two stocks?
Turn both price series into periodic returns first — price levels give a meaningless answer — then subtract each series' own mean from every return, multiply the two deviations together, and divide the sum of those products by the square root of (sum of squared deviations in A times sum of squared deviations in B). On the eleven-day example above that is 6.1875 ÷ 6.8089 = 0.9087. Paste your own closes into the tool and it does the same arithmetic in the browser.
What does a correlation of 0.91 actually mean for my positions?
Square it first: 0.9087² = 82.58%, which is the share of each series' movement the other one accounts for. Only 17.42% is independent. In bet terms, four tickets at that correlation are worth 4 ÷ (1 + 3 × 0.9087) = 1.07 separate bets, and at 1% risked on each the book carries 3.86% rather than 1%.
How many trades can I have open at the same time?
Fewer than the number of tickets, once they are correlated — and the count comes out of the table above rather than out of a rule of thumb. At r = 0.90, going from four tickets to ten moves the bet count from 1.08 to 1.10 while the book multiplier goes from 3.85 to 9.54. You are adding exposure and buying almost nothing.
Is a high correlation always bad?
No, and this page does not treat it as a fault. It is a fact about the book that has to be priced. If you know four tickets are one bet, size them as one bet — 0.52% each against a 2% cap on the example here — and the position is perfectly defensible. The damage is done by sizing four correlated tickets as four independent ones.
Why does my portfolio risk calculator give a bigger number than this one?
Because the two count different things. Adding the tickets gives the loss if every stop is reached, which on the combined risk page is treated as the number that matters and is not discounted. Dividing by the correlation gives the book's typical movement. The truth sits between them: the sum is the worst afternoon, the multiplier is the ordinary one, and both are worth knowing.
Does correlation stay stable?
It tends to move in the direction that hurts, which is the part worth planning around. Measured across a calm month it understates what the same pair does in a selloff, when unrelated-looking instruments start falling together. Treat the coefficient as a floor on how connected the book is, not a ceiling.
Can I use returns instead of prices in the tool?
Yes — switch the method to "Summary statistics" and type n, Σxy, Σx² and Σy² if you have already centred the series yourself. That route computes r = Σxy ÷ √(Σx² × Σy²) with no price parsing involved, and it is the one to use when a spreadsheet has already done the deviations.
What the coefficient leaves out
The arithmetic above is honest about one thing and silent about four, and the four are worth naming before the number gets used as if it were complete.
- Tail behaviour. A single correlation describes the average of the joint distribution. The observations that matter most are at the edges, and that is where the measured value has the least to say.
- Lags. One instrument leading the other by a session produces a same-day coefficient near zero and a real dependence that this page will not see. If you suspect a lead, compare the series offset by a period before concluding anything.
- Sample width. Eleven observations produce a point estimate with a wide interval around it. The win rate calculator shows how quickly that width closes with sample size; the same logic applies here.
- The bet you did not count. Two tickets in different sectors can still share one driver — the same currency, the same rate, the same risk appetite. The coefficient catches that only if it showed up in the window you measured.
Everything on this page runs in your browser from the two series you paste, plus five published rows of the site's own streak data. That file, with the same numbers, is published as an open reference dataset.
Related guides
- Combined risk across open positions — the sum of every stop, and why the worst case is not discounted for correlation.
- How much should you risk per trade? — where the 0.5%, 1% and 2% columns in the streak table come from.
- Win rate calculator — how often a losing run of each depth arrives, and what it costs at 2% a trade.
- Adding to a position — splitting one risk budget across several entries without multiplying the risk.
- Position size by instrument — contract size, pip size and unit step for all 131 symbols.
- Open reference dataset — the four CSV files behind every table on this page.