Researchers have been researching portfolio optimization issues for several years. One of the main issues is to determine the optimization method, which is to form an optimal investment portfolio, ie to minimize investment risk and maximize investment profit. This study aims to investigate the strategic capability of network matrix and fuzzy genetic neural model (ANFIS) in optimizing the investment portfolio among companies on the Tehran Stock Exchange. Grouping stocks by network matrix based on new variables including aggressive, indifferent, and defensive stocks provided by Roodpashti (2009) and traditional variables including growth, growth-value, and value stocks and classification of companies based on their market value and use. From the law of quarters and finally, their weighting is considered in proportion to the return of that share. The design and presentation of a stock portfolio optimization model using an adaptive fuzzy neural inference system and its combination with a genetic algorithm (ANFIS) in which two different categories of technical and fundamental variables are used as model inputs. Research outputs show that these systems have the necessary ability to optimize the stock portfolio. Therefore, a combined model of neural networks and fuzzy reasoning theory with a genetic algorithm has been used to weigh the factors affecting stock portfolio optimization in the 7 years leading up to 1398.