Portfolio optimization studies have traditionally assumed that portfolio managers manage only one portfolio. However, in reality, managers often manage multiple portfolios that can impact each other. This creates a need for fairness to all customers, which has led to the emergence of a new topic called "multiportfolio optimization". Previous studies have paid little attention to this issue, and the models used were not developed using real stock market data. These models were also limited to the selection phase and did not consider the ordering phase.This research provides a comprehensive process for addressing the multiportfolio problem, covering all sections from selection to ordering. It also implements the process using real stock market data. During this process, the market impact function is estimated using the I-STAR model for different stocks. The proposed model for market impact costs includes both permanent and temporary sections. The proposed models were tested using the Tehran Stock Exchange data in 2019.A comparison of the MPO model output with classical models indicates that the proposed model improves utility by an average of 15%. In the next phase, comparing the proposed ordering model with other models shows a reduction in market impact costs by an average of 26%.