Selecting approaches with appropriate accuracy and suitable speed for the purpose of making decision is one of the managers’ challenges. Also investing decision is one of the main decisions of managers and it can be referred to securities transaction in financial markets which is one of the investments approaches. When some assets and barriers of real world have been considered, optimization of stock basket can’t be solved easily, therefore, Meta-Heuristic approach is considered. In this regard, the main goal of this paper is to solve stock portfolio constrained optimization problem by using of Firefly Algorithm (FA) and Imperialist Competitive Algorithm (ICA). In order to do so, daily information of 25 accepted stocks in period of 2010-2016, in Tehran stock market have been used. Results show that Firefly Algorithm (FA) and Imperialist Competitive Algorithm (ICA) showed successful function in constrained optimization of stock portfolio and has acceptable accuracy in finding optimal answers in whole risk and returns levels. Also, the results of comparison of Cardinality Constrained Mean – Variance (CCMV) and Cardinality Constrained Mean – Semi -Variance (CCMSV) portfolios two using of Firefly Algorithm (FA) and Imperialist Competitive Algorithm (ICA) and considering to the findings of two criteria for assessing accuracy in stock basket optimization simultaneously show that Imperialist Competitive Algorithm (ICA) has high speed and accuracy for solving stock basket optimization and could have desirable interaction with real barriers of market. Moreover, there is high accuracy optimization of Cardinality Constrained Mean – Semi -Variance (CCMSV) compared to Cardinality Constrained Mean – Variance (CCMV).