Vous êtes sur la page 1sur 10



Optimal Demand-Side Bidding Strategies in Electricity Spot Markets

Roco Herranz, Antonio Muoz San Roque, Jos Villar, and Fco. Alberto Campos
AbstractThis paper proposes a methodology for determining the optimal bidding strategy of a retailer who supplies electricity to end-users in the short-term electricity market. The aim is to minimize the cost of purchasing energy in the sequence of trading opportunities that provide the day-ahead and intraday markets. A genetic algorithm has been designed to optimize the parameters that dene the best purchasing strategy. The proposed methodology has been tested using real data from the Spanish day-ahead and intraday markets over a period of two years with a signicant cost reduction with respect to trading solely in the day-ahead market. Index TermsElectricity markets, genetic algorithms, strategic bidding.

C. Variables Market clearing price in each market [ /MWh]. Optimal energy purchase [MWh]. Imbalance cost respect to the load forecast [ ]. Imbalance energy with cost [MWh]. with Proportion of energy bought after market respect to the total load forecast. and hour

NOMENCLATURE A. Indexes and Sets1 Trading markets (0 for the day-ahead market and 1 to 7 for intraday markets). Hours belonging to a set is cleared. where each market

Binary variable to indicate the activated step of the residual offer curve for the optimal cleared energy . Purchase energy in each step of the residual offer curve (null if ) [MWh]. D. Functions Aggregated demand of the rest of retailers in each market and hour in . Demand curve of a general retailer. Aggregated supply function of the competitors. Supply function of a retailer. Residual offer curve of a retailer. I. INTRODUCTION

Set of hours with the same number of trading opportunities. Points of the residual offer curve of the retailer under study.

B. Parameters Load forecast at each hour [MWh].

Maximum purchase capacity of the retailer [MWh]. Quantities of the total residual offer curve in [MWh]. Price of in the residual offer curve [ /MWh].

Manuscript received December 21, 2010; revised May 24, 2011, October 19, 2011, and December 07, 2011; accepted January 15, 2012. Date of publication March 02, 2012; date of current version July 18, 2012. Paper no. TPWRS01034-2010. The authors are with the Instituto de Investigacin Tecnolgica (IIT), which belongs to the Universidad Ponticia Comillas, Madrid 28015, Spain (e-mail: rocio.herranz@gmail.com; antonio.munoz@iit.upcomillas.es; Jose.Villar@iit. upcomillas.es; Alberto.Campos@iit.upcomillas.es). Digital Object Identier 10.1109/TPWRS.2012.2185960

indexes have been suppressed in the text for the sake of simplicity.

UE to the great variety of spot markets and market rules designs, many approaches have been presented in the literature to deal with the design of optimal bidding strategies. In [1] four main aspects are used to classify the variety of proposed methodologies: different spot market mechanisms, price taker or price maker agents, uncertainty modeling and resolution methodologies. Other features, such as the amount of information that is released, how agents are willing to hedge against risk, and the representation of power systems, such as transmission networks constraints, are also considered. This introduction briey reviews these four topics prior to describing the methodology proposed in this paper to compute the optimal bidding of a buying agent. On the whole, electricity markets are organized in a sequential way, where trading takes place through a set of different mechanisms, which range from long-term bilateral contracts to very short-term transactions. Generally, most energy is traded in a day-ahead market (DM), and most related literature optimizes the bidding strategies for this type of markets (see Table I). Depending on the country, there may or not exist additional trading

0885-8950/$31.00 2012 IEEE




opportunities. In the Spanish case, intraday markets (IM) allow agents to adjust their schedules to their latest forecasts or to real time operating conditions. In addition, ancillary services markets (RM) are typically managed by the system operator to ensure electricity supply under suitable conditions of security, quality and reliability [2]. Table I lists the markets considered by different authors to optimize short-term bidding. A market agent can be considered as a price taker when his cleared energy does not signicantly affect the resulting market price [3], [4], [11], [16]. In this case, to guarantee a positive margin, generators offer their energy at marginal costs while retailers try to buy at a price that satises their expected income. In both cases the strategy comes down to a decision about which markets to buy or sell energy in. For example in [3], [4], [11], and [16], the strategy of a price taker is optimized given market prices forecasts, thus ignoring market price changes due to its own cleared energy. However, even if a price taker does not set the market price, his bids shift the total aggregated bidding curves and affect the nal price. This effect could be especially signicant in adjustment markets where a much smaller amount of energy is traded. In these cases using residual curves forecasts is the most common approach to properly model the effect of the agent on the market prices [6], [13], [14]. The decision variables of the optimization problem can either be quantities (the agent sells at marginal cost and buys at maximum price), or both quantities and prices [5][8], [12][14] when the optimization result is the whole offer curve. Price takers and price makers are exposed to different sources of uncertainty. Indeed, works focusing on price taker agents usually maximize their prot, considering uncertainty only in market prices and typically using different price scenarios as in [3], [4], and [11]. A model for price uncertainty based on the probability density functions of forecasted prices is developed in [3]. In [4] the denition of price scenarios is based on the forecasted price and on the historical error observed in the forecasting process, which uses a combination of neural networks and fuzzy logic. In addition, [4] improves the method proposed in [3] by considering both risk averse and risk seeker agents, in the sense that the scenarios used to build the bids are selected according to these risk attitudes. In [11], price scenarios are sampled from prices forecasted with time series and articial neural networks techniques. A small price taker agents strategy is optimized in [16], in which the authors propose a stochastic linear programming model with scenarios for the day-ahead and balancing market prices and load prediction errors. The scenarios are generated by an algorithm that produces a discrete joint distribution consistent with the values of the rst four marginal moments and the correlations of each variable. In [17], the authors optimize the strategy of a retailer in the U.S. California power

market, introducing uncertainty in the demand as a martingale and considering that the prices are random variables. They solve a stochastic dynamic problem with three sequential markets. In [18], the performance of an energy buyer through a long and a short-term market is analyzed. The purchase allocation approach minimizes the total purchase cost, taking into account the price volatility and the risk that is reected by the variance of the cost. A risk weighting factor is dened to avoid purchasing energy in the market with the cheapest price but larger volatility, concluding that the energy should be bought in more than one market. When the inuence on price is taken into account, since uncertainty (such as the demand forecast, fuel costs and the strategic behaviors of other agents) is implicit in their supply and demand functions, it is a common practice to generate scenarios of these supply and demand functions from past data. Reference [6] represents competitors behavior with a probabilistic residual demand linear function obtained by clustering past data, and takes into account the risk assumed by the market participant. In [13], residual demand curves are sampled from past realizations, with demand similar to the expected demand for the day of study. [14] obtains residual demand curve patterns by clustering past data, and determines their probabilities with decision trees. The patterns and their probabilities are supplied to a stochastic optimization model. The resolution of the optimal bidding problem is dealt with using different methodologies. Mathematical programming techniques are the most frequently implemented as in [3], [4], [7], [8], [11], and [13][18]. Game theory is also applied by some authors. For instance, [9] proposes a model based on a Cournot iterative equilibrium. However, Nash equilibrium approaches [19] seem more suitable for the long and medium-term rather than for optimizing short-term strategies. Indeed they represent ideal and stable situations where no agent can increase its prot from a unilateral change in its strategy, while real time real markets are very dynamic and cannot be considered at the equilibrium, but rather uctuating over time around a theoretical equilibrium, that in practice is never reached. In addition, although detailed information of competitors cost functions is generally not available, most of the information of the competitors aggregated behavior is internalized in the aggregated offer or supply curve, which in the case of the Spanish market is available just after market clearing. Equilibrium models are developed in [20], where the conditions under which a purchaser should bid his expected demand are analyzed. In [6], the optimal offer curves are computed with a genetic algorithm (GA). In [12], the strategic bidding problem is formulated as a stochastic optimization problem, and a rened GA with binary encoding is implemented to solve it. The difference between the rened and a conventional GA is that the crossover probability decreases and the mutation probability increases, with the iteration number. A GA together with price forecasting techniques is applied in [21] to select appropriate bidding strategies, although the price uncertainty is not considered. In [10] a nodal pricing model is assumed and a GA is used to nd the strategy that optimizes a two level problem: at the rst level, a market participant maximizes his expected prot while at the second one the



system operator solves an optimal power ow for dispatching. The competitors behavior is modeled probabilistically. A GA computes the optimal strategy, the tness being the expected prot, calculated using a separate Monte Carlo simulation. There is a clear methodological parallelism between the strategy optimization of energy buyers and sellers, and while most of the previous references [3][15], [21] deal with the optimization of the generators bidding strategies, some of them [16], [18], [20] do focus on the optimal bidding problem of a retailer who supplies electricity to end-users. This paper proposes a methodology to compute the optimal bidding of a demand side agent operating in the day-ahead market and intraday markets and subject to the imbalance penalty mechanism. Given an amount of energy to be purchased at each hour, purchasing costs are minimized by deciding the amount of energy to sell or to buy over the whole sequence of available trading opportunities. The basic assumption of this approach is the feasibility of learning from the recent past in order to take advantage from the differences in the residual supply functions of the different markets that persist over time. These differences are a consequence of the strategic behavior of the market agents, which typically evolve as a sequence of stable regimes. In the proposed methodology the agent is assumed to sell at a minimum price or to buy at a maximum price. His inuence on market prices is considered by computing the new clearing prices, using his residual offer curves (analogous to the residual demand curve but from the point of view of an energy buyer) in each market, which in the Spanish case are published immediately after the clearing of each market. Uncertainty is considered using a moving window of residual offer curves corresponding to the recent past. A Monte Carlo-like simulation is performed considering that the residual supply curves of the moving window are all equiprobable simulation scenarios. These curves are used to optimize, using a GA, the bidding strategy for the following day. Each day is broken into sets of hours with identical trading opportunities, and a different optimization problem is solved for each set. This tends to group hours with similar demand levels, and thus similar trading strategies. There are several contributions in this paper with respect to previous works. Firstly, the paper formulates a practical, robust and adaptive procedure to optimize the bidding strategy of a retailer. It has been designed taking into account the rules that regulate the participation of a real agent in the Spanish market, and only uses the information that is available at the moment of preparing the offer. Robustness is achieved avoiding over-tting, by minimizing the number of decision variables, since the same strategy is applied for all the hours sharing a same number of trading opportunities, but also by using out-of-sample validation techniques during the tting process. In addition, uncertainty is considered by facing each bidding strategy against a moving window of recent past scenarios that are supposed to represent the distribution of the expected residual supply. The size of this moving window has been empirically optimized using the whole training period for a better representation of the expected residual supply. Finally, adaptation is guaranteed by the moving window, since the strategy is re-estimated for each day.

Secondly, the inuence of the agent strategy in the market price is taken into account by reproducing the clearing process with the residual supply curves (however computed ignoring bids constraints among different hours). Indeed, assuming a constant market price could lead to signicant errors when the corresponding residual supply presents a large slope around the clearing point. Finally, the formulation of a classic optimization problem (as the Appendix shows) leads to a nonlinear and rather complex programming model, hard to solve with commercial solvers. The use of GA provides an alternative and effective solving approach that has proved to perform adequately for the whole set of training and testing data, as large as a two-year period. The paper is organized as follows. Section II contains a description of the problem and a full explanation of the market framework and of the residual offer curves. Section III provides a detailed formulation of the problem that is solved by the proposed GA, which is described in Section IV. Section V deals with the adjustment process of the GA parameters, and Section VI presents the results of testing the found bidding strategies. Finally, conclusions are drawn in Section VII. II. PROBLEM DESCRIPTION A. Market Framework This paper focuses on the optimal demand-side bidding in an electricity spot market that includes several independent and successive short-term trading auctions: the DM, the IM (up to six sessions that are equivalent to seven trading opportunities) and an imbalance penalties mechanism. The objective is to minimize the nal costs of the purchased energy in the above-mentioned markets. The structure and data of the selected framework correspond to the Spanish electricity market [22], [23]. Spot markets involve economic and technical issues that can be managed by one or several operators. In the Spanish case the spot market is constituted as a sequence of short-term auctions economically managed by the market operator (MO) and technically managed by the system operator (SO). It consists of a DM, several IM, ancillary services markets, balancing markets and an imbalance penalties mechanism. In the Spanish case there are no nodal prices since the transmission constrains are solved by a specic two-phases-constraints market. For the sake of simplicity this paper will only focus on the DM and IM. The largest volume of energy is currently traded in the DM that covers the 24 hours of the day ahead. For each hour, the agents submit their offers to sell or to buy. Market clearing produces a schedule of produced and consumed energy over the 24 hours of the next day, as well as the energy prices. After the DM, seven IM take place, with the purpose of allowing participants to correct their energy schedule in the event of deviations from the previous one. The MO determines the marginal price and the accepted bids by intercepting the aggregated offers to buy with the aggregated offers to sell for each hour. Offers to sell settled are those under the market price and offers to buy settled those over the intersection. Although beyond the scope of this paper, the Spanish bids mechanism also makes it possible to constrain the energy cleared among different hours [22].



Given and , for each hour and for each market, the agents residual offer is given by (3) In case the agent is a potential new incoming, as it is in the case example of this paper, its own historical supply and demand would logically be null. The residual offer curve provides the quantity that a retailer can buy at each clearing price , or equivalently, the price that results from a cleared quantity (negative quantities corresponding to energy selling): (4) Spanish residual offers are stepwise functions. For simplicity, the range of market prices has been discretized with samples, yielding to simplied stepwise functions represented with vector with prices and the corresponding vector quantities . The number of samples has been selected large enough to guarantee that the original curve is well enough approximated. III. BIDDING STRATEGY FORMULATION This paper addresses the bidding problem faced by an energy buyer that has to buy a specic amount of energy for each hour at the available power auctions DM and IM. Its principal objective is the minimization of the total purchase cost. For the sake of simplicity, the buying and selling prices have been set, respectively, at the maximum and minimum Spanish regulated market prices (180 /MWh and 0 /MWh) in order to guarantee that the bids are always cleared, provided that there is enough energy traded in the corresponding market. The strategic decision variables are thus the hourly energy (MWh) that the agent is willing to buy in every market (0 stands for DM and 1-7 for IM) and hour . To consider uncertainty, the cost function has been dened over a moving window of residual offer curves corresponding to the recent past behavior of the market competitors. For each window a xed set of strategic parameters is optimized and applied to the day ahead. The cost of buying energy in a settlement period is then computed as (5) is the size of the moving window (see Section V-B); where is the cleared energy at hour in each market ; is the market clearing price and is the imbalance cost that has been set at (6) where by is the imbalance energy incurred by the retailer given

Fig. 1. Equivalent timetable for DM and IM sessions for Spanish market.

After every intraday market session, the SO manages real time deviations, using ancillary services and, if needed, summoning balancing markets. Each market participant is responsible for balancing between the real generation or consumption and the cleared quantities. If imbalances nally occur, however, the agents are penalized for their contribution to the global system imbalance. For the sake of simplicity, the sequence of the Spanish markets has been reorganized into an equivalent sessions timetable, shown in Fig. 1, where crossed grey cells represent when the MO receives the bids and clears each market, and the black and grey cells the time scope of the bids sent. Seven IM have been represented since the 2124 hours of IM1 are in fact like a new IM for the current day, often called IM7. As can be seen, day can be partitioned into 6 sets of hours, each one with the same number of trading opportunities: 14 hours (S1), 57 hours (S2), 811 hours (S3), 1215 hours (S4), 1620 hours (S5), and 2124 hours (S6). For example, for all the hours belonging to set S1, energy can be traded in DM, IM1 and IM2, while for set S2, it can be traded in DM, IM1, IM2, and IM3. A different optimization problem is set out for each set. In addition, this partition helps in grouping together hours with similar demand levels, and thus likely similar strategic behaviors. B. Market Clearing and Price Computation Many approaches have been proposed in the literature to model market clearing and price computation [1]. In this paper a residual offer curve [24] (analogous to the residual demand curve but from the point of view of an energy buyer) is used to compute the market price for each cleared energy. At each hour and for each market, the aggregated supply indicates the amount of energy to sell at price , and is computed as the sum of all the supply functions of all the generating units. The supply of the rest of participants, , is obtained by combination of the total aggregated supply and the agents own supply as follows: (1) Similarly, the demand of the rest of the participants, , can be computed from the total aggregated market demand by subtracting the agents own demand : (2)




being the perfect forecast of the load that should theoretically be bought at each hour . As can be seen, imbalances have been heavily penalized. If the retailer is short (his nal cleared energy is lower than that which was scheduled), the decit of energy is penalized at the maximum market price 180 /MWh. On the other hand, if the retailer is long (his nal cleared energy is higher than scheduled), the surplus of energy is paid at null price. In the proposed approach, the retailer makes his decisions as follows. He always uses his best load forecast at the time of submitting his offer. His rst offer are the pairs submitted to the DM for each hour , where the purchased energy is a proportion of its initial load forecast: (8) is one of his decision variables, and has been Coefcient assumed to be constant for all the hours of a same set of hours, being the proportion of energy bought after DM with respect to the total energy to be bought. The cleared energy and the new market price are computed from (4). To avoid unrealistic clearing, the offer is limited by the maximum energy that is being sold or bought at each hour and market session: (9) provides the energy that can be bought at Note that price in market and hour . In this approach, offer prices has been set to 180 /MWh for the buying and 0 /MWh for the selling. In addition the bought energy is always constrained to the maximum purchase capacity of the agent (declared to the MO and SO) since otherwise its offers would be rejected: (10) After DM clearing, the retailers schedule can be corrected in the subsequent adjustment markets (IM). Depending on the set of hours considered, the number of trading opportunities, including DM, range from 2 to 7 (see Fig. 1). The quantities to be sold or bought are given by (11) are the decision variables for IM market for the where set of hours. Note that means that a positive amount of energy is bought in market . The cleared energy at market price for each IM market is computed as for the DM, generalizing (9) and (10):

last adjustment market. In this case the imbalance energy is calculated using (7). The nal energy schedule results from the cleared energies over this sequence of market mechanisms. Accordingly, a different optimization problem to minimize the total purchasing cost can be solved independently for each set of hours. For example, the optimization problem for set S6, which has DM and seven IM different trading opportunities, is formulated as follows: (14)


(16) (17) (18) (19)


IV. PROPOSED OPTIMIZATION ALGORITHM A. Genetic Algorithm The optimization problem formulated in the previous section has been solved using a genetic algorithm (GA) [25]. GA does not require specialized optimization software such as CPLEX (avoiding licenses costs), is easy to implement with general purpose programming languages, and is very exible for problems with nonlinear constraints or binary variables. The Appendix describes an alternative mathematical programming model for the current problem, which could be solved with CPLEX. However it can be check that the model is nonlinear (because of the purchase cost to minimize) and has a rather large number of binary variables for the residual offer curve representation (in the case study of this paper at least 54 600 for S1 and S2, and up to 145 600 for S6) that seriously compromise its real applicability. GA performs a stochastic search starting from an initial population of solutions (individuals) generated randomly. Each individual, corresponding to a possible solution to the problem, was coded as a vector of real numbers that represent the deci. sion variables The decision variables were forced to be within the search domain . The optimization of every set was carried out separately on account of the different number of decision variables that each set has. For instance, the individuals of the population of S1 contain the decision for the DM, the IM1 and the variables IM2 markets, while the individuals of population of S6 contain 7 decision variables, one for each market. Fig. 2 depicts the

(12) (13) To avoid imbalances the quantity submitted to the last ad, so imjustment market available is computed with balances take place only if not enough energy is traded in the



B. In-Sample and Out-Sample Sets Cross validation techniques [26] were applied to ensure the generalization capability of the proposed solution. A moving for determining the best window is used as in-sample set coefcients for minimizing the total cost of purchasing energy in the moving window. The optimal coefcients are then tested with the out-sample set of the following day. This means that the GA determines the optimal strategy for the recent market behaviors implicit in , assuming that these behaviors will still approximately hold in . The process applied consists in selecting a size (number of days) for the moving window , optimizing the coefcients for this window, applying these coefcients to calculate the bid for the 24 hours of the next day , and moving and one day ahead, so that the new in-sample and out-sample sets are and , respectively. This process continues over the whole period studied. V. GA FITTING PROCESS The case of a new incoming retailer with 100 MWh of maximum hourly purchase capacity in the Spanish electricity market was used to t the parameters of the GA and the size of the in-sample set . In the rst step, the GA parameters (population size and crossover and mutation probabilities) were determined by running the GA with different values and selecting the best combination in terms of convergence performance and execution times. Then the moving window size was empirically optimized. A. Setting GA Parameters The parameters of the GA were set to obtain the combination of its values that lead to the best convergences by running exhaustive searches. Exhaustive optimizations were previously performed (by sampling the decision variables ranges and testing all combinations) to verify that the GA was indeed nding the expected global optimum. The population size is one of the key parameters of the GA. Large population sizes may lead to very slow performances, whereas too small sizes may lead to insufcient exploration of the search domain and therefore to premature convergences. In this case its size was nally adjusted to 25 individuals. Roulette wheel with ranking selection improves the selection process when the tness values in a population are too different or too similar. The individuals are sorted according to their tness, and their ranking, raised to an integer power, is used to build the roulette wheel. The performance of the GA proved to be better when the squared ranking was used. Using a PC with 2 processors, 3.16 GHz and 4 GB of RAM, the optimal bid of a day is found in about 10 min, which makes the procedure more than acceptable for its use in a real time environment. The nal parameters selected for the GA were a population size of 25 individuals, roulette wheel built from the squared ranking, a crossover probability of 0.8, mutation probability starting at 0.4 and linearly decreasing down to 0.1, and a maximum of 100 iterations. Convergence held in all the cases tested.

Fig. 2. Proposed GA structure.

overall algorithm for S6 case, where the individuals have 7 genes to compute the 7 bids to submit to the 7 different markets. Fitnessthat measures how good a solution isand individual coding are the main links between the GA and the problem to be solved. The minimization problem formulated in Section III was turned into a maximization problem in order to apply a GA, where tness calculation entailed clearing the markets. Individuals are selected from the previous population to create the so-called mating pool. This selection was performed according to their tness, using a roulette wheel with a ranking mechanism. Individuals are selected randomly from the mating pool and offspring are generated according to a crossover probability. Given two individuals and of length , their and are offspring computed by interpolation and extrapolation as follows:


(22) . where and are random numbers in Mutation is performed by randomly generating a new value for a gene within its search domain, whose location is also selected randomly, and performs better if its probability is larger at the beginning and decreases with the number of iterations. Finally, an elitist replacement was applied to guarantee that the best individual was always included in the new population.




Fig. 3. Purchasing cost and price versus the moving window size.


B. Sizing the In-Sample Set The in-sample set is used to determine the set of coefcients to build the bids for the following day. Its size, in terms of the number of past days used to determine the optimal coefcients , was empirically optimized by testing different window sizes for different maximum purchase capacities and different time periods. The optimal window size was always 4 or 5 weeks, with small differences between them. A window size of 5 weeks was nally selected and applied for all the studied cases. Fig. 3 shows how the total purchase cost and the energy purchase cost vary with the number of weeks (from 1 to 9) using the data of year 2009 for a retailer with 100 MWh of maximum hourly purchase capacity. Weeks of ve days (Monday to Friday) were used, since previous analysis showed that costs increased if Saturdays or Sundays were included in the same strategy. As can be seen costs reach a minimum around 5 weeks (25 days). Therefore it was decided to estimate the decision variables for the bids of the day with the residual offers of the 5 previous weeks (ignoring weekends as already mentioned). VI. RESULTS The methodology formulated in this paper, designed for the Spanish electricity market, was tested with the years 2008 and 2009. The case of a new incoming retailer with different maximum hourly purchase capacities (50 MWh, 100 MWh, 200 MWh, 300 MWh, 400 MWh, and 500 MWh) was further investigated in this section. Weekends were removed, and only working days were considered, simplifying the learning algorithm by eliminating the weekly seasonality. To preserve a similar pattern, the retailer energy forecast to be bought, , was set to a proportion of the total electricity demand of the retailers of the Spanish electricity system. Retailers demand, the aggregated supply and the total demand were obtained from public real data supplied by the MO and SO [22], [23]. Indeed the MO publishes the selling and buying curves sent to each market after its clearing. The stepwise residual offers can then be built by aggregating these original functions sampled as described in Section II-B. In this study, the strategy optimized with the GA has been compared with the strategy of trading uniquely in the DM. This strategy is equivalent to setting to 1 for every market

and for every set of hours, and has been referred to as the strategy. Table II summarizes the results obtained, and shows the total purchase cost saving for each retailer maximum purchase capacity considered, and for both the optimized and the strategies. A comparison of the different purchase capacities shows that 500 MWh for 2008 and 50 MWh for 2009 are the purchase capacities that provide the lowest buying costs. Table III shows the energy purchase cost for the same cases. It can be seen that this cost in 2008 is considerably higher than in 2009. One of the main reasons is that the average nal market price decreased by 38.7% in 2009 with respect to 2008. Both Tables II and III show that better results are obtained when purchases are optimally allocated in the available markets rather than only in the DM, since the energy cost saving ranges from 0.97 to 1.53 /MWh. These results raise the question of how near the equilibrium the market is. Indeed, at the equilibrium no arbitrage possibilities should exist between the different trading opportunities. Table IV shows the average market prices for each set of hours. The real market prices are shown at the top of this table, thus not including the effect of the new retailer. The row with shows the new DM prices when a 200 MWh retailer buys all the energy in this market, which increases with respect to the real case. Obviously in this case intraday markets prices remain the same. At the bottom of this table are the prices obtained when the same retailer applies the GA optimal strategy. It can be seen that, in general, original DM prices were higher than IM prices allowing for arbitrage between them. The amounts of energy that can be bought or sold in the available markets depend on the relationship between the slopes of their residual offer curves, or equivalently, on how their prices uctuate for a same amount of energy. As can be seen from Table IV, DM prices increase more for since with the optimal strategy only 20% of the energy is bought in the DM. It can also be seen that the optimal strategy tends to produce




Fig. 4. Coefcients

in 2009 of the retailer of 200 MWh.


also present shorter periods of stability, corresponding to stable strategic behavior on the part of most agents. One of the main benets of the proposed methodology is that it is capable of readily adapting to the market changes, accounting for the inuence of most relevant factors. However, as in any adaptive strategy, this response may be slightly delayed. It can also be seen that there are different strategic behaviors over time. For example, at the beginning of the period, there are many hours in which the DM coefcient is under 0.07, meaning that most of the forecasted energy must be bought in the subsequent markets, in particular in IM1 and IM3. Around the middle of the period, it becomes protable to buy extra energy in IM1, which is sold in IM3, and near the end of the period, for some hours, it also becomes protable to buy extra energy in DM, and IM1, which is sold again in IM3. VII. CONCLUSIONS This paper provides a novel and practical methodology for determining the optimal short-term demand-side bidding in an electricity market with various trading oors, such as a dayahead market and several intraday markets. It implements a genetic algorithm to nd the proportion of load to be submitted to each market for minimum purchase costs. The genetic algorithm performs global searches and has proved to be very effective in solving the problem faced, whereas conventional optimization techniques are much more difcult to apply to these types of nonlinear complex problems. The moving window of residual supply curves used to t the optimal strategy gives a dynamic perspective of the bidding problem and provides the necessary adjustments to the evolution of the market. This allows the retailer to dynamically adapt his strategy to his competitors behavior by learning from his recent past. The results obtained show evidence of arbitrage opportunities in the Spanish electricity market for an incoming buying agent. However, to effectively benet from these opportunities, the proposed methodology models how the agents own strategic behavior modies the market price. In this sense this methodology shows the level of market maturity or equilibrium. The analysis of the case studies makes it possible to conclude that the strategy designed is effective, feasible and robust in

much closer DM and IM market prices for each set of hours, logically reducing further arbitrage opportunities. Table V shows the energies bought in each market for both the optimal and strategies (positive sign indicates energy purchasing, while negative indicates selling). For the sets S1 and S2, the retailer nishes with a long position because of the lack of liquidity in the market. In particular, in S2 the retailer has, for some days, bought too much energy in the DM and the IM1 that it cannot sell in the IM2 and IM3. However the penalty applied [the excess of nal cleared energy with respect to the initial forecast is sold at 0 /MWh; see (5)] is compensated by the prots this strategy brings on other days of the moving window. With the proposed methodology, the retailer tends to purchase the energy in the cheapest markets, taking into account how his own strategy affect their nal prices. Indeed if all the energy is purchased in the cheapest market, its price will increase due to a larger demand, and could become higher than for other markets. In this sense, for S2 it can be seen that it is worth purchasing most but not all the energy in the IM1, which is initially the cheapest one. Finally, Fig. 4 shows the evolution of the coefcients of the S2. For each market , coefcients correspond to the proportion of bought energy after this market with respect to the total energy to be bought, provided that liquidity holds. It can be seen that the coefcients show signicant variations over the whole period, reecting the market evolution, although they



achieving the minimum cost of purchasing energy under the assumptions considered, even if the market behavior evolves over time. Although this methodology has been developed for demandside bidding, it could also be applied for supply-side bidding, especially for renewable technologies with negligible marginal cost. Future research could focus on monitoring the strategic decision variables to detect and interpret changes in the market and in the competitors strategies, and applying this methodology to measure the degree of market equilibrium or arbitrage opportunities. Finally a comparative study of different GA encodings and evolving strategies could improve the optimization performance for its practical implementation. APPENDIX This Appendix describes an alternative nonlinear and mixed Boolean mathematical programming model equivalent to (14)(20) for obtaining the optimal purchasing strategy of the retailer under study. The mathematical formulation of the model is as follows:



of the residual offer curve if . Finally, constraints (28), (29), and (30) are the same linear conditions of (11), (13), and (7) respectively. Note that the objective function is nonlinear and even nonand the optimal purchase convex since the marginal price are both decision variables (see for example [24] and [27]). In the case study of this paper every day strategy computation involves 614 250 binary variables (675 hours in all markets by 5 weeks by 182 samples for each residual offer curve). If the problem is solved separately for each , the number of binary variables is shown in Table VI. The nonlinearity of the objective function and the large number of binary variables seriously complicate the use of commercial optimization software such as CPLEX, which is unable to nd the solution. This is due to the fact that CPLEX is more suited for linear problems but performs very poorly . In [13], [24], when the number of binary variables exceeds and [28], the bidding and residual demand curves are approximated with piecewise linear functions to simplify the proposed electricity market model. Although a similar approach could be applied here for the residual offer curve modeling, a large number of binary variables would still be needed. REFERENCES
[1] A. Ballo, S. Cerisola, J. M. Fernndez-Lpez, and R. Bellido, Strategic bidding in electricity spot markets under uncertainty: A roadmap, in Proc. IEEE Power Eng. Soc. General Meeting, 2006, pp. 18. [2] Y. G. Rebours, D. S. Kirschen, M. Trotignon, and S. Rossignol, A survey of frequency and voltage control ancillary servicesPart I: Technical features, IEEE Trans. Power Syst., vol. 22, no. 1, pp. 350357, Feb. 2007. [3] A. J. Conejo, F. J. Nogales, and J. M. Arroyo, Price-taker bidding strategy under price uncertainty, IEEE Trans. Power Syst., vol. 17, no. 4, pp. 10811088, Nov. 2002. [4] C. P. Rodriguez and G. J. Anders, Bidding strategy design for different types of electric power market participants, IEEE Trans. Power Syst., vol. 19, no. 2, pp. 964971, May 2004. [5] J. Garca-Gonzlez, J. Romn, and J. Barqun, Strategic bidding in deregulated power system, in Proc. 13th Power Syst. Computation Conf., Trondheim, Norway, 1999, pp. 258264. [6] A. Mateo, E. F. Snchez-beda, A. M. S. Roque, J. Villar, A. SaizChicharro, J. T. Abarca, and E. Losada, Strategic bidding under uncertainty using genetic algorithms, in Proc. 6th Int. Conf. Probabilistic Methods Applied Power Syst., Funchal, Portugal, 2000. [7] A. J. Conejo, J. Contreras, J. M. Arroyo, and S. D. L. Torre, Optimal response of an oligopolistic generating company to a competitive poolbased electric power market, IEEE Trans. Power Syst., vol. 17, no. 2, pp. 424430, May 2002. [8] S. de la Torre, J. M. Arroyo, A. J. Conejo, and J. Contreras, Price maker self-scheduling in a pool-based electricity market: A mixedinteger LP approach, IEEE Trans. Power Syst., vol. 17, no. 4, pp. 10371042, Nov. 2002. [9] J. Contreras, O. Candiles, J. I. de la Fuente, and T. Gmez, A cobweb bidding model for competitive electricity markets, IEEE Trans. Power Syst., vol. 17, no. 1, pp. 148153, Feb. 2002. [10] V. P. Gountis and A. G. Bakirtzis, Bidding strategies for electricity producers in a competitive electricity marketplace, IEEE Trans. Power Syst., vol. 19, no. 1, pp. 356365, Feb. 2004.


(25) (26)


(28) (29) (30)

(31) Equation (23) minimizes the total cost of purchasing the enfor all the sets , taking into account ergy over the markets the imbalance costs of (6). Constraints (24)(26) represent the if the purchased energy residual offer curve, being is in the interval of this curve ( is a very small positive parameter). Constraint (27) models the re, being the marginal price sulting marginal price



[11] T. L. M. Shahidehpour and Z. Li, Risk-constrained bidding strategy with stochastic unit commitment, IEEE Trans. Power Syst., vol. 22, no. 1, pp. 449458, Feb. 2007. [12] F. Wen and A. K. David, Optimally co-ordinated bidding strategies in energy and ancillary service markets, Proc. Inst. Elect. Eng., Gen., Transm., Distrib., vol. 149, pp. 331338, 2002. [13] A. Ballo, M. Ventosa, M. Rivier, and A. Ramos, Optimal offering strategies for generation companies operating in electricity spot markets, IEEE Trans. Power Syst., vol. 19, no. 2, pp. 745753, May 2004. [14] A. Ugedo, E. Lobato, A. Franco, L. Rouco, J. Fernndez-Caro, and J. Chofre, Strategic bidding in sequential electricity markets, Proc. Inst. Elect. Eng., Gen., Transm., Distrib., vol. 153, pp. 431442, 2006. [15] J. Garca-Gonzlez, A. M. S. Roque, F. A. Campos, and J. Villar, Connecting the intraday energy and reserve markets by an optimal redispatch, IEEE Trans. Power Syst., vol. 22, no. 4, pp. 22202231, Nov. 2007. [16] S. E. Fleten and E. Pettersen, Constructing bidding curves for a price-taking retailer in the Norwegian electricity market, IEEE Trans. Power Syst., vol. 20, no. 2, pp. 701708, May 2005. [17] H. Yan and H. Yan, Optimal energy purchases in deregulated California energy markets, in Proc. IEEE Power Eng. Soc. Winter Meeting, 2000, pp. 12491254. [18] Y. Liu and X. Guan, Purchase allocation and demand bidding in electric power markets, IEEE Trans. Power Syst., vol. 18, no. 1, pp. 106112, Feb. 2003. [19] C. A. Daz, J. Villar, F. A. Campos, and J. Reneses, Electricity market equilibrium based on conjectural variations, Elect. Power Syst. Res., vol. 80, pp. 15721579, Dec. 2010. [20] A. B. Philpott and E. Pettersen, Optimizing demand-side bids in dayahead electricity markets, IEEE Trans. Power Syst., vol. 21, no. 2, pp. 488498, May 2006. [21] C. W. Richter and G. B. Sheble, Genetic algorithm evolution of utility bidding strategies for the competitive marketplace, IEEE Trans. Power Syst., vol. 13, no. 1, pp. 256261, Feb. 1998. [22] Market Operator of Electricity Market of the Iberian Peninsula, OMEL. [Online]. Available: http://www.omel.es. [23] Transmission System Operator of the Iberian Peninsula, Red Elctrica de Espaa, S.A., Sistema de Informacin del Operador del Sistema (esios). [Online]. Available: http://www.esios.ree.es. [24] A. Ballo, A methodology to develop schedules and offering strategies for a generation company operating in a short-term electricity market, Ph.D. dissertation, Univ. Ponticia Comillas, Madrid, Spain, 2002. [25] E. G. David, Genetic Algorithms in Search, Optimization and Machine Learning. Reading, MA: Addison-Wesley, 1989. [26] M. Stone, Cross-validatory choice and assessment of statistical predictions, J. Roy. Stat. Soc. B. Met., vol. 36, pp. 111147, 1974. [27] J. Garca-Gonzlez, J. Barqun, and J. Romn, Building supply functions under uncertainty for a day-ahead electricity market, in Proc. 6th Int. Conf. Probabilistic Methods Applied to Power Systems, Funchal, Portugal, Sep. 2000, pp. 2528. [28] J. M. Fernndez-Lpez, A. Ballo, S. Cerisola, and R. Bellido, Building optimal offer curves for an electricity spot market: A mixed-integer programming approach, in Proc. 15th Power Systems Computing Conf., Lige, Belgium, Aug. 2226, 2005.

Roco Herranz received the Industrial Engineering degree in 2008 and M.S. degree in electric power in 2010 from the Universidad Ponticia Comillas, Madrid, Spain. She has been a research assistant at Instituto de Investigacin Tecnolgica (IIT) of Universidad Ponticia Comillas since 2008 to 2011. Her areas of interest include modeling and simulation of the electricity market, the application of articial intelligence techniques, and time series forecasting.

Antonio Muoz San Roque received the Industrial Engineering degree in 1991 and the Ph.D. degree in industrial engineering in 1996 from the Universidad Ponticia Comillas, Madrid, Spain. Currently, he is with the research staff at the Instituto de Investigacin Tecnolgica and he is a lecturer in analog electronics at the ICAI School of Engineering. His areas of interest include the application of articial intelligence techniques to the monitoring and diagnosis of industrial processes, nonlinear system identication and time series forecasting, analog electronics, and digital signal processing.

Jos Villar received the degree in electronic engineering in 1991 and the Ph.D degree in 1997 from the School of Industrial Engineering (ICAI) at the Universidad Ponticia Comillas, Madrid, Spain. Since 1997, he has been a Researcher at the Instituto de Investigacin Tecnolgica of ICAI, and teaches electronics in its Electronic Department. His areas of interest include the application of advanced techniques such as knowledge based systems, soft computing, intelligent information systems, and data mining to very different areas such as online monitoring and diagnosis of industrial processes, or operation and planning in competitive electricity markets.

Fco. Alberto Campos received the degree in mathematics in 1999 from the Universidad Complutense de Madrid, Madrid, Spain, and the Ph.D. degree in industrial engineering from the Universidad Ponticia Comillas, Madrid, in 2006. Currently, he is Research Fellow at the Instituto de Investigacin Tecnolgica. His areas of interest include the application of possibilistic Nash games, simulation and risk analysis techniques to the operation and planning of electric power systems.