2) Implementation of genetic operators:
Since we need to select 10 stocks from an index having 25 stocks, each chromosome can be represented by a binary string consisting
of 25 bits, 10 of which are equal to ‘1’.
The fitness function evaluates the strength of each chromosome.
In our research, the fitness function equals the calculated tracking error of each chromosome.
The lower the better, because our objective is to minimize the tracking error defined by equation (1).
In order to calculate the fitness of each chromosome, we do need to determine the
optimal weight vector t of each chromosome by, first, solving minimization problem (2) and, second, based on the vector x found, calculating t.