# Deep Reinforcement Learning-Based Trading Strategy for Load Aggregators on Price-Responsive Demand

Authors: Guang Yang; Songhuai Du; Qingling Duan; Juan Su
Journal: Computational Intelligence and Neuroscience
 (2022)

---

## Abstract

With the development of the Internet of things and smart grid technologies, modern electricity markets seamlessly connect demand response to the spot market through price-responsive loads, in which the trading strategy of load aggregators plays a crucial role in profit capture. In this study, we propose a deep reinforcement learning-based strategy for purchasing and selling electricity based on real-time electricity prices and real-time demand data in the spot market, which maximizes the revenue of load aggregators. The deep deterministic policy gradient (DDPG) is applied through a bidirectional long- and short-term memory (BiLSTM) network to extract the market state features that are used to make trading decisions. The effectiveness of the method is validated using datasets from the New England electricity market and Australian electricity market by introducing a bidirectional LSTM structure into the actor-critic network structure to learn hidden states in partially observable Markov states through memory inference. Comparative experiments of the method show that the method can provide greater yield results.


---

## Body

## 1. Introduction

The basic feature of the electricity market is that prices follow demand and price changes affect the quantity demanded [1]. The economic operation of the electricity market will help to reduce the cost of electricity use and is an effective way of enhancing the security of the electricity system through economy [2]. The study of response characteristics in terms of timing, trading rules, etc., can enhance the flexibility of electricity markets to improve the accuracy of forecasting and decision-making [3–5]. In recent years, with the development of the Internet of things and smart grid technologies, especially the technological advancement of ambient intelligence, the widespread deployment of smart meters has equipped more customers with two-way communication capability, making price-responsive load possible. Price-responsive demand (PRD), which unifies the original price-based and incentive-based demand-side response, makes the originally uncontrollable price-based demand response a controllable resource and unifies the incentive-based demand response to the response to price.For system operators, PRD is a reliable real-time resource that can be described as the price-adjusted load, providing a new means and tool for dispatch; for consumers, PRD reduces electricity bills and improves energy use efficiency. The EcoGrid EU trial results show that residential load could be considered price-sensitive on certain test days [6]. Moreover, the California ISO PJM and Alstom Grid results show that PRD helped improve the efficiency of market operations and significantly increase system reliability [7]. Price-responsive mechanisms facilitate the integration of new flexible energy sources and reduce rail operating costs [8].Load aggregators can consolidate demand response customer resources and become price-responsive loads as a single large customer. To a certain extent, this eliminates uncertainty in user response behavior and allows small and medium loads to participate in the electricity market in conjunction with their own load control characteristics; aggregated demand response resources can be flexibly managed to improve response efficiency based on forecast or current electricity spot market prices. In Liu et al. [9], a hybrid stochastic/robust optimisation approach with a model that minimizes the expected net cost was proposed for distributed generation (DG), storage, dispatchable DG, and price-sensitive load bidding strategies in the pre-electricity day market. The results show that the wind power output had a negative correlation with the price-based demand response load response, and the correlation could reduce the system operating cost and improve the economy of system dispatch. In Geng et al. [10], a two-stage stochastic market power purchase model with DR resources was constructed to minimize the energy purchase cost of integrated energy service providers in different types of markets, and the impact of flexible heating load on their power purchase strategy was presented. In the previous day’s market, a multi-time scale stochastic optimal scheduling model for electric vehicle (EV) charging stations with demand response was proposed with the objective of minimizing the daily operating cost and introducing price-based demand response to optimise the net load curve of charging stations [11]. Combining the price-based demand response measures, the optimisation was proposed with the objectives of maximizing the revenue of EV load aggregators and minimizing the load fluctuation [12].Heuristic algorithms, meta-heuristics, and intelligent evolutionary algorithms for the optimal solution of decision problems are used in various fields. In Zhao and Zhang [13], a learning-based generalisation algorithm is proposed to improve generalisation by adjusting the evolutionary strategy of the algorithm based on feedback information in the optimisation process according to the actual problem. Pasha et al. [14] present an integrated optimisation model whose objective is to maximize the total turnover profit generated by the transport business and solve the proposed model through a decomposition-based heuristic algorithm. Kavoosia et al. [15] propose an evolutionary algorithm to solve the developed mathematical model, implemented through an enhanced adaptive parameter control strategy that effectively varies the algorithm parameters throughout the search process. Dulebenets’ [16] study proposes a new adaptive polymorphic memory algorithm to solve the scheduling problem of transport and to help operators in proper operational planning. Rabbani et al.’s [17] study presents a mixed integer linear programming model to find the optimal route sequence and minimize time consumption through non-dominated sequential genetic algorithm II and multi-objective particle swarm optimisation.In recent years, deep reinforcement learning has autonomous recognition and decision-making capabilities and has been successfully applied in the energy sector [18–20]. The feasibility of using it for grid regulation has also been demonstrated [21, 22]. The requirements associated with demand response can be met [23]. Reinforcement learning theory represents a mathematical model of learning that is rewarded by repeated trial and error and is based on the psychological term operant conditioning, which derives its name from the phenomenon of the increased frequency of autonomous behavior reinforcement. A customer agent model was proposed in [24] applying reinforcement learning Q-learning for predicting price-sensitive load reductions. A pricing strategy was investigated in [25] for charging station operators based on noncooperative games and deep reinforcement learning, and the effectiveness of the proposed framework was validated with real data from cities. Moreover, a real-time pricing technique was proposed in [26] based on multi-intelligent reinforcement learning, and it worked well in producing consumer-driven applications of mini-smart grids. The researchers behind [27] considered thermostatically controlled loads, energy storage systems (ESS), and price-responsive loads for flexible demand-side dispatch of microgrids based on deep reinforcement learning, which significantly reduced input costs. The researchers of [28] gave a dynamic pricing strategy based on DDPG considering the historical behavior data of electric vehicles, peak-valley time-sharing tariff, and the demand-side response pattern to guide the customer tariff behavior and exploit the economic potential of the electricity market. Considering the cooperation between wind farms and electric vehicles, an intelligent pricing decision was proposed in [29] for EV load aggregators based on deep reinforcement learning algorithms to achieve an increase in overall economic benefits. To maximize the long-term revenue of electricity sellers under the electricity spot market, the researchers of [30] proposed a dynamic optimisation scheme for demand response using reinforcement learning. For the price difference between the day-ahead and real-time markets in the electricity spot market, the researchers of [31] achieved an effective solution for the optimal bidding strategy based on deep reinforcement learning. Further, an improved deep deterministic policy gradient algorithm was proposed in [32] as a building-level control strategy to improve the distributed electric heating load-side demand response capability. A dual DQN agent was proposed in [33] to evaluate the elasticity of power systems. Other research [34] combined the cross-entropy method (CEM), the maximum mean difference method (MMD), and the deep deterministic policy gradient algorithm with twin delays (TD3) in evolutionary strategies to propose the diversity evolutionary strategy deep reinforcement learning (DEPRL).In summary, load aggregators, acting on behalf of small and medium electricity consumers in price-responsive load trading, face the problem of how to purchase electricity from the market and sell it to consumers and need to optimise their decision-making options in terms of both purchases and sales in order to maximize profits. Therefore, it is necessary to study the buying and selling strategies of price-responsive loads that can be carried out by load aggregators in dynamic trading in the electricity spot market. It is also necessary to overcome the problem of the slow training convergence rate when the input dimension of reinforcement learning is too large. Based on the above problems, this study proposes a deep reinforcement learning method based on BiLSTM for load aggregators to purchase and sell electricity, taking the maximum revenue of load aggregators under the price-responsive load mechanism as the scenario. The contributions of this study are as follows.We propose a BiLSTM-DDPG model to make the trading strategy for load aggregators. We describe the trading process as a partially observable Markov decision process (POMDP). The bidirectional LSTM neural network is used to process the bidirectional time axis state information one by one and generate bidirectional coded information to cope with the dynamic changes in an uncertain environment. We propose the BiLSTM-DDPG method, which integrates time-domain processing and has autonomous recognition and decision-making capabilities. BiLSTM can extract features and temporal relationships, avoiding gradient disappearance and gradient explosion. DDPG allows for more accurate recognition and optimal decision-making for complex electricity spot market environments.


## 2. Materials and Methods

### 2.1. BiLSTM Model

The recurrent neural network (RNN) is a neural network that processes temporal data as input to itself. In a single computational unit, the data (xt) from the previous t moments and the computational output (ht − 1) from the previous t − 1 moments are used as input, and in the unit output, in addition to the output yt, ht is also generated, and the data are passed on to the next moment (t + 1) for the next computation. The RNN based on this design structure has predictive capability. LSTM is an improved RNN, and compared with RNN, LSTM adds the forgetting gate at the output and implements the forgetting function by a state parameter (c). The LSTM structure is shown in Figure 1.Figure 1
Neuron structure of LSTM.The LSTM cell contains an oblivion gate, an input gate, and an output gate. The oblivion gate (ft) selectively forgets the information of the previous cell, as shown in equation (1); it takes the information of the previous cell and the current state as input and outputs a value from 0 to 1 by the sigmoid function, and this value is the percentage of retained transmission information. The current cell input information proportion is controlled by the input gate, as shown in (2), C∼ is the proportion of retained information, as shown in (3), and (4), representing Ct, weights the retained information and new information as the current cell state. The output gate determines how much information is output, and (5) and (6) pass some of the information from the current cell to the later cells [35–37]. The DDPG algorithm with LSTM added stores and passes on information about the trend of the hidden state of the environment in the time domain, as shown in the following equations:(1)ft=sigmoidWf⋅ht−1,xt+bf,(2)it=sigmoidWi⋅ht−1,xt+bi,(3)C∼=tanhWc⋅ht−1,xt+bc,(4)Ct=ft−1⊙Ct−1+it⊙C,(5)ot=sigmoidWo⋅ht−1,xt+bo,(6)ht=ottanhCt.The BiLSTM propagates the state of the hidden layer using a timeline of “from the past to the future” and “never to the past” directions, as shown in Figure2. The BiLSTM captures the transformation pattern of features on a bidirectional time axis. In the figure, LSTM1 and LSTM2 are the forward and reverse LSTM models, respectively. The output at moment ht can be expressed as follows:(7)ht=LSTM1Ht−1,Ht+LSTM2.Figure 2
Neuron structure of BiLSTM.


### 2.2. Reinforcement Learning

The mathematical basis for reinforcement learning is the Markov decision process (MDP), which consists of a state space, an action space, a state transfer matrix, a reward function, and a discount factor. The MDP tries to find a strategy that allows the system to obtain the maximum cumulative reward value. The state is a generalisation of the current environment; the state space is the set of all possible states, denoted as S; action is the decision made; the action space is the set of all possible actions, denoted as A; the agent is the subject doing the action; and the policy function is the decision to control the action of an intelligent body based on the observed state.Agent environment interaction (AEI) is when an intelligent body observes the state of the environment (s) and makes an action (a), the action changes the state of the environment, and the environment gives the intelligent body a reward (r) and a new state (s′), as shown in Figure 3.Figure 3
An agent interacts with the environment.In this study, MDPs can be expressed as(S, O, A, P, r, γ, S), where S is a set of consecutive states, and A is a series of consecutive actions. P:S×A×S⟶R is the transfer probability function, r:S×A⟶R is the reward function, γ is the discount factor, S is the initial state distribution, and O is the set of continuous partial observations corresponding to the states in S. In training, S0 is obtained by sampling from the initial state distribution S. At each time step t, the intelligence determines the current ambient state space (St ∈ S). The reward r: S × A ⟶ R is obtained by taking the action at∈π (st) according to the strategy π: S ⟶ A, and the new ambient state St+1 is obtained.The goal of the intelligent body is to maximize the expected return, as follows:(8)EsR0|S.The payoff is the discounted sum of future returns, as follows:(9)Rt=∑i=t∞γi−tri.TheQ function is defined as follows:(10)Qπst,at=ERt|st,at.In the partially observable case, an agent acts on partial observations,at = π(Ot), where Ot is the partial observation corresponding to the complete state (St).


### 2.3. DDPG Model

The DDPG algorithm incorporates the ideas of DQN and uses a deterministic policy function to enable the problem to perform better on continuous spaces of high dimensionality. The learning framework for deterministic strategies takes the approach of the actor-critic algorithm, where the actor is the action strategy, and the critic is the evaluation, which in this case estimates the value function using function approximation methods. The network structure of DDPG is shown in Figure4.Figure 4
Network structure of DDPG.DDPG uses two neural networks to represent the deterministic strategyA = πθ(s) and the value function Qμ(s, A). The network parameters are θ and μ, where the strategy neural network is used to update the behavioral strategy of the intelligence, corresponding to the actor network in the actor-critic structure, and the value network is used to approximate the value function and provide gradient information for the update of the strategy network, corresponding to the critic network in the actor-critic structure. DDPG finds an optimal strategy πθ to maximize the expected return, as follows:(11)Jθ=Esi∼pπ,ai∼πR0.A parameter update of policy network by the gradient∇θJθ is as follows:(12)∇θJθ=Es∼pπ∇aQπs,a|a=πs∇θπθs.The expected return value after taking action A in state S, following strategyπ, is as follows:(13)Qπs,a|=Esi∼pπ,ai∼πRt|s,a.The value network is updated according to the value-network-updating method in DQN; namely, the loss minimization functionL(μ) is used to update the value network parameters, as shown in the following equations:(14)Lμ=Est,at,rst,at,st+1yt−Qtst,at2,(15)yt=rst,at+γQμst+1,at+1,(16)at+1∼πθst+1,where θ′’ and μ′’ denote the target actor network and target critic network parameters, respectively. DDPG uses a data playback mechanism to obtain training samples [38–41]. The information about the gradient of the Q-value function regarding the action of the intelligent body is passed to the actor network through the critic network, and the update of the policy network is performed in the direction of boosting the Q-value according to (16).


### 2.4. BiLSTM-DDPG-Based Trading Strategy for Load Aggregators on PRD

The description of the variables of the BiLSTM-DDPG-based trading strategy for load aggregators on PRD is shown in Table1. The BiLSTM-DDPG model processing steps for power markets are shown in Figure 5. The DDPG deep reinforcement learning with BiLSTM structure is based on the actor-critic network structure, shown in Figure 6.Table 1
Description of the variables of the DDPG.
NameMeaningMeaning of this studyAgentIntelligence to be controlledPrice load-responsive load aggregatorState, SStatus of the agentCurrent electricity spot market price (λtRT, λtDA)Action, aActions that an agent can takePurchase and sale of electricity (outputsell/buy)Reward, rTimely return value of the environment used to evaluate the quality of an action on an agentRevenue from load aggregatorsλtRT−Pt,sRT−λtRT+Pt,pRT−λtDAPtDAPolicy, PAgent decides the strategy of the next action based on the current stateBuying and selling actions in the next cycle are determined based on the status of the load aggregator in the previous cycleValueReturn value of an agent action’s long-term value, distinguished from the short-term return represented by rewardTotal revenue over the period of operation∑t∈TλtRT−Pt,sRT−∑t=1TλtRT+Pt,pRT−∑t=1TλtDAPtDAEnvironmentEnvironment of the agentFluctuations in electricity prices (inputt real-time locational marginal price, input t real-time l demand)Figure 5
BiLSTM-DDPG model processing steps for power markets.Figure 6
Structure of the actor-critic network.For load aggregators, the main objective of participating in price demand response is to maximize the benefits of energy trading. The total benefits received by the load aggregator in the real-time market are as follows:(17)maxR=RRT−CRT−CDA,where RRT is the profit on electricity sales in the real-time market, CRT is the cost of electricity purchased by the electricity seller in the real-time market, and CDA is the cost of electricity purchased in the day-ahead market.(18)maxR=RRT=∑t∈TλtRT−Pt,sRT−∑t=1TλtRT+Pt,pRT−∑t=1TλtDAPtDA,where λtRT− is the selling price in the real-time market at time t, and Pt,sRT is the amount of electricity sales. λtRT+ is the purchase price in the real-time market at time t, and Pt,pRT is the amount of electricity purchased. λtDA is the purchase price in the day-ahead market at time t, and PtDA is the amount of electricity purchased.The input of the neural network is the state, and the output is action value. The neural network consists of three full connection layers; the first two layers are activated by the rectified linear unit function, and the third layer is the linear connection. The agent is built according to the logic of the pseudo-code, obtaining the reward values, iterating through the Bellman equation, and then gradient descending the difference between the target network and the action network, where the target network is updated using the soft update method. The parameters and description of DDPG algorithm used in the case are shown in Table2.Table 2
Description of the parameters of the DDPG.
ParametersMeaningValueTAUSmoothing coefficient of target network in actor and critic network0.001αActor network and critic network learning rate0.0005Batch_sizeNumber drawn from the experience pool per training64CapacitySize of the experience pool100000γDiscount factor0.99The DDPG that introduces the BiLSTM needs to use the before-and-after order of states during training, so the corresponding experience pool data are saved as a sequence of whole sets to provide experience data for subsequent updates of the actor and critic networks, and the sequence of saved data is as follows:(19)o1,a1,r1,s1,o2,a2,r2,s2...oT,aT,rT,sT,where T is the number of steps per set. When the number of time steps is a multiple of T, the program structure is cleared of historical data records, and the empirical data are recoded. We can reconstruct observable historical information and full-state historical information from empirical data, as follows:(20)ct=s1,a1,...,at−1,st,ht=o1,a1,...,at−1,ot.The critic and actor networks are updated separately. As BiLSTM is a time-series-based RNN, the updates to the critic and actor networks are backpropagated through time (BPTT), and the updates are as follows:(21)Δμ=1NT∑∑yti−Qμcti,ati|μ∂Qμhti,ati∂μ,Δθ=1NT∑∑∂Qμcti,πθhti∂a∂πθhti∂θ.The pseudo-code of BiLSTM-DDPG is as follows:The parametersμ and θ initialize the critic network Qμ(at, st) and the actor network πθ(ht), respectively;μ′← μ,θ′←θ initialize the target networks Qμ and πθ;Initialize the experience replay area ®:for episode = 1,. ..,M doClear the history informationh0 and c0;Fort = 1,. .., T doGet observation (ot) and full state (St.) from environmentUpdate the history information,ht←ht−1,at−1,ot;Generate action,at=πθht+ξ;End forStore the empirical sequence (o1,a1,r1,s1,o2,a2,r2,s2...oT,aT,rT,sT) into the experience pool R;Sample N episodes of experiences in experience poolRo1i,a1i,r1i,s1i,o2i,a2i,r2i,s2i...oTi,aTi,rTi,sTii=1,...,N;Construct partial observable history,hti=o1i,a1i,...,at−1i,oti;Construct the full state history message,cti=s1i,a1i,...,at−1i,sti;Calculate the target value of each sample,y1i,...yTi;Update the critic network:Δμ=1/NT∑∑yti−Qμcti,ati|μ∂Qμhti,ati/∂μ;Update the actor network:Δθ=1/NT∑∑∂Qμcti,πθhti/∂a∂πθhti/∂θ;Update target network:μ′←τμ+1−τμ′;θ′←τθ+1−τθ′;End for


## 2.1. BiLSTM Model

The recurrent neural network (RNN) is a neural network that processes temporal data as input to itself. In a single computational unit, the data (xt) from the previous t moments and the computational output (ht − 1) from the previous t − 1 moments are used as input, and in the unit output, in addition to the output yt, ht is also generated, and the data are passed on to the next moment (t + 1) for the next computation. The RNN based on this design structure has predictive capability. LSTM is an improved RNN, and compared with RNN, LSTM adds the forgetting gate at the output and implements the forgetting function by a state parameter (c). The LSTM structure is shown in Figure 1.Figure 1
Neuron structure of LSTM.The LSTM cell contains an oblivion gate, an input gate, and an output gate. The oblivion gate (ft) selectively forgets the information of the previous cell, as shown in equation (1); it takes the information of the previous cell and the current state as input and outputs a value from 0 to 1 by the sigmoid function, and this value is the percentage of retained transmission information. The current cell input information proportion is controlled by the input gate, as shown in (2), C∼ is the proportion of retained information, as shown in (3), and (4), representing Ct, weights the retained information and new information as the current cell state. The output gate determines how much information is output, and (5) and (6) pass some of the information from the current cell to the later cells [35–37]. The DDPG algorithm with LSTM added stores and passes on information about the trend of the hidden state of the environment in the time domain, as shown in the following equations:(1)ft=sigmoidWf⋅ht−1,xt+bf,(2)it=sigmoidWi⋅ht−1,xt+bi,(3)C∼=tanhWc⋅ht−1,xt+bc,(4)Ct=ft−1⊙Ct−1+it⊙C,(5)ot=sigmoidWo⋅ht−1,xt+bo,(6)ht=ottanhCt.The BiLSTM propagates the state of the hidden layer using a timeline of “from the past to the future” and “never to the past” directions, as shown in Figure2. The BiLSTM captures the transformation pattern of features on a bidirectional time axis. In the figure, LSTM1 and LSTM2 are the forward and reverse LSTM models, respectively. The output at moment ht can be expressed as follows:(7)ht=LSTM1Ht−1,Ht+LSTM2.Figure 2
Neuron structure of BiLSTM.


## 2.2. Reinforcement Learning

The mathematical basis for reinforcement learning is the Markov decision process (MDP), which consists of a state space, an action space, a state transfer matrix, a reward function, and a discount factor. The MDP tries to find a strategy that allows the system to obtain the maximum cumulative reward value. The state is a generalisation of the current environment; the state space is the set of all possible states, denoted as S; action is the decision made; the action space is the set of all possible actions, denoted as A; the agent is the subject doing the action; and the policy function is the decision to control the action of an intelligent body based on the observed state.Agent environment interaction (AEI) is when an intelligent body observes the state of the environment (s) and makes an action (a), the action changes the state of the environment, and the environment gives the intelligent body a reward (r) and a new state (s′), as shown in Figure 3.Figure 3
An agent interacts with the environment.In this study, MDPs can be expressed as(S, O, A, P, r, γ, S), where S is a set of consecutive states, and A is a series of consecutive actions. P:S×A×S⟶R is the transfer probability function, r:S×A⟶R is the reward function, γ is the discount factor, S is the initial state distribution, and O is the set of continuous partial observations corresponding to the states in S. In training, S0 is obtained by sampling from the initial state distribution S. At each time step t, the intelligence determines the current ambient state space (St ∈ S). The reward r: S × A ⟶ R is obtained by taking the action at∈π (st) according to the strategy π: S ⟶ A, and the new ambient state St+1 is obtained.The goal of the intelligent body is to maximize the expected return, as follows:(8)EsR0|S.The payoff is the discounted sum of future returns, as follows:(9)Rt=∑i=t∞γi−tri.TheQ function is defined as follows:(10)Qπst,at=ERt|st,at.In the partially observable case, an agent acts on partial observations,at = π(Ot), where Ot is the partial observation corresponding to the complete state (St).


## 2.3. DDPG Model

The DDPG algorithm incorporates the ideas of DQN and uses a deterministic policy function to enable the problem to perform better on continuous spaces of high dimensionality. The learning framework for deterministic strategies takes the approach of the actor-critic algorithm, where the actor is the action strategy, and the critic is the evaluation, which in this case estimates the value function using function approximation methods. The network structure of DDPG is shown in Figure4.Figure 4
Network structure of DDPG.DDPG uses two neural networks to represent the deterministic strategyA = πθ(s) and the value function Qμ(s, A). The network parameters are θ and μ, where the strategy neural network is used to update the behavioral strategy of the intelligence, corresponding to the actor network in the actor-critic structure, and the value network is used to approximate the value function and provide gradient information for the update of the strategy network, corresponding to the critic network in the actor-critic structure. DDPG finds an optimal strategy πθ to maximize the expected return, as follows:(11)Jθ=Esi∼pπ,ai∼πR0.A parameter update of policy network by the gradient∇θJθ is as follows:(12)∇θJθ=Es∼pπ∇aQπs,a|a=πs∇θπθs.The expected return value after taking action A in state S, following strategyπ, is as follows:(13)Qπs,a|=Esi∼pπ,ai∼πRt|s,a.The value network is updated according to the value-network-updating method in DQN; namely, the loss minimization functionL(μ) is used to update the value network parameters, as shown in the following equations:(14)Lμ=Est,at,rst,at,st+1yt−Qtst,at2,(15)yt=rst,at+γQμst+1,at+1,(16)at+1∼πθst+1,where θ′’ and μ′’ denote the target actor network and target critic network parameters, respectively. DDPG uses a data playback mechanism to obtain training samples [38–41]. The information about the gradient of the Q-value function regarding the action of the intelligent body is passed to the actor network through the critic network, and the update of the policy network is performed in the direction of boosting the Q-value according to (16).


## 2.4. BiLSTM-DDPG-Based Trading Strategy for Load Aggregators on PRD

The description of the variables of the BiLSTM-DDPG-based trading strategy for load aggregators on PRD is shown in Table1. The BiLSTM-DDPG model processing steps for power markets are shown in Figure 5. The DDPG deep reinforcement learning with BiLSTM structure is based on the actor-critic network structure, shown in Figure 6.Table 1
Description of the variables of the DDPG.
NameMeaningMeaning of this studyAgentIntelligence to be controlledPrice load-responsive load aggregatorState, SStatus of the agentCurrent electricity spot market price (λtRT, λtDA)Action, aActions that an agent can takePurchase and sale of electricity (outputsell/buy)Reward, rTimely return value of the environment used to evaluate the quality of an action on an agentRevenue from load aggregatorsλtRT−Pt,sRT−λtRT+Pt,pRT−λtDAPtDAPolicy, PAgent decides the strategy of the next action based on the current stateBuying and selling actions in the next cycle are determined based on the status of the load aggregator in the previous cycleValueReturn value of an agent action’s long-term value, distinguished from the short-term return represented by rewardTotal revenue over the period of operation∑t∈TλtRT−Pt,sRT−∑t=1TλtRT+Pt,pRT−∑t=1TλtDAPtDAEnvironmentEnvironment of the agentFluctuations in electricity prices (inputt real-time locational marginal price, input t real-time l demand)Figure 5
BiLSTM-DDPG model processing steps for power markets.Figure 6
Structure of the actor-critic network.For load aggregators, the main objective of participating in price demand response is to maximize the benefits of energy trading. The total benefits received by the load aggregator in the real-time market are as follows:(17)maxR=RRT−CRT−CDA,where RRT is the profit on electricity sales in the real-time market, CRT is the cost of electricity purchased by the electricity seller in the real-time market, and CDA is the cost of electricity purchased in the day-ahead market.(18)maxR=RRT=∑t∈TλtRT−Pt,sRT−∑t=1TλtRT+Pt,pRT−∑t=1TλtDAPtDA,where λtRT− is the selling price in the real-time market at time t, and Pt,sRT is the amount of electricity sales. λtRT+ is the purchase price in the real-time market at time t, and Pt,pRT is the amount of electricity purchased. λtDA is the purchase price in the day-ahead market at time t, and PtDA is the amount of electricity purchased.The input of the neural network is the state, and the output is action value. The neural network consists of three full connection layers; the first two layers are activated by the rectified linear unit function, and the third layer is the linear connection. The agent is built according to the logic of the pseudo-code, obtaining the reward values, iterating through the Bellman equation, and then gradient descending the difference between the target network and the action network, where the target network is updated using the soft update method. The parameters and description of DDPG algorithm used in the case are shown in Table2.Table 2
Description of the parameters of the DDPG.
ParametersMeaningValueTAUSmoothing coefficient of target network in actor and critic network0.001αActor network and critic network learning rate0.0005Batch_sizeNumber drawn from the experience pool per training64CapacitySize of the experience pool100000γDiscount factor0.99The DDPG that introduces the BiLSTM needs to use the before-and-after order of states during training, so the corresponding experience pool data are saved as a sequence of whole sets to provide experience data for subsequent updates of the actor and critic networks, and the sequence of saved data is as follows:(19)o1,a1,r1,s1,o2,a2,r2,s2...oT,aT,rT,sT,where T is the number of steps per set. When the number of time steps is a multiple of T, the program structure is cleared of historical data records, and the empirical data are recoded. We can reconstruct observable historical information and full-state historical information from empirical data, as follows:(20)ct=s1,a1,...,at−1,st,ht=o1,a1,...,at−1,ot.The critic and actor networks are updated separately. As BiLSTM is a time-series-based RNN, the updates to the critic and actor networks are backpropagated through time (BPTT), and the updates are as follows:(21)Δμ=1NT∑∑yti−Qμcti,ati|μ∂Qμhti,ati∂μ,Δθ=1NT∑∑∂Qμcti,πθhti∂a∂πθhti∂θ.The pseudo-code of BiLSTM-DDPG is as follows:The parametersμ and θ initialize the critic network Qμ(at, st) and the actor network πθ(ht), respectively;μ′← μ,θ′←θ initialize the target networks Qμ and πθ;Initialize the experience replay area ®:for episode = 1,. ..,M doClear the history informationh0 and c0;Fort = 1,. .., T doGet observation (ot) and full state (St.) from environmentUpdate the history information,ht←ht−1,at−1,ot;Generate action,at=πθht+ξ;End forStore the empirical sequence (o1,a1,r1,s1,o2,a2,r2,s2...oT,aT,rT,sT) into the experience pool R;Sample N episodes of experiences in experience poolRo1i,a1i,r1i,s1i,o2i,a2i,r2i,s2i...oTi,aTi,rTi,sTii=1,...,N;Construct partial observable history,hti=o1i,a1i,...,at−1i,oti;Construct the full state history message,cti=s1i,a1i,...,at−1i,sti;Calculate the target value of each sample,y1i,...yTi;Update the critic network:Δμ=1/NT∑∑yti−Qμcti,ati|μ∂Qμhti,ati/∂μ;Update the actor network:Δθ=1/NT∑∑∂Qμcti,πθhti/∂a∂πθhti/∂θ;Update target network:μ′←τμ+1−τμ′;θ′←τθ+1−τθ′;End for


## 3. Results and Discussion

### 3.1. Experimental Settings

The experimental environment is as follows: Python 3.6.2, TensorFlow 2.0.0a GPU, Intel(R) Core(TM) i5-7200U@2.50 GHz∼2.70 GHz, 64 bit, 8 GB of RAM, and NVIDIA GeForce 940MX.The first dataset is the annual whole-point data of the New England electricity market (ISO-NE) in the United States, selected for the Connecticut Region [42]. Real-time electricity price data are collected for 1,917 consecutive days from January 1, 2016, to March 31, 2022, at a frequency of once per hour, for a total of 46,008 moments.The second dataset is the annual whole-point data of the Australian Energy Market Operator (AEMO) in the Australian, selected for the Connecticut New South Wales Region [43]. Real-time electricity price data are collected for 1186 consecutive days from January 1, 2018, to September 30, 2021, at a frequency of once per half hour, for a total of 56,928 moments.


### 3.2. Experiment 1: Hourly Load Aggregator Trading Strategy in ISO-NE

In this experiment, the prediction of three days’ worth of trading strategy from January 1, 2016, to March 28, 2022, is used as the training set, data from March 29, 2022, to March 30, 2022, as the validation set, and data from April 1, 2021, to April 3, 2021, as the test set.The comparison of the profit curves for the hourly load aggregator trading strategy in ISO-NE is shown in Figure7; the performance of buying and selling is shown in Table 3; trading strategies from April 1, 2021, 0:00, to April 2, 2021, 4:30, in the ISO-NE results are shown in Figure 8. The overall evaluation from April 1, 2021, 0:00, to April 2, 2021, 4:30, in ISO-NE is shown in Table 4. It is demonstrated that the proposed method is more economical than DNN-DDPG, RNN-DDPG, and LSTM-DDPG, indicating ith as better convergence ability.Figure 7
Profit curves of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and the proposed method in ISO-NE.Table 3
Performance of buying and selling of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and proposed method.
TimeReal-time demandReal-time LMPDNN-DDPGstrategyRNN-DDPGprofitLSTM-DDPGprofitProposed methodprofit2021/4/1 0:002180.2918.58——Sell—2021/4/1 1:002128.7817.66——Buy—2021/4/1 2:002129.5916.97—SellBuy—2021/4/1 3:002199.5917.39——Sell——2021/4/1 4:002396.9617.47——Sell—2021/4/1 5:002726.917.76Sell——2021/4/1 6:003025.0317.19——Sell—2021/4/1 7:003184.9819.24Sell—BuySell2021/4/1 8:003232.8619Sell—Sell—2021/4/1 9:003189.7220.15Sell—Buy—2021/4/1 10:003158.3826.81SellSellBuy—2021/4/1 11:003124.123.9Sell——2021/4/1 12:003140.7921.25SellSellSell—2021/4/1 13:003124.5120.76Sell——2021/4/1 14:003095.2120.12Sell——2021/4/1 15:003099.0921.59Sell——2021/4/1 16:003160.1822.99Sell—Sell—2021/4/1 17:003215.5423.36Sell—SellSell2021/4/1 18:003318.2922.24——Sell—2021/4/1 19:00327522.64Sell—Buy—2021/4/1 20:003149.4922.73——BuySell2021/4/1 21:002920.1923.02Sell—Sell—2021/4/1 22:002696.8921.73——Buy—2021/4/1 23:002536.6220.57——Sell—2021/4/2 0:002456.5422.66Sell—BuyBuy2021/4/2 1:002422.4423.39Sell—SellBuy2021/4/2 2:002429.7422.41——BuySell2021/4/2 3:002496.122.73——Sell—2021/4/2 4:002665.9224.23Sell——2021/4/2 5:002909.7527.85SellSellSell—2021/4/2 6:003073.8529.92Sell—Sell—2021/4/2 7:003107.3230.83Sell—BuySell2021/4/2 8:003160.1230.14SellBuySell—2021/4/2 9:003185.1628.23Sell—Buy2021/4/2 10:003207.4930.96Sell—SellSell2021/4/2 11:003191.8338.49Sell—Buy—2021/4/2 12:003172.8934.4Sell—SellSell2021/4/2 13:003132.935.41Sell—SellSell2021/4/2 14:003168.1425.88Buy—Buy—2021/4/2 15:003249.8242.4SellSellSell2021/4/2 16:003350.1151.55SellSellSell—2021/4/2 17:003368.9161.76Sell—SellSell2021/4/2 18:003435.659.28Sell—SellSell2021/4/2 19:003389.9160.96Sell—SellSell2021/4/2 20:003286.3951.38SellSellBuyBuy2021/4/2 21:003081.2445.9SellSellBuySell2021/4/2 22:002865.5351.58Sell——2021/4/2 23:002706.2446.81——BuySell2021/4/3 0:002611.6838.81Buy—Sell2021/4/3 1:002569.0357.57SellSellSellSell2021/4/3 2:002564.646.78SellSellSellBuy2021/4/3 3:002595.7739.73——BuyBuy2021/4/3 4:002693.6442.5Buy—Buy—2021/4/3 5:002831.2957.37Sell—SellSell2021/4/3 6:002929.99129.03—SellSellSell2021/4/3 7:002928.95128.95SellSellSellSell2021/4/3 8:002857.4657.82SellBuyBuyBuy2021/4/3 9:002759.6462.91SellSellBuySell2021/4/3 10:002674.6223.04Buy—BuyBuy2021/4/3 11:002579.6420.47—BuySellBuy2021/4/3 12:002487.5618.16Buy—SellSell2021/4/3 13:002487.5617.86Sell—BuyBuy2021/4/3 14:002404.2917.37Sell—BuyBuy2021/4/3 15:002417.5617.2—SellBuyBuy2021/4/3 16:002537.518.13——SellBuy2021/4/3 17:002728.2121.46—SellSellBuy2021/4/3 18:002905.5444.17SellSellBuyBuy2021/4/3 19:003069.548.84SellSellSell2021/4/3 20:003064.0547.75SellSellSellSell2021/4/3 21:002989.9848.56SellSellSellSell2021/4/3 22:002823.5138.67SellSellSellSell2021/4/3 23:002654.9335.7———Total_Profit87.0314.08189.76215.46Figure 8
Trading strategies of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and the proposed method from April 1, 2021, 0:00 pm, to April 2, 2021, 4:30 am, in ISO-NE.Table 4
Overall evaluation of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and the proposed method from April 1, 2021, 0:00, to April 2, 2021, 4:30, in ISO-NE.
TimeApril 1, 2021, 0:00 pm, to April 2, 2021, 4:30 amStatistical metricsTotal_profit($/MWh)DNN-DDPG44.18RNN-DDPG14.08LSTM-DDPG189.76Proposed method215.46


### 3.3. Experiment 2: Load Aggregator’s Trading Strategy Every Half Hour for 2 Days in AEMO

In this experiment, the prediction of every half hour for two days’ trading strategy from January 1, 2018, to September 27, 2021, is used as the training set, data from September 28, 2021, to September 29, 2021, are used as the validation set, and data from September 30, 2021, are used as the test set.The comparison of the profit curves for the hourly load aggregator trading strategy in AEMO is shown in Figure9; the performance of buying and selling is shown in Table 5. Trading strategies from April1, 2021, 0:00, to April 2, 2021, 4:30, in AEMO results are shown in Figure 10. The overall evaluation from April 1, 2021, 0:00, to April 2, 2021, 4:30, in AEMO is shown in Table 6. It is also demonstrated that the proposed method is more economical than for DNN-DDPG, RNN-DDPG, and LSTM-DDPG, indicating ith as better convergence ability.Figure 9
Profit curves of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and the proposed method in AEMO.Table 5
Performance of buying and selling of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and the proposed method from September 29, 2021, 18:00, to October 1, 2021, 0:00, in AEMO.
TimeReal-time demandReal-time LMPDNN-DDPGprofitRNN-DDPGstrategyLSTM-DDPGprofitProposed methodprofit2021/9/29 18:008870.6565.73BuyBuyBuyBuy2021/9/29 18:309037.1781.35BuyBuySellSell2021/9/29 19:009039.0578.33SellBuySellSell2021/9/29 19:308765.9668.97Sell—BuySell2021/9/29 20:008450.856.96Buy—BuyBuy2021/9/29 20:308257.2255.32BuyBuy—Buy2021/9/29 21:008101.0952.93BuySell—Buy2021/9/29 21:307898.7953.09BuyBuy—Buy2021/9/29 22:007686.0349.27BuyBuy—Buy2021/9/29 22:307684.6667.26SellBuySellSell2021/9/29 23:007561.3457.26BuyBuyBuyBuy2021/9/29 23:307582.9566.92SellSellBuySell2021/9/30 0:007541.5463.21SellSellSellSell2021/9/30 0:307430.7271.68BuyBuySellSell2021/9/30 1:007324.5559.45BuyBuy—Sell2021/9/30 1:307110.7854.4BuySellBuyBuy2021/9/30 2:006852.2450.24Buy—BuyBuy2021/9/30 2:306631.3258.08SellBuy—Buy2021/9/30 3:00637754.73Buy——Buy2021/9/30 3:306211.3655.31Buy——Buy2021/9/30 4:006079.3653.53Buy——Buy2021/9/30 4:306104.453.38BuyBuyBuyBuy2021/9/30 5:006187.1655.62Buy—BuyBuy2021/9/30 5:306433.3964.4BuyBuySellSell2021/9/30 6:006576.7945.76Sell—BuyBuy2021/9/30 6:306924.757.46SellBuySellSell2021/9/30 7:006940.6245.34BuyBuyBuyBuy2021/9/30 7:306874.6546.3BuySell—Buy2021/9/30 8:006878.2647.81BuyBuy—Buy2021/9/30 8:306868.0253.26SellBuy—Sell2021/9/30 9:006831.0540.38BuyBuyBuyBuy2021/9/30 9:306612.4667.62SellBuySellSell2021/9/30 10:006448.5946.28BuyBuy—Buy2021/9/30 10:306490.1452.98SellBuyBuySell2021/9/30 11:006701.36110.5SellSell—Sell2021/9/30 11:306708.4641.29Sell—BuySell2021/9/30 12:006745.5463.16SellSellSellSell2021/9/30 12:306709.5487.47SellSellSell—2021/9/30 13:006590.0158.11BuySellSellSell2021/9/30 13:306505.9183.35BuySellSellSell2021/9/30 14:006448.748.21SellSellBuyBuy2021/9/30 14:306398.2146.88Sell—SellSell2021/9/30 15:006556.5433.86SellSell—Buy2021/9/30 15:306984.0652.82SellSellSellBuy2021/9/30 16:007262.1351.97SellSell—Buy2021/9/30 16:307348.2149.52SellSell—Buy2021/9/30 17:007648.8154.35Buy—BuyBuy2021/9/30 17:307961.3159.56SellBuySellBuy2021/9/30 18:008366.8269.17Buy—SellSell2021/9/30 18:308698.0691.75—SellSellSell2021/9/30 19:008764.3699.62Buy—SellSell2021/9/30 19:308508.0667.86SellSellSellSell2021/9/30 20:008213.0261.15SellSellSellSell2021/9/30 20:308043.9958.45BuySellSellBuy2021/9/30 21:007904.7361.94BuySell—Sell2021/9/30 21:307661.7350.23SellSell——2021/9/30 22:007441.4647.9Buy——Buy2021/9/30 22:307486.3652.17BuySell—Buy2021/9/30 23:007416.7753.94SellSell—Buy2021/9/30 23:307338.2148.83Sell——Buy2021/10/1 0:007318.648.1———BuyTotal_Profit71.387.03223.32380.58Figure 10
Trading strategies of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and BiLSTM-DDPG from September 29, 2021, 18:00, to October 1, 2021, 0:00, in AEMO.Table 6
Overall evaluation of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and BiLSTM-DDPG from September 29, 2021, 18:00, to October 1, 2021, 0:00, in AEMO.
TimeSeptember 29, 2021, 18:00, to October 1, 2021, 0:00Statistical metricsTotal_profit($/MWh)DNN-DDPG71.36RNN-DDPG87.03LSTM-DDPG223.32BiLSTM-DDPG380.58


## 3.1. Experimental Settings

The experimental environment is as follows: Python 3.6.2, TensorFlow 2.0.0a GPU, Intel(R) Core(TM) i5-7200U@2.50 GHz∼2.70 GHz, 64 bit, 8 GB of RAM, and NVIDIA GeForce 940MX.The first dataset is the annual whole-point data of the New England electricity market (ISO-NE) in the United States, selected for the Connecticut Region [42]. Real-time electricity price data are collected for 1,917 consecutive days from January 1, 2016, to March 31, 2022, at a frequency of once per hour, for a total of 46,008 moments.The second dataset is the annual whole-point data of the Australian Energy Market Operator (AEMO) in the Australian, selected for the Connecticut New South Wales Region [43]. Real-time electricity price data are collected for 1186 consecutive days from January 1, 2018, to September 30, 2021, at a frequency of once per half hour, for a total of 56,928 moments.


## 3.2. Experiment 1: Hourly Load Aggregator Trading Strategy in ISO-NE

In this experiment, the prediction of three days’ worth of trading strategy from January 1, 2016, to March 28, 2022, is used as the training set, data from March 29, 2022, to March 30, 2022, as the validation set, and data from April 1, 2021, to April 3, 2021, as the test set.The comparison of the profit curves for the hourly load aggregator trading strategy in ISO-NE is shown in Figure7; the performance of buying and selling is shown in Table 3; trading strategies from April 1, 2021, 0:00, to April 2, 2021, 4:30, in the ISO-NE results are shown in Figure 8. The overall evaluation from April 1, 2021, 0:00, to April 2, 2021, 4:30, in ISO-NE is shown in Table 4. It is demonstrated that the proposed method is more economical than DNN-DDPG, RNN-DDPG, and LSTM-DDPG, indicating ith as better convergence ability.Figure 7
Profit curves of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and the proposed method in ISO-NE.Table 3
Performance of buying and selling of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and proposed method.
TimeReal-time demandReal-time LMPDNN-DDPGstrategyRNN-DDPGprofitLSTM-DDPGprofitProposed methodprofit2021/4/1 0:002180.2918.58——Sell—2021/4/1 1:002128.7817.66——Buy—2021/4/1 2:002129.5916.97—SellBuy—2021/4/1 3:002199.5917.39——Sell——2021/4/1 4:002396.9617.47——Sell—2021/4/1 5:002726.917.76Sell——2021/4/1 6:003025.0317.19——Sell—2021/4/1 7:003184.9819.24Sell—BuySell2021/4/1 8:003232.8619Sell—Sell—2021/4/1 9:003189.7220.15Sell—Buy—2021/4/1 10:003158.3826.81SellSellBuy—2021/4/1 11:003124.123.9Sell——2021/4/1 12:003140.7921.25SellSellSell—2021/4/1 13:003124.5120.76Sell——2021/4/1 14:003095.2120.12Sell——2021/4/1 15:003099.0921.59Sell——2021/4/1 16:003160.1822.99Sell—Sell—2021/4/1 17:003215.5423.36Sell—SellSell2021/4/1 18:003318.2922.24——Sell—2021/4/1 19:00327522.64Sell—Buy—2021/4/1 20:003149.4922.73——BuySell2021/4/1 21:002920.1923.02Sell—Sell—2021/4/1 22:002696.8921.73——Buy—2021/4/1 23:002536.6220.57——Sell—2021/4/2 0:002456.5422.66Sell—BuyBuy2021/4/2 1:002422.4423.39Sell—SellBuy2021/4/2 2:002429.7422.41——BuySell2021/4/2 3:002496.122.73——Sell—2021/4/2 4:002665.9224.23Sell——2021/4/2 5:002909.7527.85SellSellSell—2021/4/2 6:003073.8529.92Sell—Sell—2021/4/2 7:003107.3230.83Sell—BuySell2021/4/2 8:003160.1230.14SellBuySell—2021/4/2 9:003185.1628.23Sell—Buy2021/4/2 10:003207.4930.96Sell—SellSell2021/4/2 11:003191.8338.49Sell—Buy—2021/4/2 12:003172.8934.4Sell—SellSell2021/4/2 13:003132.935.41Sell—SellSell2021/4/2 14:003168.1425.88Buy—Buy—2021/4/2 15:003249.8242.4SellSellSell2021/4/2 16:003350.1151.55SellSellSell—2021/4/2 17:003368.9161.76Sell—SellSell2021/4/2 18:003435.659.28Sell—SellSell2021/4/2 19:003389.9160.96Sell—SellSell2021/4/2 20:003286.3951.38SellSellBuyBuy2021/4/2 21:003081.2445.9SellSellBuySell2021/4/2 22:002865.5351.58Sell——2021/4/2 23:002706.2446.81——BuySell2021/4/3 0:002611.6838.81Buy—Sell2021/4/3 1:002569.0357.57SellSellSellSell2021/4/3 2:002564.646.78SellSellSellBuy2021/4/3 3:002595.7739.73——BuyBuy2021/4/3 4:002693.6442.5Buy—Buy—2021/4/3 5:002831.2957.37Sell—SellSell2021/4/3 6:002929.99129.03—SellSellSell2021/4/3 7:002928.95128.95SellSellSellSell2021/4/3 8:002857.4657.82SellBuyBuyBuy2021/4/3 9:002759.6462.91SellSellBuySell2021/4/3 10:002674.6223.04Buy—BuyBuy2021/4/3 11:002579.6420.47—BuySellBuy2021/4/3 12:002487.5618.16Buy—SellSell2021/4/3 13:002487.5617.86Sell—BuyBuy2021/4/3 14:002404.2917.37Sell—BuyBuy2021/4/3 15:002417.5617.2—SellBuyBuy2021/4/3 16:002537.518.13——SellBuy2021/4/3 17:002728.2121.46—SellSellBuy2021/4/3 18:002905.5444.17SellSellBuyBuy2021/4/3 19:003069.548.84SellSellSell2021/4/3 20:003064.0547.75SellSellSellSell2021/4/3 21:002989.9848.56SellSellSellSell2021/4/3 22:002823.5138.67SellSellSellSell2021/4/3 23:002654.9335.7———Total_Profit87.0314.08189.76215.46Figure 8
Trading strategies of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and the proposed method from April 1, 2021, 0:00 pm, to April 2, 2021, 4:30 am, in ISO-NE.Table 4
Overall evaluation of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and the proposed method from April 1, 2021, 0:00, to April 2, 2021, 4:30, in ISO-NE.
TimeApril 1, 2021, 0:00 pm, to April 2, 2021, 4:30 amStatistical metricsTotal_profit($/MWh)DNN-DDPG44.18RNN-DDPG14.08LSTM-DDPG189.76Proposed method215.46


## 3.3. Experiment 2: Load Aggregator’s Trading Strategy Every Half Hour for 2 Days in AEMO

In this experiment, the prediction of every half hour for two days’ trading strategy from January 1, 2018, to September 27, 2021, is used as the training set, data from September 28, 2021, to September 29, 2021, are used as the validation set, and data from September 30, 2021, are used as the test set.The comparison of the profit curves for the hourly load aggregator trading strategy in AEMO is shown in Figure9; the performance of buying and selling is shown in Table 5. Trading strategies from April1, 2021, 0:00, to April 2, 2021, 4:30, in AEMO results are shown in Figure 10. The overall evaluation from April 1, 2021, 0:00, to April 2, 2021, 4:30, in AEMO is shown in Table 6. It is also demonstrated that the proposed method is more economical than for DNN-DDPG, RNN-DDPG, and LSTM-DDPG, indicating ith as better convergence ability.Figure 9
Profit curves of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and the proposed method in AEMO.Table 5
Performance of buying and selling of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and the proposed method from September 29, 2021, 18:00, to October 1, 2021, 0:00, in AEMO.
TimeReal-time demandReal-time LMPDNN-DDPGprofitRNN-DDPGstrategyLSTM-DDPGprofitProposed methodprofit2021/9/29 18:008870.6565.73BuyBuyBuyBuy2021/9/29 18:309037.1781.35BuyBuySellSell2021/9/29 19:009039.0578.33SellBuySellSell2021/9/29 19:308765.9668.97Sell—BuySell2021/9/29 20:008450.856.96Buy—BuyBuy2021/9/29 20:308257.2255.32BuyBuy—Buy2021/9/29 21:008101.0952.93BuySell—Buy2021/9/29 21:307898.7953.09BuyBuy—Buy2021/9/29 22:007686.0349.27BuyBuy—Buy2021/9/29 22:307684.6667.26SellBuySellSell2021/9/29 23:007561.3457.26BuyBuyBuyBuy2021/9/29 23:307582.9566.92SellSellBuySell2021/9/30 0:007541.5463.21SellSellSellSell2021/9/30 0:307430.7271.68BuyBuySellSell2021/9/30 1:007324.5559.45BuyBuy—Sell2021/9/30 1:307110.7854.4BuySellBuyBuy2021/9/30 2:006852.2450.24Buy—BuyBuy2021/9/30 2:306631.3258.08SellBuy—Buy2021/9/30 3:00637754.73Buy——Buy2021/9/30 3:306211.3655.31Buy——Buy2021/9/30 4:006079.3653.53Buy——Buy2021/9/30 4:306104.453.38BuyBuyBuyBuy2021/9/30 5:006187.1655.62Buy—BuyBuy2021/9/30 5:306433.3964.4BuyBuySellSell2021/9/30 6:006576.7945.76Sell—BuyBuy2021/9/30 6:306924.757.46SellBuySellSell2021/9/30 7:006940.6245.34BuyBuyBuyBuy2021/9/30 7:306874.6546.3BuySell—Buy2021/9/30 8:006878.2647.81BuyBuy—Buy2021/9/30 8:306868.0253.26SellBuy—Sell2021/9/30 9:006831.0540.38BuyBuyBuyBuy2021/9/30 9:306612.4667.62SellBuySellSell2021/9/30 10:006448.5946.28BuyBuy—Buy2021/9/30 10:306490.1452.98SellBuyBuySell2021/9/30 11:006701.36110.5SellSell—Sell2021/9/30 11:306708.4641.29Sell—BuySell2021/9/30 12:006745.5463.16SellSellSellSell2021/9/30 12:306709.5487.47SellSellSell—2021/9/30 13:006590.0158.11BuySellSellSell2021/9/30 13:306505.9183.35BuySellSellSell2021/9/30 14:006448.748.21SellSellBuyBuy2021/9/30 14:306398.2146.88Sell—SellSell2021/9/30 15:006556.5433.86SellSell—Buy2021/9/30 15:306984.0652.82SellSellSellBuy2021/9/30 16:007262.1351.97SellSell—Buy2021/9/30 16:307348.2149.52SellSell—Buy2021/9/30 17:007648.8154.35Buy—BuyBuy2021/9/30 17:307961.3159.56SellBuySellBuy2021/9/30 18:008366.8269.17Buy—SellSell2021/9/30 18:308698.0691.75—SellSellSell2021/9/30 19:008764.3699.62Buy—SellSell2021/9/30 19:308508.0667.86SellSellSellSell2021/9/30 20:008213.0261.15SellSellSellSell2021/9/30 20:308043.9958.45BuySellSellBuy2021/9/30 21:007904.7361.94BuySell—Sell2021/9/30 21:307661.7350.23SellSell——2021/9/30 22:007441.4647.9Buy——Buy2021/9/30 22:307486.3652.17BuySell—Buy2021/9/30 23:007416.7753.94SellSell—Buy2021/9/30 23:307338.2148.83Sell——Buy2021/10/1 0:007318.648.1———BuyTotal_Profit71.387.03223.32380.58Figure 10
Trading strategies of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and BiLSTM-DDPG from September 29, 2021, 18:00, to October 1, 2021, 0:00, in AEMO.Table 6
Overall evaluation of DNN-DDPG, RNN-DDPG, LSTM-DDPG, and BiLSTM-DDPG from September 29, 2021, 18:00, to October 1, 2021, 0:00, in AEMO.
TimeSeptember 29, 2021, 18:00, to October 1, 2021, 0:00Statistical metricsTotal_profit($/MWh)DNN-DDPG71.36RNN-DDPG87.03LSTM-DDPG223.32BiLSTM-DDPG380.58


## 4. Conclusions

This study investigates deep reinforcement learning in load aggregators’ participation in the electricity spot real-time market trading strategy. The proposed improved DDPG algorithm can be used for load aggregators’ real-time load purchase and sale transactions in the electricity spot real-time market. The main work is as follows: (1) an improved BiLSTM-DDPG with better convergence ability is proposed to solve the problem that DDPG does not easily converge when the input dimension is too large; (2) deep reinforcement learning is introduced into the analysis of power purchase and sale strategies in the electricity spot market so that load aggregators can participate in demand response with better results; and (3) in the case of IOS-NE and AEMO, it is proved that under the strategy implemented by the proposed method, it is more economical for the load aggregator to participate in the price-responsive load than for DNN-DDPG, RNN-DDPG, and LSTM-DDPG.The proposed algorithm can be used to solve scenarios with large data volumes and high requirements for timeliness in the electricity market, providing an idea for the study of optimisation problems. This study focuses on the load aggregator’s purchase and sale model, but has not studied the point-to-point user. Future research will combine transfer learning and federal learning to achieve distributed peer-to-peer transaction optimisation in electricity retail market.



---

*Source: 6884956-2022-09-12.xml*