research

Optimal Portfolio Using a Genetic Algorithm

Abstract

Distributing the amount of money to invest in each stock of a portfolio, while maximizing profit and minimizing risk is key. This project applied the method of a genetic algorithm in order to select an optimal portfolio. A genetic algorithm generates solutions to optimization problems using techniques inspired by natural evolution. A five stock, five years’ portfolio was utilized in order to demonstrate the efficiency of a genetic algorithm. The most important steps of this method were the fitness function and the crossover. The fitness function is a formula that determined the effectiveness of the portfolio distribution; it returned a value for each portfolio distribution and the higher the value the better the distribution. The fitness function allowed us to rank and sort the generated distributions. Then, the crossover was performed in order to see how the genetic algorithm converges towards the optimal solution. The best portfolio distributions, according to the fitness function, were used for the crossover in order to generate even better distributions. Crossover was executed a couple of times by generating new generations of distributions, until the best distribution was produced. The best distribution produced a twenty-five percent average return and its computing time was eleven minutes

    Similar works