Introduction: The stock price index represents the overall economic situation of a country. Therefore, predicting this index is important for investors. The aim of this research is predicting the stock price index changes of the Tehran Stock Exchange by using neural networks.Method: In order to carry out this research, the data collected from the material industry and pharmaceutical products listed on the Tehran Stock Exchange during 2007-2013 have been used. Among 48 input variables, 10 input variables were selected by Particle Swarm Optimization Algorithm. This algorithm identifies an optimal combination of influential variables which include the independent variables of this research. Afterwards, the data relevant to the selected variables were inserted separately into the Firefly Algorithms, Radial Basis Functions, Multi-Layer Perceptron Networks, Imperialist Competitive Algorithm, and Adaptive Grid Scheme based on the Fuzzy Logic Systems, and then, these algorithms were taught. Next, the above mentioned algorithms have been tested by the estimated data; hence, the prediction error has been identified, and according to that, these methods have been compared. For this purpose, SPSS Software Version 11 and MATLAB Software Versions 6 and 7 were used.Results: Applying the influential variables in the predicting of the stock price index changes in the used algorithms in this research can reduce the prediction errors of the stock price index in the material industry and pharmaceutical products.Conclusion: The results of the research show that the Imperialist Competitive Algorithm has a better performance in relation to the other algorithms. Moreover, the suggested algorithms, in general, have a high ability in predicting the stock price index, and the output data for Imperialist Competitive Algorithm indicate the correlation coefficient of 0.9404.