Portfolio optimization problem follows the calculation of investment income per share, based on return and risk criteria. Since stock risk is achieved by calculating its return, which is itself computed based on stock price, it is essential to forecast the stock price, efficiently. In this paper, in order to predict the stock price, grey fuzzy technique with high efficiency is employed. The proposed study of this paper calculates the return and risk of each asset and portfolio optimization model is developed based on cardinality constraint and investment income per share. To solve the resulted model, Invasive Weed Optimization (IWO) algorithm is applied. In an example this algorithm is compared with other metaheuristic algorithms such as Imperialist Competitive Algorithm (ICA), Genetic Algorithm (GA) and Particle Swarm Optimization (PSO). The results show that the applied algorithm performs significantly better than other algorithms.