Analyzing Trade in Continuous Intra-Day Electricity Market: An Agent-Based Modeling Approach

: In recent years, the vast penetration of renewable energy sources has introduced a large degree of uncertainty into the power system, thus leading to increased trading activity in the continuous intra-day electricity market. In this paper, we propose an agent-based modeling framework to analyze the behavior and the interactions between renewable energy sources, consumers and thermal power plants in the European Continuous Intra-day (CID) market. Additionally, we propose a novel adaptive trading strategy that can be used by the agents that participate in CID market. The agents learn how to adapt their behavior according to the arrival of new information and how to react to changing market conditions by updating their willingness to trade. A comparative analysis was performed to study the behavior of agents when they adopt the proposed strategy as opposed to other benchmark strategies. The effects of unexpected outages and information asymmetry on the market evolution and the market liquidity were also investigated.


Introduction
In recent decades, an increase in the share of variable renewable energy sources (RES) has been observed in the energy mix. These energy sources are characterized by highly volatile generation profiles throughout the year, as highlighted by [1], and have stimulated a substantial growth in the volumes of electricity traded in the short-term electricity markets, as pointed out by [2]. Short-term markets are organized in a sequence of trading floors [3]. First, the day-ahead (DA) market takes place one day before the physical delivery, followed by the intra-day (ID) market, where electricity trading occurs until a few minutes before the actual electricity production/consumption. Once the ID market closes, the committed generation or consumption becomes financially binding for market participants. In the case of deviations (imbalances) between the actual and the committed production/consumption, financial penalties might ensue during the imbalance settlement process. In this context, the ID trading floor becomes particularly interesting because participants can exploit the enhanced accuracy of forecasts that comes with reduced lead times. Thus, market actors can reduce their imbalances by performing adjustments close to the time of delivery as discussed by [4]. Additionally, they can provide flexibility in the market, mitigating the need for expensive balancing actions, which is further discussed by [5,6]. Intra-day markets are typically organized according to two distinct mechanisms, namely continuous trade or discrete auctions. This paper focuses on the former mechanism, as it is the one expected to prevail at the European level, as pointed out by [7,8].
The increased amount of activity expected in ID markets raises the volatility and cross-border flows in the market [3]. As a result, the need for automation in the trading process is rising. Moreover, an expected upsurge in the amount of available information and IT infrastructure for traders, which is further explained by [9,10], has prompted the development of bots for automated trading as shown by [11]. For instance, according to [12], in July 2019, the intra-day volume traded on the Nord Pool trading platform by bots through the application programming interface (API) exceeded 52%. In this context, it becomes relevant to analyze the interactions of the automated players in the ID market and evaluate their impact on the market outcome.
With reference to the increased relevance of short-term markets and automatic trading, this paper tackles the issue faced by an agent trading in the European Continuous Intraday (CID) market. In particular, we propose an open source agent-based modeling (ABM) framework for the CID market where agents can interact and exchange energy through a centralized limit order book. These agents exchange electricity according to some trading strategy. In this paper, we propose a trading strategy based on adaptive learning-such a strategy allows the agents to build price-volume curves, which are then used to post orders in the CID market. To benchmark the proposed adaptive learning trading strategy, we introduce a second one following a "naive" approach. We leverage these two strategies to assess the impact of different trading strategies on the prices of the CID market and revenues of the agents.
The presented modeling framework enables the analysis of a number of additional events and their impact on the CID markets. In this regard, we analyze the combined impact of (i) generation/consumption capacity outages and (ii) the different strategies adopted by each agent, on the price volatility in the CID market. Additionally, we investigate how some agents can influence the transaction prices in the CID market if better estimates of the imbalance prices are available those agents. Indeed, when the transmission system operator mobilizes resources to provide additional reserves in the balancing market, only some of the market players are activated. Such agents, therefore, receive information concerning reserve activation prices which is not universally available. This creates information asymmetry concerning imbalance prices across the market players.
The rest of the paper is organized as follows. Section 2 discusses the related work in the literature. Section 3 gives the overview of how the continuous ID electricity market works. The details of the proposed model are covered in the sections ranging from Section 4 to Section 7. The continuous market clearing performed by the MO is described in Section 4. The detailed modeling of different agents is explained in Section 5. Section 6 describes the pricing and volume strategies for the agents. The imbalance settlement mechanism adopted in the simulator is highlighted in Section 7. Discussions regarding the performed case studies and obtained results are given in Section 8. Section 9 concludes the paper and discusses future work avenues.

Related Works
The prevailing literature on energy exchange optimization has mainly focused on the DA market. As for ID and CID, limited research work can be found to date, in particular, related to the mathematical modeling of the CID electricity market. The research gap and the need to develop more detailed simulation models for the CID market is highlighted by [13]. The participation of a wind power producer (WPP) in the CID market and the benefits obtained through the reduction in the imbalance costs are presented by [14]. However, this work does not explicitly model the trading process in the ID market, and only considers a limited order book (a compilation of available bids and asks for trading). More thorough modeling of the CID market is provided by [15], where a deep reinforcement learning framework for the participation of energy storage in the CID market is proposed. In the latter, historical limit order book data were used to train the trading agent. However, the use of historical data does not allow the study of the market impact of each player. The need to model the interactions of the different market agents in the ID market has been emphasized by [16]. Similarly, Ref. [17] organized the CID electricity market as a continuous double auction (CDA) (according to [18], CDA is a fixed-duration auction mechanism where more than one buyer and seller can compete with each other to buy and sell goods, respectively, and transactions can take place at any time whenever an offer to buy and an offer to sell match) with the aim of understanding the impact of RES agents' forecast errors on the CID market. However, their work assumes that a single entity aggregates the entire wind and solar power generation and trades the overall forecast error in the ID market as a single entity. This entity is not allowed to submit orders, but it has to accept the best price available when it enters the market.
Agent-based modeling provides a framework for simulating the operation of electricity markets, with the purpose of investigating the behavior of different market participants and to study their interactions. Some of the agent-based models (ABMs) that have been developed in the past include EMCAS (electricity market complex adaptive systems) by [19,20], NEMSIM (national electricity market simulation system) by [21], STEMS-RT (short-term electricity market simulator-real time) by [22], SEPIA (simulator for electric power industry agents) by [23], AMES (agent-based modeling of electricity system) by [24], and MASCEM (multi-agent system that simulates competitive electricity markets) by [25]. A detailed literature review of these models has been performed by [26]. Some recent research work on agent-based modeling includes [27][28][29][30][31]. A literature review of contemporary ABMs in different electricity markets can be found in [32]. However, none of the aforementioned ABMs is well suited for modeling the European CID market since the trading mechanism (limit order book) and the rules are not explicitly considered.
In this work, we present a novel ABM framework for the CID market, where all the agents can interact and exchange energy via submitting orders in a centralized limit order book. However, we adopt a different approach with respect to [33,34], where the authors proposed a model to optimize the participation of a portfolio of assets in the energy markets, aiming to maximize returns and the minimization of the implied risk. In this paper, we consider each agent to control only one type of asset. Two different pricing strategies are considered according to which the agents are posting orders in the market. The first one is a simple strategy that randomly assigns a price to the volume that each agent needs to trade at each step. The second pricing strategy adopted in this paper is a slightly modified version of the trader AA (adaptive aggressiveness) strategy presented by [35] that is used in financial markets. The main feature of this strategy is the notion of aggressiveness, which is a variable that determines the behavior of the trader in the market, e.g., passive, active, aggressive. More specifically, an aggressive trader tends to submit better offers than its estimate of the competitive equilibrium price with the intention of improving its chance of transacting. This variable is progressively learned in response to the market events. According to [36], the trader AA strategy has been shown to dominate not only all other algorithmic strategies but also human traders. However, the quoted volume is not considered as a strategic variable in this strategy. In this paper, we propose an adjusted version of the trader AA strategy that we call the modified trader AA (MTAA) strategy. The proposed strategy also uses the aggressiveness variable for the construction of price-volume curves.
In light of the above, the contributions of this paper are four-fold. First, we propose a novel ABM framework to investigate the interactions between different agents in the context of a CID market. Second, we employ an MTAA pricing strategy that learns from past events in the CID market and benchmark it against a naive strategy that randomly chooses prices from a range of prices based on the best buying and selling prices in the CID market. Third, we study the response of different agents interacting in the CID market to capacity outages under different pricing strategies. Lastly, we investigate the impact of information asymmetry of the imbalance prices on the CID market prices.

Principles of Continuous Intra-Day Markets
This section describes the organization and the main principles that define the exchanges in the proposed CID market mechanisms. These principles are inspired by the work of Boukas et al.; for more details, we refer the reader to [15].

Market Set-Up
In the CID market, the actual delivery of energy in a predefined time slot is known as a market product. A wide range of products is offered by the market operators in Europe based on the associated duration of physical delivery. For instance, Nord Pool offers quarterly (15 min-long), half-hourly (30 min-long), hourly, and block products. The latter are products inter-linked in time and comprise several consecutive hourly products (up to 24) as described by [37]. Although the increasing number and range of available products aim to facilitate trading activities, these also complicate the decision process.
Assumption 1. Throughout this paper, it is considered that trading takes place solely for one product. This assumption seeks to simplify notation and to reduce the complexity arising from (i) the time coupling of the products in the delivery timeline, as well as (ii) the dependency between trading and delivery timelines.
In this regard, the market product starting at the first hour of the day can be encoded as H 1 , as shown in Figure 1. In this figure, the physical delivery of product H 1 starts at t

Market Mechanism
At each time-step in the trading timeline, a market participant can express their willingness to buy or sell a product (consume or produce energy during a predefined time-slot) by posting orders in the CID market. There are four main types of orders: (i) the market order, where no price limit is specified and the order is matched at the best price; (ii) the limit order, which contains a price limit and can only be matched at the specified price or better; (iii) the market sweep order, which is immediately executed (fully or partially) or canceled; and (iv) block orders, consisting of one or several (up to 24) consecutive hourly products. Each one of these types of order can receive additional execution specifications related to the time or the volume of the order execution. Assumption 2. In this paper, it is assumed that the agents can only place simple limit orders. Placing a new limit order for a product in the CID market involves specifying its side, i.e., whether it is a buy or a sell order y ∈ {Sell, Buy}, its volume v ∈ R + , and the price π ∈ [π min , π max ] for producing or consuming one unit of energy.
Every incoming order is treated according to the first-come-first-serve (FCFS) rule as explained by [38]. If the price of a new Buy (Sell) order is equal or higher (lower) than the price of an existing Sell (Buy) order, it will automatically be realized. Each transaction is settled following the pay-as-bid principle, according to which the transaction price is set by the oldest order of the two. Unmatched orders are stored in the limit order book (LOB), a ledger that centralizes all outstanding bids and asks-i.e., the pending orders that have not yet been canceled by the agents that originated them-and which is accessible to all market participants. The LOB typically has two sides, namely the bid and the ask sides. The former contains the prices and quantities of outstanding bid orders sorted in descending order, while the latter stores the prices of outstanding asks and the associated quantities sorted in ascending order. A visualization of outstanding bids and asks for product H 1 , as found in a typical LOB is presented in Figure 2. The current work follows the LOB implementation described by [39].

Continuous Market Clearing
This section describes the functionality of the market operator (MO) agent. The MO is responsible for organizing and facilitating the interactions between trading agents in the CID market. As previously described, the exchanges take place through a centralized order book. The MO is responsible for receiving the incoming orders from the agents, processing them, and record the financial transactions. This agent is also responsible for updating the order book and communicating it to the market participants. An overview of the CID market simulator is shown in Figure 3.

Continuous Market Operation
This subsection highlights the various steps taken consecutively by the MO agent to operate the continuous market clearing and the trading agents that submit their orders during the entire trading timeline. The market session is composed of a set of agents interacting over a discrete time horizon T. Let i denote an agent from the set I = {1, . . . , N} where N is the number of agents. Additionally, let ob t denote the LOB at time-step t ∈ T.

Assumption 3.
A general assumption in this paper is that the only public information available to the trading agents is the top of the LOB tob t and the DA price (π DA ). The top of the LOB tob t is a vector consisting of various price and volumes indicators: the best bid price bbp t , the best bid volume bbv t , the best ask price bap t , the best ask volume bav t , the volume weighted average price in the bid side vwapb t and the volume weighted average price in the ask side vwapa t . Compactly, we have: tob t = (bbp t , bbv t , bap t , bav t , vwapb t , vwapa t ).  At the beginning of the market session, the MO instantiates the LOB ob t open . Then, at each time-step t, all the agents in the market are given a chance to post their orders. Each agent is assigned a unique identity number and the sequence in which these agents are selected to act is chosen randomly. Every agent, once selected by the MO, first cancels any of their previously submitted orders still in the order book ob t , and then submits a new order o i,t = (y i,t , v i,t , π i,t ) according to their strategy S i . At this stage, the submitted order o i,t is processed by the MO and a new instance of the LOB emerges, i.e., ob t+1 . The top of the LOB (tob t+1 ) is also generated and shared among the agents for them to update their trading strategies. This process is repeated until the end of the trading horizon. The described process is presented in Algorithm 1. After CID trading, the imbalance settlement (detailed in Section 7) takes place, where deviations from the committed schedules are penalized. for t ← t open , t close do 3: i ← rand(I) 4: Update agents' trading strategies 7: end for 8: Imbalance settlement 9: end procedure

Order Processing
This subsection describes how the MO processes the orders submitted by the trading agents in the CID market. Once a new order o i,t is submitted by an agent, the MO determines whether a transaction is realized and updates the LOB accordingly. First, the MO checks the side of the order. For a buy (sell) order, the MO compares the price of the order (π i,t ) with the best ask (best bid) price, and if π i,t is greater (lower) than the bap t (bbp t ), a transaction takes place. During this process, the matching volume v match and price π match are computed, as shown in the Appendix A. At this stage, an updated instance of the LOB ob t+1 is generated. The orders whose entire volume is matched are removed from the LOB while the orders that are partially matched are first updated and then added to the LOB. The algorithms that compose the processing of the submitted orders can be found in Appendix A.

Updating Agents' Beliefs
At each time-step t of the trading horizon, the MO communicates the top of the LOB (which is generated from the LOB ob t ) to the trading agents. With this information, the agents update their strategies S i as described in Sections 5.1 and 6.

Transaction Confirmation
When a match takes place, the two parties of the transaction are notified and both of them locally confirm it, as described in Section 5.1.

Trading Agents
Two main types of trading agents are considered in the model, namely the dispatchable agents representing the operators of thermal power plants, and the variable agents representing renewable generators and consumers, among others. In this section, we first describe a generic agent that has all the common attributes and functionalities of the two aforementioned types of trading agents. Subsequently, the particular characteristics that differentiate them are elaborated.

Generic Agent
At each time-step t in the trading horizon, the information available to a trading agent can be divided, depending on its restriction level, into public and private.
Public information is considered to be available to all market participants at the same time and includes the top of the LOB tob t and the day-ahead (DA) price π DA . On the other hand, the private information is only available to each individual agent. Formally, the public information available to an agent i in the current framework writes as In the following, a detailed description of the agents' private information is introduced. Then, the modules that facilitate the interactions of the agent with the market environment are defined.

Private Information
The private information available to trading agent i contains the effective capacity C i,t of the production/consumption asset that can be traded at time-step t in the trading horizon. At the beginning of the trading horizon t open , the effective capacity is defined as C i,t open , and initialized with the value C i . The private information of an agent i also includes the market position p mar i,t at time-step t, which represents the net volume of energy traded for the corresponding product. In particular, a positive (negative) market position indicates that the trading agent has sold (purchased) energy. At the beginning of the trading horizon, p mar i,t is initialized with the value of the day-ahead market position, represented by p da i . The private information also contains the cash-flow r i,t , which reflects the cumulative revenues of agent i during the trading process. The difference between the market position p mar i,t at time-step t and the expected energy output at physical delivery is denoted by imbalance δ i,t , which lists as additional private information for a given agent. The agent has private access to their most recent prediction for the positive and negative imbalance prices (π imb,+ i,t andπ imb,− i,t , respectively).

Assumption 4.
In this paper, it is assumed that all the trading agents aim to maximize their expected profits, taking into account payments for imbalances. The final imbalance ∆ i is defined as the difference between the actual realization and the market position at the end of the trading horizon (p mar i,t close ). The trading decisions about the energy produced/consumed are such that the imbalance penalties are minimized.
During the trading process, an agent can be both a buyer and a seller. The minimum price an agent i is willing to offer and the maximum price they are willing to pay for a unit of power at time-step t are denoted by l sell i,t and l buy i,t , respectively, and are considered additional private information. Finally, each agent maintains a local LOB ob local i,t during the trading process, as a private ledger tracking their outstanding orders at time-step t. This local LOB is updated when new orders are posted or when the existing (outstanding) ones are partially/fully accepted or canceled. Formally, the private information of an agent i writes as (1)

Potential Functionalities
We define 'potential functionality' as a function that can be performed by a specific agent. In the case of a generic agent, the agent functionalities available are described as follows: This function comprises all necessary computations for submitting orders in the market. The definition and the interactions of this functionality with the rest of the simulator are detailed in Section 6. In its basic form, the pricing strategy receives as input the public information about tob t . Based upon this, it computes all relevant information required for the design of the price-volume curves used for creating and submitting orders to the market.
This function simulates the effect of receiving information regarding an unexpected outage within the available portfolio during the trading horizon. It takes as input an outage probability p out and the share of capacity which will be affected by the outage, given byc. The discrete event of an outage X ∈ {0, 1} is sampled from a Bernoulli distribution defined as where X = 1 corresponds to a capacity outage of sharec. The outage functionality O is used to update the effective capacity C i,t at each time-step t by sampling a discrete event X t from Equation (2) and updating the effective capacity C i,t as in: Assumption 5. In this paper, we assume that the up-and down-regulation prices are known to the market operator agent throughout the trading horizon. The other agents forecast these prices with some error. This assumption allows us to study the effect of information asymmetry of imbalance prices on the behavior of the agents.
(3) Imbalance Price forecaster I(e imb i ) This function is used to produce estimates of the imbalance pricesπ imb,+ i,t ,π imb,− i,t of the traded product (time slot) at each time-step t. For the sake of simplicity, we assume that the imbalance price forecasts are given by adding white noise with variance e imb i to the real positive and negative imbalance price denoted by π imb,+ , π imb,− , respectively. Thus, the imbalance prices are given bŷ Further details about the choice of π imb,+ and π imb,− are provided in Section 7.1.

(4) Confirm a Transaction Locally
This function enables a series of operations between parties in the case a transaction takes place between two agents at time-step t. First, the agents update their market position p mar i,t and their cash-flow r i,t and then they update their local order book ob local i,t accordingly. For a transaction between two parties exchanging a volume of v match , at a price π match , the update of market positions and cash-flows for each party depending on their side y match , is given by The local order book ob local i,t that contains all outstanding orders is updated after each transaction as follows. If the transacted volume v match fully matches the posted limit order volume v, the order is removed from the LOB. Otherwise, the order remains in the local book with an updated volume v i,t as reduced by v match .

Dispatchable Agent
This agent is built upon the previously described generic one and allows for the representation of trading agents controlling fully dispatchable assets, i.e., thermal plants.

Private Information
In addition to the private information of the generic agent, the dispatchable agent also tracks what we call buy and sell margins, g down i,t and g up i,t , respectively. At every time-step t, these margins correspond to the difference between the market position p mar i,t and the minimum stable load C i,t (for a buy order) or the difference between the effective capacity C i,t and the market position p mar i,t (for a sell order). Formally, these margins are given by The private information of a dispatchable agent i writes as is the private information available to the agent i at time t as per Equation (1) and g down i,t and g up i,t are the buy and sell margins according to the Equations (8) and (9), respectively.

Potential Functionalities
Functionality is used to produce the order to be submitted to the market at time-step t, according to Algorithm 2. Firstly, agent i cancels all potential outstanding orders. Then, it computes the effective capacity C i,t according to Equations (2) and (3). The resulting capacity is used to compute the buy/sell margins according to Equations (8) and (9), respectively. Then, new imbalance prices forecasts (π imb,+ i,t andπ imb,− i,t ) are computed according to Equations (4) and (5) before the effective capacity C i,t is leveraged to evaluate the imbalance δ i,t as per: At the end of the trading horizon, the final imbalance ∆ i for a dispatchable agent i is computed as ∆ i = δ i,t close . In case the agent observes a negative imbalance δ i,t < 0, the limit price buy l buy i,t is updated. This happens as the agent prefers to buy the energy that cannot be physically produced via its unit than to face imbalance penalties. Again, this follows from Assumption 4 related to the requirement of the trading agents to be in balance at the real-time delivery stage. In such a situation, the updated limits are given by It should be noted that the limit sell price l sell i,t remains the same for the entire trading session since the agent does not face any positive imbalance. In the final step, with all the public and private information available, agent i can use its pricing strategy PS i to produce the order o i,t that will be submitted to the market at time-step t.

Algorithm 2
Steps to decide the orders to be placed 1: procedure S i,dis (tob t ) 2: Cancel outstanding orders 3: Update capacity(C i,t ) as per Equation (3) 4: Compute buy/sell margins g down i,t , g up i,t as per Equations (8) and (9) 5: as per Equations (4) and (5) 6: Compute imbalance(δ i,t ) as per Equation (10)   7: Update limit price buy/sell l buy i,t ,l sell i,t as per Equations (11) and (12) 8: return o i,t 10: end procedure

Variable Agent
The variable agent is also built upon the previously described generic agent and contains additional attributes and functionalities that enable the representation of trading agents that control variable assets, i.e., renewable energy sources or consumption.

Private Information
Due to the variable nature of this type of agent, it is considered that the agent has access to a forecastp var i,t at every time-step t, which is the most recent forecast of the uncertain production/consumption. Assumption 6. In this paper, we assume that the production/consumption forecast available to each agent is independent of other agents and does not consider any spatial correlation.

Potential Functionalities (1) Forecasting functionality
Forecasts are produced by this functionality at a frequency D i,t , according to: where C is the effective capacity as per Equation (3), e cst i,t is the error constant, p var i,t and p var i,0 denotes the realization and initial forecast of the variable consumption/production, respectively. In this paper, we consider that the forecast of electricity consumption and RES productionp var i,t is generated by adding a systemic error e var i,t to the actual realization p var i,t , as per: The error e var i,t at time-step t is computed by one of the following functions: • Cosinusoidal forecast: • Sinusoidal forecast: • Constant offset forecast: e var i,t =C (16) whereC denotes the amplitude/offset of the error and e cst i,t is a constant that can adjust the frequency of the error. Thus, the private information of a variable agent i writes as is the private information available to the agent i at time t according to Equation (1) andp var i,t is the forecast of production/consumption of the variable agent.
(2) Strategy S i,var (tob t ) Functionality is used to produce the order to be submitted to the market at a decision time-step t, according to Algorithm 3. At first, agent i cancels all potential outstanding orders. Then, the agent computes an updated version of the effective capacity C i,t according to Equations (2) and (3) and receives the most recent forecast of consumption/production p var i,t from Equation (13). Then, new imbalance price forecasts (π imb,+ i,t , respectively) are computed according to Equations (4) and (5). At each time-step t, the imbalance δ i,t of a variable agent is computed as the difference between their market position p mar i,t and their most recent forecastp var i,t as per: At the end of the trading horizon, the final imbalance ∆ i for variable agent i is computed as If a variable agent has an imbalance δ i,t , they face the risk of being exposed to an imbalance penalty. To take this into account, the agent updates their limit buy/sell prices (l buy i,t , l sell i,t ) towards its estimates of the positive/negative imbalance prices (π imb,+ i,t ,π imb,− i,t ) according to: Finally, the variable agent i can use its pricing strategy PS i together with the available public and private information to produce an order o i,t that will be submitted to the market at time-step t.

Pricing Strategies
As described in the previous section, after deciding the amount of energy to be put into the market, each agent i employs a pricing strategy PS i for this volume. More specifically, each agent needs to construct a price-volume curve that defines the price at which shares of the total volume will be placed into the market. In the following, the two available pricing strategies, namely a naive strategy and a modified trader AA strategy, will be described. In this section, first, a generic pricing scheme that serves as a basis for any of the two aforementioned strategies is introduced. Then, the naive and the modified trader AA pricing strategies are described in detail.

Generic Strategy
This strategy includes the common parameters and functions that any of the two proposed pricing schemes should contain in the current framework. Thus, irrespective of the pricing strategy, a set of parameters is required to construct the price-volume curve of an agent. This set includes (i) the updated values for the buy/sell limits (l sell i,t , l buy i,t ) (for the ease of notation, the index i will be dropped in the rest of this section as the concepts described here apply to each agent); (ii) the (user-defined) number of orders n that the agent submits to the market; and (iii) the top of the book at the previous time-step (bbp ).
In addition, the generic pricing strategy is characterized by a set of processes. First, the agent initializes all relevant strategy parameters. Then, the agent learns the strategy parameters based on information received from the MO (e.g., top of the book, transactions). This update occurs at each market event and contains slightly different sub-processes depending on the pricing strategy in use. Finally, the agent constructs the price-volume curve and outputs the orders that are submitted to the MO.

Naive Strategy
This strategy builds the price-volume curve by randomly sampling from a range of prices. The additional parameters that are characteristic for the naive strategy are (i) the price range π range used for random sampling and (ii) the number of intervals m in which the price range is split. According to the naive strategy, an agent first initializes the values of l sell t , l buy t , n, π range and m. Then, the values of the previous best bid/ask prices/volumes are updated according to the new top of the book received from the MO. Then, the agent passes the volume decision and the side of the orders to be posted and the price-volume curve is built. In the case that the agent attempts to sell a volume v, the naive strategy proceeds as follows. First, a price range is defined containing m intervals, with minimum and maximum values given by Similarly, in the case the agent attempts to buy a volume v, the price range limits are given by The price step is defined as The sets containing the candidate prices for selling P sell and buying P buy can be defined as Then, a number of n price values π j , with j ∈ {1, .., n}, are sampled i.i.d. from P sell or P buy , while the volume v is shared equally among all orders (i.e., v 1 = ... = v n = v n ). The final orders are defined as

Modified Trader AA Strategy
This strategy builds the price-volume curve in two steps. First, the methodology introduced in the trader AA strategy, detailed by [35], is used to define the target price at each step. Subsequently, the target price is used as a reference point to build the pricevolume curve. A first additional pricing strategy parameter that is specific to the MTAA scheme is the competitive equilibrium price estimateπ t . Second, the aggressiveness a t characterizes the trading behavior of an agent. It takes values in [−1, 1], where a t > 0 corresponds to an aggressive trader (posting orders that are better than theirπ t estimate), a t = 0 is associated with an active trader (posting orders that are at their estimateπ t ) and a t < 0 denotes a passive agent (posting orders that are worse than their estimateπ t ). A third MTAA parameter is the target price τ t that specifies the price that the agent is willing to offer given its aggressiveness level a t . In particular, the target price τ t is given by a parameterized exponential function with parameter θ.
The MTAA strategy implements the following steps. First, an initialization that retrieves the values of l sell t open , l buy t open , n,π t open , a t open and θ t open from the agent occurs. This is followed by the learning of the parameters of the strategy after each time-step t, based on the received top of the order book and the transactions that might have taken place. The main parameters of the MTAA strategy are updated as follows: • The competitive equilibrium price estimatep is computed at each step as the mean value of K past transactions according to: • The aggressiveness a is updated as where δ p is a proxy of the degree of aggressiveness that would form a price equal to the best bid price bbp t , if the agent is a buyer and the last event is a bid, or equal to the best ask price, bap t , if the agent is a seller and the last event is an ask. In case the last event is a transaction, the price reference is the transaction price π match . The learning process of the aggressiveness takes place in a step-wise manner that depends on the step-size parameter β.

•
The target price parameter θ is only updated when a transaction takes place, while the magnitude of the update depends on the market volatility ν through functionθ(ν). The updated parameters are given by • The target price τ t at each step t is computed as a function of the aggressiveness level a, the estimated equilibrium priceπ t and the limit prices to buy/sell (l sell t , l buy t ). Compactly, it writes: buy t ,π t , a t ), where θ t defines the shape of the exponential.
Finally, the last step involves learning the price-volume curve with the volume, decision, and side of the orders posted by the agent, the volume decision, and the side of the orders the agent will post and constructs the price-volume curve in a two-stage procedure. Building this curve is a two-step process. First, the decision on the bid/ask price is taken following the procedure described by [35]. More specifically, for determining the price at which a new order will be posted, the MTAA strategy uses the target price τ t and the observed top of the book tob t . The price, depending on the side of the orders, is given by where η is a parameter that determines the rate of decrease (increase) in the ask price (bid price) and η ∈ [1, ∞). Then, given the resulting price and the agent aggressiveness, exponential price-volume curves for selling or buying energy are given by where V ∈ [0, 1] represents the proportion of the volume v and π max , π min , φ are userdefined parameters that are used to define the price range of the curves. Then, a number of n price values π j , with j ∈ {1, ..., n}, are derived from P sell (V j ) or P buy (V j ), where: The volume v is shared equally among all orders (i.e., v 1 = ... = v n = v n ). The final orders are defined as An illustration of the price-volume curves derived from MTAA strategy based on different aggressiveness values is shown in Figure 4.

Imbalance Settlement
The MO, in addition to running the ID market, is considered to be responsible for the final imbalance settlement after gate closure. This relies on the assumption that the final position of each agent at the gate closure is binding and the agent does not adjust its production/consumption during the physical delivery. The positive and negative imbalance prices (π imb,+ and π imb,− , respectively) denote the penalties applied to positive and negative imbalances caused by the trading agents. The two prevailing imbalance mechanisms currently in use throughout Europe, namely single and dual pricing, are both available in the current framework, with the user being responsible to define which of the two is applied.
The single pricing mechanism applies a penalty to the agents that have a negative imbalance and remunerates the agents that have a positive one. The value of the imbalance prices under the single pricing mechanism is often the same based on the specific electricity market (i.e., π imb,+ ≈ π imb,− ) and depends on the sign and the size of the system imbalance. For instance, if the system imbalance is positive, a downwards regulation takes place. All imbalances are then settled at the downwards regulating price π down and for the single pricing mechanism this implies π imb,+ = π imb,− = π down . Formally, the single imbalance pricing settlement amount r sip,down i is given by Alternatively, when a negative system imbalance occurs, an upwards regulation takes place and imbalances are settled at the upwards regulating price π up , which results in π imb,+ = π imb,− = π up . In that case, the single imbalance pricing settlement amount r sip,up i will be: r The dual pricing mechanism applies a different price to the positive and the negative imbalances, respectively. For example, let R denote the regulation volume activated to counteract the system imbalance. In the case the system is in upwards regulation (i.e., negative system imbalance), an upward regulation price π up is applied to the positive imbalances and the day-ahead price π DA is applied to the negative imbalances. Formally, π imb,+ = π up and π imb,− = π DA . Thus, the dual imbalance pricing settlement amount under upwards system regulation (i.e., r dip,up i ) is given by In the case that the system is in downwards regulation (i.e., positive system imbalance), a downward regulation price π down is applied to the negative imbalances and the spot price π DA is applied to the positive imbalances. Formally, π imb,+ = π DA and π imb,− = π down . Hence, the dual imbalance pricing settlement amount under downwards system regulation (i.e., r dip,down i ) is given by If no regulation is activated, then all imbalances are treated at spot price π DA . As described above, the sign and the amount of the system imbalance (regulation sign) determine the penalty that will be attributed to the trading agents.

Impact on System Regulation
In this paper, we consider that the values for the upwards π up and the downwards π down regulation prices are predefined and do not depend on the regulation volume activated R. This way, the sign of the system regulation sgn(R) is sufficient to determine the imbalance prices (π imb,+ and π imb,− , respectively), given the imbalance mechanism (single/dual pricing) considered and its computation proceeds as follows. First, a random variable Y ∈ {0, 1} is sampled from a Bernoulli distribution that writes as where k denotes the probability of having a positive imbalance. In order to incorporate the impact of the imbalances of trading agents in the imbalance settlement period (ISP), the imbalance influence factor f ∈ [0, 1] is used. The cumulative imbalance caused by the trading agents is computed as while the probability k writes as On the one hand, when f = 0, the sign of the imbalance ∆ market does not impact the system imbalance, which is then determined in a random way. On the other hand, if f = 1, the cumulative imbalance of trading agents fully define the total system imbalance. Then, the sign of the system regulation R, given the realization of the random variable Y is given by Once the sign of the regulation volume is determined, the imbalance settlement takes place for each agent according to Equations (37)-(39).

Test Case, Results and Discussion
The presented ABM framework is used to evaluate three case studies based on a proposed market configuration. First, the impact of different pricing strategies on the market outcome is evaluated by gradually modifying the traders that adopt the MTAA strategy. Then, the effect of capacity outages in the market price formation process is validated. Finally, the effect of the imbalance price information asymmetry is analyzed.

Test Case Set-Up
In the following section, a case study with six trading agents is proposed. Among these, four are variable (two RES agents, Wind1 and Wind2 and two consumer agents, Flex1 and Flex2) and two are dispatchable (Ther1 and Ther2), according to the classification in Section 5. Additionally, an MO agent is defined to manage and clear the orders submitted by the aforementioned traders.

Trading Agents Configuration
In line with Section 5, the trading agents have specific sets of input parameters. Numerical values for the listed parameters are presented in Table 1. The values in this table are set so as to maintain enough liquidity in the market in different case studies discussed in this section. For the variable agents, the forecast error drives their trading behavior and it is given by the difference between their updated forecasts and their updated position. At the gate-opening time of the CID market, the DA position is the initial position of the agents. The updated forecast is derived from the capacity and p var . For example, for the Wind1 agent, the updated forecast would be 2200 MWh, therefore, leading to a forecast error of 700 MWh from its initial DA position. The capacities, DA positions, and initial limit prices of the dispatchable agents are decided based on their characteristics to participate in the CID market if they can sell beyond their DA positions at a price above their marginal cost or buy at a low price in the CID market to produce less than their DA position. The forecasts of these agents are assumed to be updated every 5 min. The minimum stable load of the conventional agents is assumed to be 50 MW whereas the n orders value for all the agents are assumed to be equal to 10. Additionally, the input values of MTAA strategy parameters including β, η, and δ p are chosen according to [35].

. Market Operator Configuration
In the current example, the MO processes orders for one single hourly product from 00:00 to 01:00 on day D, assuming a trading session that starts (t H1 open ) at 16:00 and ends (t H1 close ) at 23:00 on day D − 1. The DA price is set to 30 EUR/MWh, while the upwards and downwards regulation prices are 160 EUR/MWh and 5 EUR/MWh, respectively. Dual imbalance pricing is adopted as imbalance settlement mechanism. Lastly, the time-step for the CID trade is considered to be 5 min.
The code for the simulations is written in Python 3.8. Simulations are performed on a GNU/Linux machine whose CPU is an Intel Core i7-8665U and with 16 GB of RAM. It takes 2 min to complete each simulation. The repository containing the proposed framework implementation as well as the test cases presented is freely accessible in GitLab [40].

Evaluating the Effect of Different Pricing Strategies
This subsection investigates the impact of the two available pricing strategies (i.e., naive and MTAA) on the agents' revenues. To this end, four different simulations are run where the agents' strategies are tested. In the first simulation (Wind AA), the RES agents adopt an MTAA strategy while the rest use a naive strategy. For the second simulation (Consumer AA), the consumer agents adopt an MTAA strategy, while the rests adopt the naive one. In the third simulation (Thermal AA), the conventional agents adopt the MTAA strategy, while the rest use a naive one. Finally, for the fourth simulation (All AA), all six agents adopt the MTAA pricing strategy.
In this case study, constant offset forecast (see Section 5.3 for details) is assumed to be adopted by all variable agents for the sake of simplicity. Based on the DA position of Wind1 and Wind2 and their generation forecast, they would predominantly act as sellers in the CID market. On the other hand, Flex1 and Flex2 would act as buyers in the CID market to be able to match their positions with their forecasts. Ther1 and Ther2 can either sell or buy in the CID market depending on whether they can be transacted at a lower price than their updated limit buy or higher price than their updated limit sell. Table 2 lists the revenues (in k ) of all six agents after the ID gate closure (before the imbalance settlement stage) under different pricing strategies. The transaction prices in the CID market as a result of the strategies of the agents are shown in Figure 5.  Figure 5a displays the evolution of the transaction price in the Wind AA scenario. At the gate-opening of the CID market, the naive consumer agents (Flex1 and Flex2) buy at their limit prices (150 EUR/MWh). Owing to high liquidity in the market during the initial few hours, they buy the deficit in their position and reach the forecasted consumption levels. Wind1, Wind2 and Ther1, Ther2 act as sellers to Flex1, Flex2 until they reach their forecasted consumption. During these transactions, the Flex1, Flex2 agents lower the prices of their bid orders according to the naive strategy. Consequently, the ask order prices for the MTAA agents are adapted to respond to the market. As Flex1, Flex2 match their forecasts, the transaction price falls to 20 EUR/MWh. At this price level, around 18:20, the naive Ther1, Ther2 agents start posting bid orders, as that price is equal to their limit to buy. The strategic Wind1, Wind2 agents (the agents that follow the MTAA strategy are referred to as 'strategic' agents while those with the naive strategy are referred to as 'naive' agents) adapt to the prices in the market and are transacted until their positions become equal to their forecasts.
It can be observed from Figure 5b that when the Flex1 and Flex2 agents follow the MTAA strategy (FlexAA scenario), the transaction price at the CID gate opening is at 70 EUR/MWh, which is well below their limits to buy. Figures 5b and 6b show how the strategic consumers can pay a lower price as compared to the scenarios (WindAA and TherAA) when they are naive while the producers are strategic. This explains why the cost incurred by the Flex1 and Flex2 agents in the CID market is lower in the FlexAA scenario (61,260 EUR and 55,260 EUR) as compared to that in the WindAA scenario, as seen in Table 2. At the same time, it can be seen in Table 2 that the revenues earned by the naive wind agents (64,480 EUR and 61,760 EUR) for reaching the same final position (as seen from Figure 6a-c and Table 2) are reduced when Flex agents are strategic.
The thermal agents in the CID market can sell above their limits to sell (l sell ) and then buy at a cheaper price than what they have sold at as long as the price is below their limits to buy (l buy ). This behavior of the thermal agents can be observed in Figure 6a-c. Figure 6c shows the Thermal AA scenario where the thermal agents sell at a high price (above 150 EUR/MWh) at the gate opening of the CID market (16:00). They start buying from the naive wind agents 19:00 onwards. Following the MTAA strategy, both Ther agents can transact. Moreover, the strategic Ther agents trade their volumes in parts over a period of a few hours rather than trading the entire volume in a shorter time period as in Figure 6a,b. The effect of this can be seen on the revenues of the thermal agents in Table 2.
The time required for the transaction price to reach 20 EUR/MWh, which is the limit to buy for Ther2, is different depending on the scenarios. In Figure 5a (Wind AA) where RES agents act as sellers while Ther1 and Ther2 are the buyers. It can be observed that the transactions take place at 20 EUR/MWh at 18:20. However, in Figure 5c (Thermal AA), the transaction prices reach 20 EUR/MWh at 19:00, when the sellers (Wind1 and Wind2) are naive while the buyers (Ther1, Ther2) are strategic. Therefore, it can be inferred that if the sellers are strategic, the price can converge faster to the value at which the buyers can buy (limit to buy l buy ). However, if the sellers are naive, this process of adaptation of the price to l buy can be slower.
In Figure 5d, the transaction prices stay within the range of 61-69 EUR/MWh. In this case, all the agents follow the MTAA strategy. As the transaction price does not go below the limit to buy (l buy ) for the Ther agents, they are not able to buy from the Wind agents. As a result, Wind1 and Wind2 agents are only able to sell to the Flex1 and Flex2 agents, who have limited capacities to buy. The strategic Flex1, Flex2 agents trade their volumes in parts over the entire trading horizon as opposed to the earlier cases. Therefore, the wind agents are not able to match their positions with their forecasts as opposed to the previous scenarios. This shows that the proportion of strategic agents and their capacities can have a significant effect on the transaction prices, thus influencing the liquidity and final positions of the agents in the CID market. As seen in Table 2, the revenues earned by wind and thermal agents are reduced, while costs incurred by Flex agents are less than the WindAA and TherAA scenarios.
Notably, the behavior of the variable agents in the CID market is sensitive to their DA positions and forecasts. The aim of the variable agents is to match their positions in the CID market to their updated forecasts. However, these agents are also limited by their capacities. Therefore, if the DA position of an agent is close to its capacity, it might reach its capacity limit soon and would not be able to trade further. This can give rise to lack of liquidity in the CID market, especially with a small number of trading agents. Hence, the effect of different price-volume strategies would become difficult to study in such type of a market setup.

Comparing the Response to Capacity Outages
As described in Section 5, the agents can update their preferences in the wake of an extreme event, e.g., an outage. This subsection analyzes the effect of information of an outage event on the behavior of the agents and the transaction prices. As the strategy followed by each agent is responsible for deciding its behavior, the effect of the information of outages is studied and compared when the agents follow either an MTAA or a naive strategy. The following cases describe the different strategies followed by the agents.

•
Case I: all the agents follow the naive strategy; • Case II: only the agent that suffers the outage follows an MTAA strategy while all the other agents are naive; • Case III: all agents adopt the MTAA strategy except the one that suffers the outage; • Case IV: all agents follow the MTAA strategy.
To showcase the impact of outages on the behavior of agents, a series of experiments are conducted. First, the effect of receiving information about an outage for Ther1 at different time instants in the trading session is simulated, and the associated results are centralized in Table 3. Then, similarly, the effect of knowledge of 100% outage in the portfolio of Wind1 at different time instants is evaluated. The corresponding results from Wind1 outage simulations are summarized in Table 4. Table 3. Effect on the transaction prices (EUR/MWh) for information of 100% outage Ther1 at different trading times and for different pricing strategies. (First column: Share of trading horizon reached at outage in %) (Bef.: Before, Af.: After).
Af.  In Table 3, it can be seen that the response to the outage of Ther1 is highly sensitive to the strategies adopted by Ther1 and the other agents. It also depends on the time when the outage takes place. Consider Case II (Thermal AA) when the outage is received at 75% of the trading horizon, a substantial price increase of 325% is observed. As the outage takes place closer to the gate-closure, the less expensive agents (Wind1 and Wind2) have already reached their forecasted set points and do not sell to the Ther1 agent. Therefore, a more expensive naive Ther2 whose limit to sell is above 80 EUR/MWh is activated in the market, setting the prices to 85 EUR/MWh.
In Case II (Thermal AA), the naive agents lead the prices in the market and the MTAA agent follows. A similar principle also applies to Case III when only the unit with an outage is naive but the others are strategic. The relative change in transaction prices is significant in Case III as the Ther1 agent is naive and other agents are strategic.
In Case IV, when all the agents follow an MTAA strategy, the agents trade the volume in parts throughout the trading horizon and the transaction prices are generally higher as compared to the other cases. In this case, if an outage of Ther1 is going to happen, then the relative change in prices is not that significant as the agents learn slowly per the market event (outage). As a result, the unit that will suffer the outage is still able to buy back in the CID market but in small parts of volume distributed over several hours until gate closure. Trading smaller volumes with time leads to smaller price change rather than a surge in price if the entire volume was being traded in a short duration of time-therefore, avoiding a sudden surge in prices.
It can be seen that there is a less significant relative increase in price when the outage occurs at the beginning of the trading horizon (t = 25%) as compared to near the gate closure (t = 75%). One of the main reasons for this difference can be that the transaction prices are already higher in the market at the beginning. Therefore, a further increase in price does not create a spike in price.
A common observation from Tables 3 and 4 shows that there is always an increase in price when producers Ther1 and Wind1 are informed about the outages. There is a difference between the relative changes in prices in Tables 3 and 4 for outages of the thermal and wind producers, respectively. These differences are owed to the fact that the limit to buy (l buy ) for the wind agent is higher than the thermal agents. Therefore, under certain circumstances, when the unit that loses the capacity needs to buy, it can pay a high price depending on its limit to buy, thus increasing the prices in the market.

Evaluating the Effect of the Imbalance Price Information Asymmetry
In an electricity market, some agents have better estimates of the imbalance prices as compared to others. Based on the estimates of imbalance prices available to each variable agent, they may either prefer to remain in imbalance or trade in the CID market to reach its forecasted generation or consumption. This subsection discusses the effect of information asymmetry on the behavior of the agents in the CID market (in this study, in relation to information asymmetry, all the agents are assumed to follow the MTAA stategy). According to Equations (4) and (5), the estimates of imbalance prices can be varied by assigning different values to e imb .

Effect of Information Asymmetry on the Wind Agent
In this case study, we analyze the effect of information asymmetry on Wind1 agent. To perform the analysis, we make certain assumptions about the values of white noise variance (e imb ). The estimates of the imbalance price values to the agents is obtained by adding the real imbalance prices (π imb,+ i,t ,π imb,− i,t ) to the variance generated by e imb , the detailed expression is provided in Section 5.1. In this analysis, we keep the value of e imb equal to zero for all other five agents but Wind1 and vary e imb for the latter. The input data used for this study are similar to those in Table 1; however, a few parameters, namely the limit to sell (l sell ) for Wind1 and Wind2 and realization (p var ) value for Wind1, were modified. The l sell for Wind1 and Wind2 agents was set to 30 EUR/MWh while p var value for Wind1 was set to 2000 MWh.
The value of e imb is increased from 50 EUR/MWh to 250 EUR/MWh, thus making the estimate of imbalance prices worse for the Wind1 agent. The estimate of imbalance prices affects the limits set by the agent according to Equation (19). The Wind1 agent remains in positive imbalance throughout the trading horizon. Therefore, it is interesting to observe the change in the limit to sell (l sell ) of Wind1 with the change in e imb . The Wind1 agent compares its performance with the imbalance settlement. As e imb is increased, the Wind1 agent starts underestimating the value of the down-regulation price. Therefore, the Wind1 agent lowers its limit to sell to transact and reach its forecasted generation rather than staying in imbalance. The Wind1 agent would otherwise be paid in the imbalance settlement stage according to its low estimate of down-regulation price. Table 5 shows the relative change in transaction prices for different values of e imb . With the increase in e imb , the information about imbalance prices is made worse. As a result, the limit to sell for the Wind1 agent fluctuates more for a larger value of e imb . On the other hand, the Wind2 agent has perfect information of the imbalance prices with e imb = 0, therefore, at the beginning of the trading horizon, it sets its limit to sell to 5 EUR/MWh, which is the actual value of the down-regulation price. The Wind2 agent does not change its limit to sell after that due to perfect information about the down-regulation price. It can be seen in the second row of Table 5 that the transaction price at the gate opening of the CID market, (π open tr ), takes a value around 80 EUR/MWh. However, the way the transaction prices evolve during the trading horizon changes with the values of e imb . The transaction price at the gate closure (π close tr ) as seen in Table 5 is different based on the values of e imb . Table 5. Effect of information asymmetry of imbalance price for agent Wind1 on transaction prices.

Effect of Information Asymmetry on the Flexible Agent
To study the effect of information asymmetry from a buyer's standpoint, the e imb value for Flex1 is increased from 0 to 300 EUR/MWh, while that of the other five agents is kept at 0 EUR/MWh. During this analysis, the limit to sell (l sell ) for Wind1 and Wind2 agents was set to be 30 EUR/MWh. The realization (p var ) value for Wind1 was set at 2000 MWh. The value of limit to buy (l buy ) for Flex1 and Flex2 agents was made equal to 70 EUR/MWh.
The effect of variation of e imb of Flex1 agent on the transaction price can be seen in Table 6. This table shows how the value of e imb of Flex1 agent affects the transaction prices. With the increase in the error of the imbalance price estimate for the Flex1 agent, it erroneously overestimates the positive imbalance price (π imb,+ i,t ). As a result, according to Equation (18), the agent updates its limit to buy (l buy i,t ) according to the new estimate ofπ imb,+ i,t , which is greater than its previous value. This leads to an increase in the l buy i,t of the Flex1 agent, which results in elevated order prices posted by the agent. Therefore, an increment in the transaction price in the CID market with time is observed. The effect of e imb on the limit to buy (l buy ) or sell (l sell ) depends on the initial limits of the variable agent of interest and that of other agents in the market. For example, if we are studying the effect of information asymmetry on a buyer and if its limit to buy is above the limit to sell of potential sellers, then the e imb variation does not make any difference to the transaction prices or the way the limit to buy adapts. In such a case, the initial limit to buy for buyers needs to be set at a lower value than the limit to sell, and then as the e imb value is increased, the limit to buy increases to be transacted in the CID market. This study on the information asymmetry of imbalance prices shows the importance of publishing the information about balancing reserves activated by the system operators in real time. The lack of this would cause information asymmetry, which can favor a few market participants who can then influence the market price.

Discussion
In this section, we discuss the limitations of the presented framework and the developed pricing strategies. More specifically, one central assumption is that we have discretized the CID market timeline so that the agents are allowed to submit orders at equidistant time instants. However, in reality, the trade can take place at any time in the trading horizon. This may lead to different outcomes when large time-steps are considered. In addition, the agent configuration selected for each experiment is critical and should be carefully selected to reflect a realistic market instance. The behavior of the agents in the CID market is sensitive to their DA positions, capacities, and forecasts. If the DA position input of an agent is close to its capacity, it might soon reach its capacity limit in the CID market trading horizon and would not be willing to trade further. This can give rise to a lack of liquidity in the CID market, especially with a few numbers of trading agents. Hence, in such a market setup, the effect of different price-volume strategies would become difficult to assess. With the availability of sufficient data, a realistic market configuration can be tested with the proposed ABM to derive more practical insights.
In addition, in this paper, we assume that the strategic variables of each agent are not public, and consequently, the rest of the agents do not have access to any of this information. However, in a real market setting, there might be universally available forecasts of wind, solar, or electricity load, which could directly facilitate the predictions of the other agent strategies or future prices. However, to simplify the simulation process, we consider that the agents do not have access to this information. The MTAA pricing strategy allows for the agents to decide their order prices by considering the past transaction prices in the market and the submitted orders. The order prices can then be updated each time the agent submits an order in the CID market. In the naive strategy, the agents have no access to the past or future values of the prices.

Conclusions
In this paper, we proposed an agent-based modeling framework to simulate the behavior and interaction of different agents in the European CID market. In particular, dispatchable as well as variable agents can trade electricity through a centralized limit order book, which is constantly updated by the electricity market operator. Two pricing strategies are considered according to which the trading agents can decide upon the orders to be posted in the CID market, namely a naive and a learning-based adaptive aggressiveness (AA) trading strategy. The proposed adaptive trading strategy was found to perform better than the naive strategy in terms of the revenues accumulated by the agents in the CID market. The proportion of strategic agents in the CID market was found to have a significant effect on the transaction prices, thus influencing the liquidity and final positions of the agents in the CID market. The strategic producers were able to exploit the limit prices of the naive consumer agents in the market, leading to high transaction prices in the market.
Furthermore, this paper shows that, in the case of an outage of a dispatchable agent, the prices in the market increase, and the surge in price is larger as the outage takes place closer to the gate closure. A more significant change in prices takes place when a strategic agent suffers an outage while other agents are naive, and in the case that a naive agent suffers an outage while others are strategic. However, when all the agents are strategic a substantial price increase is not observed. Therefore, in the wake of an outage, it is beneficial if the agents adopt the proposed learning-based strategy to avoid the high transaction prices. We further show that, in the case of information asymmetry in the imbalance prices, there is a decrease/increase in the limit to sell/buy of the agents, therefore leading to a decrease/increase in the transaction prices. Therefore, the revenues (cost) earned by sellers (buyers) are reduced (increased) as an effect of information asymmetry.
The key findings of this paper can be summarized as follows: • The proposed ABM provides a formalized tool to study the behavior of agents (market players) under different CID market settings; • The MTAA strategy presented in this work outperforms the benchmark (i.e., a naive strategy) in terms of revenue and coping after outages; • Information asymmetry among agents regarding the imbalance prices influences the transaction prices in the CID market, favoring those agents with more information.
Future work could be directed towards modeling hydro-power, energy storage and other agents in the CID market. An extension of the framework to include multiple products is another interesting addition to the existing agent-based model. Effort could be put in the future to add transmission constraints and perform larger case studies.

Nomenclature
The following abbreviations are used in this manuscript: Factor to represent the deviation of the forecast with respect to the real imbalance price π imb,+ Real positive imbalance price π imb,− Real negative imbalance price π up Up-regulation price π down Down-regulation price C i Minimum stable load of a dispatchable agent i α A step factor to update limit prices l buy i,0 Initial limit of an agent to buy l sell Best bid volume at time t bav t Best ask volume at time t v match Volumes matched in a transaction Continuous Variables r i,t Cumulative revenues collected by an agent i at each time-step t of the trading process π i,t Price of an order posted by agent i at time t bbp t Best buy price at time t bap t Best ask price at time t vwapb t Volume weighted-average price in the bid side at t vwapa t Volume weighted-average price in the ask side at t Maximum price value for a naive agent to sell P sell Set containing the candidate prices for ask orders P buy Set containing the candidate prices for bid orders ∆π Price step MTAA Strategy Parameters and Variables π min User-defined minimum price value for MTAA strategy π max User-defined maximum price in the MTAA strategy π ask i,t Price of an ask order determined by MTAA strategy for agent i at time t π bid i,t Price of a bid order determined by MTAA strategy for agent i at time t a i Aggressiveness of agent i τ i Target price for an agent i θ Parameter that relates r with τ π Competitive equilibrium price β Step-size parameter to update aggressiveness ν Market volatility P sell (V j ) Set of price values of ask orders as a function of proportion of order volume P buy (V j ) Set of price values of bid orders as a function of proportion of order volume if y i,t = "BID" then 3: if π i,t ≥ bap t then 4: v res ← v i,t