Portfolio optimization has always been the main concern of investors. What differentiates different optimization models from each other is the risk measure. The main contribution of this paper is to provide a portfolio optimization model that considers systemic risk so that it can help investors make optimal investment decisions as a general model. For this purpose, two models are presented. In the first model, systemic and systematic risk were considered simultaneously, and in the second model, only systemic risk was considered. In the two mentioned models, delta conditional value at risk (∆CoVaR) and the Markowitz model are used respectively to measure systemic risk and a benchmark model. Also, the criteria used to compare the performance of the reviewed models include the ratio of reward-to-risk, along with the Sortino ratio and the Omega ratio. The problem of optimization and examination of the results was carried out on a selected sample, 38 companies listed in the Tehran Stock Exchange (TSE) from 2013 to 2023. The results of empirical analysis of out-of-sample data (during a period of 1198 days) show that based on all three mentioned criteria, the first proposed model shows the best performance among the three models. In addition, the performance of the second model is ranked second. In short, it can be said that considering systemic risk in portfolio optimization leads to better performance than the Markowitz model.