The clearing price in electricity spot market is an important reference that guides marker participants in making energy purchase. Current electricity price forecasting methods consider the numerical accuracy of the forecast result only, ignoring the need to optimize economic benefits, while higher numerical precision sometimes leads to lower electricity-purchase gain. This paper proposes a price forecasting method that considers both economic benefits and numerical accuracy. A function representing the relationship between the predicted electricity prices and the cost reference for making energy purchase decisions is calculated, and then introduced to the loss function of the prosumers' forecasting model as a revenue-optimizing term. A sequence comparison neural network structure is designed and added to consumers' forecasting model, so that the results of numerical prediction and comparison both contribute to predicting better prices. By co-optimizing numerical precision and electricity-purchase gain, the prediction is more conducive to reducing the cost of purchasing power. Actual electricity market price data are used to verify the feasibility of the proposed forecasting method in improving economic benefits.