Blog/Solutions
4 min read

The investment engine: a billion tests and why the best portfolio of the past wasn't the best afterwards

How to set up and run the CloudPortfolios optimizer and, above all, how to read the checking period: the best portfolios of the past did worse afterwards than simple alternatives.

What if a computer ran more than a billion tests for you to find the best portfolio? I tried it with the CloudPortfolios investment engine. It found portfolios with a spectacular past… and in the years that followed, on average, they did worse than something as simple as splitting the money equally. In this tutorial I show you how to use the engine and, above all, how to read what happened afterwards, something that is often left out. I designed the site and its tools myself.

Step 1: set it up

Go to Investing → Optimizer. The default values are fine for a first test, but it's worth understanding the six parts:

  • Universe: which assets it can choose from (stocks, ETFs, bond ETFs, index funds and commodities), with filters by region, sector and currency.
  • Dates: how far back it looks.
  • History split: by default, 70% to search (in-sample) and the final 30% to check (out-of-sample). To score the portfolios, the engine doesn't use the prices of the checking period.
  • Objective: what "best" means under the criterion you choose. You can ask for the best return per unit of risk (Sharpe), the lowest volatility, a target volatility, maximum diversification, equal risk contribution, limiting losses in the worst months, or following the trend.
  • Constraints: minimum and maximum number of assets, weight per asset and per sector, and maximum correlation between any pair, so it doesn't pick assets that move the same way.
  • Engine: Quick search (about a minute), Standard or Deep.

Step 2: run it

Click Run engine and you'll see the risk-and-return chart fill up as it tests combinations. In my example, with the maximum Sharpe objective, portfolios of 7 to 20 assets and a Quick search, it ran 1,308 million evaluations in 18 seconds (in that run, on the site's server) over 1,249 assets with a full price history for the whole period. These are evaluations, not different portfolios: the engine repeats and improves combinations until it stops finding anything better.

Step 3: read the results honestly

The table ranks portfolios by the objective in the search period, from January 2010 to September 2021. The best one had a Sharpe ratio of 2.84: a spectacular past. But look at the columns on the right, the ones for the checking period, from October 2021 to September 2026:

  • The 25 top-scoring portfolios returned an average of 6.7% a year.
  • Splitting the money equally across the whole universe returned 10.4%.
  • An S&P 500 index fund returned 12.8%.

That is a single five-year window, dominated by US stocks: it doesn't mean it will repeat, and it isn't a recommendation. Even so, in this search, what worked best in the past did worse afterwards than two much simpler alternatives. It isn't a flaw in the engine: it's what tends to happen when you search among so many combinations. Some look good by chance, and chance doesn't repeat. The result also depends on design choices (the universe, the objective, the constraints, price only without dividends), and a different design could give a different result. The site itself warns you: "In-sample results are always optimistic" and "Best found, not optimal".

Step 4: use it for ideas, not answers

Each portfolio opens in its full report, and the Best-scoring by number of assets tab shows how the result changes with 7, 8 or 20 assets. A sensible way to use it is to explore ideas and take a portfolio to the builder only to study how it behaves with the "what if…?" simulator, not to copy it. If a portfolio only shines in the search period, that's a warning sign.

Before you draw conclusions

Everything here is a hypothetical result based on past prices (monthly closes in US dollars from an external provider, EODHD; price only, no dividends, costs or taxes, and only assets that still trade). The figures also change with every run, because the search has a random element: the ones in this article come from a real search on 31 October 2026. The portfolios in the example are not recommendations.

For now the engine is free and you don't need to sign up. Try it with your own rules and always look at the checking period: knowing that a good past isn't enough is worth more than any perfect chart.


Educational and informational content only, published on 8 November 2026. It is not financial, tax or legal advice, nor a personalised investment recommendation, nor an offer or invitation to buy any product. The portfolios and assets in the example are used only to show how the tool works. Results are hypothetical, based on past prices (price only, no dividends, costs or taxes) and change with every run. Past performance does not guarantee future results, and all investing involves risk, including the loss of capital. Figures may have changed since publication. Before making a decision, consult an authorised professional.

Más de mil millones de pruebas para encontrar la mejor cartera… y lo que pasó después (tutorial)

Educational content, not investment advice. Examples use made-up numbers. Past performance does not guarantee future results.