The objective of this paper is to develop an algorithm to create an optimum portfolio from a large pool of stocks listed in a single market index SPX 500 Index: USA (for example) using genetic algorithm. The algorithm selects stocks on the basis of a priority index function designed on company fundamentals, and then genetically assigns optimum weights to the selected stocks by finding a genetically suitable combination of return and risk on the basis of historical data. The effect of genetic evolution on portfolio optimization has been demonstrated by developing a MATLAB code to implement the genetic application of reproduction, crossover and mutation operators. The effectiveness of the obtained portfolio has been successfully tested by running its performance over a 6 month holding period. It is found that genetic algorithm is successful in providing the optimum weights to stocks which were initially screened through a predetermined priority index function. The constructed portfolio beats the market for the considered holding period by a significant margin.