SUMMARYVirtual power plant (VPP) is combining different types of generations and interruptible loads to be able to contribute to the market as a power plant with a significant output. In other words, different power generations are combined in a complementary manner to form a defined generation and a demand profile. Because the most important elements of these operators are distributed generation (DG) units and demand response loads (DRLs), the determination of optimal location, capacity, type, as well as the installation time of DGs, DRLs participation size, and place in the distribution system are the most important challenges of operators. In this paper, the formulation of optimal placement of DG resources and DRLs is presented and solved simultaneously in a distribution system to determine the optimal VPP. For this purpose, the concepts of commercial virtual power plant and technical virtual power plant are introduced first, and then the optimal VPP, which can send its energy bids as a short-term and long-term power scheduling to the power market, is determined. Here, commercial virtual power plant and technical virtual power plant will act jointly as commercial-technical virtual power plant to extract the results of the proposed optimization procedure. In this paper, the binary particle swarm optimization algorithm is used to solve the optimization problem in the distribution system. The proposed method is applied to the IEEE 33-bus distribution test network, and the results confirm the effectiveness of the proposed method.