Free tool · one free run with a free account

Portfolio optimizer: find the best mix for your stocks

Pick up to five stocks and see where every possible weighting lands on the efficient frontier, and which mix gave the best return for the risk over the last three years.

Loading the optimizer…

What a portfolio optimizer does

Choosing stocks is only half of building a portfolio. The other half is deciding how much of each to hold. Put 50% in one stock and 10% in another and you get a very different ride than splitting them evenly, even with the same names.

A portfolio optimizer (or optimiser, if you spell it the British way) answers that second question. It tries thousands of possible weightings of the stocks you picked, measures how each one would have performed, and returns the mix that best meets your goal. In the example above, moving from equal weights to the optimized mix lowered volatility while keeping a similar return, because it leaned towards the stocks that moved less in step with the rest.

The efficient frontier, explained

Every dot on the chart is one possible portfolio made from your stocks. Its position shows two things: how much it moved around (volatility, on the horizontal axis) and how much it returned per year (on the vertical axis). Up and to the left is better: more return for less risk.

The line along the top edge of the cloud is the efficient frontier. Each point on it is the highest return any mix achieved for that level of risk. Portfolios below the line were beaten, in hindsight, by a mix on the line that earned more for the same risk or took less risk for the same return.

Where you sit on the frontier depends on how much risk you're comfortable with. The free run picks one specific point: the mix with the best Sharpe ratio, meaning the highest return for each unit of volatility. It's the most common place to start.

Goals you can optimize for

The free run uses the best risk-adjusted goal. In the full app you can choose from ten, grouped by what matters most to you. Each one is based on past prices, so real results will differ.

Grow my money

Best return for the ups and downsMax Sharpe ratioThe mix that would have earned the most for every bit of up-and-down movement. A good all-round starting point. Not sure? Start here.
Best return for the dropsMax Sortino ratioLike the one above, but only falls count as risk, so big jumps up aren't held against a stock.
Best return for the worst crashMax Calmar ratioThe mix that would have grown the most compared with its single biggest fall.
Highest growth within your risk limitMax returnThe mix that would have grown the most without its ups and downs going past the limit you set (by default, no bumpier than the S&P 500).

Protect my money

Smoothest rideMin volatilityThe mix whose value would have moved up and down the least. It doesn't look at returns.
Smallest worst fallMin max drawdownThe mix whose biggest drop from a high point would have been the smallest.
Smallest losses on the worst daysMin CVaRThe mix that would have lost the least, on average, on its worst 5% of days.

Spread my risk

Equal share of riskRisk parityEach stock is sized so it carries the same share of the ups and downs. Calmer stocks get more, wilder ones get less.
Balanced by themeHierarchical risk parity (HRP)Stocks that move alike, such as chip makers, are grouped together, then risk is shared fairly between the groups so no single theme dominates.
Most diversifiedMax diversificationFavours stocks that move differently from the rest, so their ups and downs cancel out as much as possible.

Hierarchical risk parity is the one to try on a thematic basket: if you hold six chip makers and two banks, it stops the chips from carrying most of the risk simply because there are more of them. Investor includes six goals, two in every direction; Portfolio Manager adds the advanced one in each (Best return for the worst crash, Highest growth within your risk limit, Smallest losses on the worst days, Balanced by theme) for all ten.

Why optimized weights flatter the past

An optimizer is honest about the past and silent about the future. It finds the weights that would have worked best over the dates you gave it, which is not the same as the weights that will work next. A stock that had an unusually good three years will look irresistible, and the optimizer will lean into it.

Three habits keep it useful:

Our methodology explains how the optimizer searches and how every result is calculated. Before optimizing, it can help to analyse your current portfolio to see where the risk sits.

How it works in Indices Lab

In the app the optimizer sits right next to your backtest. Choose a goal, set limits per stock, pick your dates, and apply the result to your index in one click. You then see the optimized weights in a full backtest with your real rebalancing rule, costs and benchmarks, and can track the index from the day you save it.

The optimizer in the Indices Lab app The optimizer in the Indices Lab app

FAQ

Portfolio optimizer questions

What does a portfolio optimizer do?

It tests thousands of possible weightings of the stocks you choose and finds the mix that best meets a goal, such as the highest return for each unit of risk. It answers "how much of each?" rather than "which stocks?".

What is the efficient frontier?

It is the curve of mixes that give the highest return for each level of risk. Any portfolio below the curve could, in hindsight, have earned more for the same risk, or taken less risk for the same return.

What is the Sharpe ratio?

Return divided by volatility (annualised), so it measures return per unit of risk. Maximising it finds the best risk-adjusted mix. The free run uses this goal with a zero risk-free rate.

Is the free optimizer really free?

Yes. Every free account gets one optimizer run: up to five stocks, the last three years of prices and the best risk-adjusted (max Sharpe) goal. Use it here or inside the app. Investor unlocks the optimizer with six goals (two in every direction), full history and your own limits, and Portfolio Manager adds the advanced goal in each direction for all 10.

Which optimizer goal should I pick?

Start with what matters most to you. Grow my money: the best return for the ups and downs, for the drops, for the worst crash, or the highest growth within a risk limit. Protect my money: the smoothest ride, the smallest worst fall, or the smallest losses on the worst days. Spread my risk: an equal share of risk, balanced by theme, or most diversified. Not sure? Start with Best return for the ups and downs.

Will optimized weights work in the future?

Not necessarily. The weights are fitted to past prices, so they flatter history. Use them as a starting point, cap the size of any one stock, and check the result on a different time period before relying on it.

Is this investment advice?

No. Indices Lab is a research and educational tool. Results are hypothetical and are not a recommendation to buy or sell any security.

Optimize your own index

Build an index, optimize it, backtest it and track it, free to start.

Get started free →