Internal controls and their improvement are essential issues in organizations and companies. Therefore, this mixed research was conducted to optimize the quality of internal controls of companies listed on the Iranian Stock Exchange using the imperialist competitive algorithm. This mixed study was conducted on 29 variables in the qualitative section by interviewing 18 experts to optimize the quality of internal controls of companies listed on the Iranian Stock Exchange. Qualitative and quantitative data analysis reached five stages of implementation. In the implementation of the fifth stage, 1550 repetitions were obtained, and the quality level of internal controls was reduced by 1.3473, which is the best possible value for the objective function. Paying severe attention to the systemic approach in the internal control system of companies can lead to a significant improvement in the internal controls of listed companies and enhance their performance. In addition, the effect of the systemic approach affects the level of shareholder satisfaction and the quality of risk detection and evaluation.