Against the backdrop of the gradual advancement of China's electricity market reform, the number of Power Trading Companies in China has been increasing year by year, and as of October 2022, the number has reached more than 10,000. As an important hub connecting the electricity market and users, electricity retailers face double risks from downstream user load fluctuations and electricity market price fluctuations. Therefore, a reasonable power purchase and sale strategy is very important for an electricity retailer. In this study, a block bidding mechanism is adopted to optimize the clearing of the medium-to long-term market and a DA-RBF neural network is established for spot electricity price forecasting model based on numerical feature similarity to improve the accuracy of electricity price forecasting. Furthermore, the model considers the differences in user demand responses and investigates the optimal power purchase and sale strategy, guided by differentiated time-of-use electricity pricing. The case study analysis demonstrated that the proposed power purchase and sale optimization strategy yields favorable results, improving profitability and enhancing the stability of the power system.