In this paper, the optimal allocation problem of the Electric Vehicles Parking Lots and DG in micro-grid is studied as a novel optimization problem. In the proposed problem, the different factors including the technical and the economic issues are considered for achieving a realistic solution. In addition, FACTS devices have been added to the network by considering the costs of installation, repair and maintenance, and their effecton the technical and economic parameters of the network has been investigated. Also, how to optimally charge and discharge storage devices and how to optimally inject active or reactive power by charging stations to improve energy management in the network has been studied. In order to evaluate the impact and reduce economic costs, the optimal number of distributed renewable energy, storage and FACTS equipment along with the optimal number of parking lots with Existence of different number of electric vehicles in the survey and microgrid network has been designed using a two-stage optimization method. The method is simulated on the standard IEEE 33 bus. The results show that the optimal power factor of parking lots can be determined during the unloading of vehicles in such a way that the technical parameter of the network is improved.