A genetic algorithm develops globally diversified portfolios

aivest builds portfolios from about 2,000 of the most heavily traded stocks in the world and, if you wish, from ETFs. They are meant to fluctuate less than a random selection, and no two look alike.

Create a portfolio Read the documentation

aivest is a demonstration with real market data and not investment advice.

Scatter plot: about 2,000 stocks as grey dots, below them three coloured dots for three portfolios. Lines lead from the 20 stocks of each portfolio to its dot, which lies lower than all stocks.

Figure 1. Every grey dot is a stock: the higher, the more its price fluctuated. Three calculations with the same inputs selected 20 stocks each. Because their movements partly cancel out, each of the three portfolios fluctuated less than any single stock. Measured on the same prices the calculation used; figure 3 shows the test on later prices.

How the calculation works

It starts with randomly assembled portfolios. The algorithm rates them, keeps the best, combines them with each other and replaces individual stocks. It repeats this generation after generation until the result no longer improves.

Genetic algorithms are an AI method modelled on evolution. An AI language model also helps to check the data of the roughly 2,000 companies once a month. The AI does not predict prices.

Line chart over 190 generations: the fluctuation of the best portfolio falls from 14.9 % to 11.3 %, quickly at first, then hardly any more.

Figure 2. One of the three calculations from figure 1: how much the best portfolio of each generation fluctuates. It improves quickly at first, then hardly at all, and the calculation stops once nothing improves any more.

What the test on later prices shows

On known prices an algorithm always finds a good solution. What counts is the behaviour afterwards. At 30 dates spread over recent years we therefore calculated five stock portfolios each, using only the prices known by then, and observed the following year.

All 150 fluctuated less than the 20 most traded stocks in equal parts, on average about half as much. The test used today's selection of stocks. It says nothing about returns, and it implies no promise for any individual future portfolio.

Two bars: in the year after the calculation, the 20 most traded stocks in equal parts typically fluctuated by 22.9 %, the aivest portfolios by 11.8 %.

Figure 3. Typical fluctuation (the median) in the year after the calculation. Each of the 150 aivest portfolios fluctuated less than the 20 most traded stocks over the same year.

Chance on purpose

If everyone received the same stocks, demand would concentrate on a few names. That is why chance has a say in the selection, with heavily traded companies drawn more often than small ones.

Stocks and ETFs

You choose the ETF share freely, from 0 % to 100 %. ETFs are currently available to residents of Germany.

A check of every result

Every portfolio is compared with random portfolios before you see it. If the gap is too small, you receive an error message instead of a weaker portfolio.

For financial service providers

Instruments, data, risk settings and cost models can be adapted. We answer questions about licensing at info@aivest.com.