Negative selection—a new performance measure for automated order execution

Automated Order Execution is the dominant way of trading at stock markets. Performance of numerous execution algorithms is measured through slippage from some benchmark. But measuring true slippage in algorithmic execution is a difficult task since the execution as well as benchmarks are function of market activity. In this paper, we propose a new performance measure for execution algorithms. The measure, named Negative Selection, takes a posterior look at the trading window and allows us to determine what would have been the optimal order placement if we knew in advance, before the actual trading, the complete market information during the trading window. We define the performance measure as the difference between the hypothetical optimal trading position and the actual execution. This difference is calculated taking into account all prices and traded quantities within the considered time window. Thus, we are capturing the impact caused by our own trading as a cost that affects all trades. Properties of Negative Selection, which make it well defined and objective are discussed. Some empirical results on real trade data are presented.


Introduction
Automated Order Execution is the dominant way of executing orders at major stock markets [1,6,8,9,12,14]. There is a variety of algorithms that are designed to serve different purposes and trader preferences. In Automated Order Execution a computer-based algorithm is used to buy (or sell) a position while attempting to achieve a benchmark specified by a client. Therefore the specified benchmark, i.e., the slippage to benchmark is used as a measure of execution performance. It is undoubtedly difficult to define one standard measure for all order executions and all trading objectives as they can be very different and orders often come with many constraints. There are many types of benchmarks, some are established before the trading process, like Arrival Price, AP, others are established during the trading process like Volume Weighted Average Price, VWAP, some quantify delays or measure the performance with respect to the closing price etc.
The most important performance measures are the slippage to VWAP and Implementation shortfall (IS) [13] based on Arrival Price. Both measures are widely used in practice and represent the standard in the financial industry. Their properties are the subject of many academic studies and a number of algorithms are developed in order to minimize the slippage to VWAP and AP, [2,3,5,7]. One of the problems with measuring slippage, whether it is VWAP or IS, is that they either distort the slippage measure or do not reflect the true nature of slippage. In the case of VWAP, by its own definition, this measure distorts slippage with increasing order size due to the impact caused by one's own orders. Although a good algorithm, the slippage measure is fundamentally flawed for large order size In the case of the other equally dominant benchmark, IS, with Arrival Price as the reference price, although it is unbiased in terms of measuring slippage caused by price drift and market impact, it does not reflect the true slippage due to its reference to a static price (AP). In other words, it does not capture the nature of absolute slippage. Consider the scenario where a buyer has to complete an order. Denote by t 0 the time when the buyer enters the market. If the price drifts up during the execution, the average execution price will be much higher than the reference price at t 0 . This slippage is then naturally expected to be relatively high due to the difficult market conditions. If however the price drifted downwards by the same amount and the entire order quantity was on the best bid at t 0 and stayed there, the slippage would remain constant, representing the difference between the best bid price and Arrival Price. Although the slippage in the latter scenario is low, the IS slippage measure relative to the fixed reference price does not reflect how much better we could have done. In an easy market condition like the case of falling price, intuitively, one may have expected to get negative slippage. However, the IS measure does not reflect this.
Hence the need for an absolute performance measure. The performance measure which we propose in this paper aims at providing an alternative way of measuring the performance of execution algorithms. The measure takes a posteriori view of market conditions and its main characteristic is that it is completely objective. Roughly speaking, a posterior approach allows us to determine what would have been the optimal order placement if we knew in advance the complete market information during the trading window. If the complete market information would have been known one could have placed the order in a way that ensures the lowest possible execution price. Such order placement is called optimal in the sequel. Thus, we define the performance measure as the difference between the optimal trading position and the actual execution. The difference is calculated taking into account all traded quantities and all prices within the considered time window. This way, we are capturing the impact caused by our own trading as a cost that affects all trades, including our own and avoid the main problem with VWAP in the case of large trades [4,[8][9][10]. On the other hand the measure reflects toughness of the market condition during the execution and avoids the drawback of IS mentioned before.
Let us briefly explain the term Negative Selection. In execution, more specifically with regard to price movements, one does not want to get filled when the price comes one's way as the price may keep heading in that direction. In this case, it may be better to become more passive and hope to get a better price. Hence one's order being "selected" or "executed" is basically a sub-optimal execution. Negative Selection is an evolved term used to distinguish itself from the original concept in economics, namely adverse selection, referring to skewed and undesirable results due to asymmetry in information held by negotiating parties. In the case of a buyer and seller, asymmetric information in market direction will lead to the one with information edge benefitting from a transaction on the expense of the other.
Given a single buy order with a specified quantity Q and a time window [0, T] for the execution, we define the optimal placement of the order as a solution of Linear Programming, LP, program. The unknowns of the LP are quantities placed at specific price levels, which add up to Q and would have yielded the lowest possible price during [0, T], if we knew all market conditions during the trading window in advance. Thus the optimal placement is a vector calculated after the trade window [0, T]. The Negative Selection is then defined as the distance between the actual trade, represented by the vector with a single nonzero component, and the optimal placement.
Any performance measure has to have several important properties. First of all, it should be able to distinguish clearly between filled and partially filled orders as well as between orders filled at different price levels. Furthermore, the performance measure needs to possess continuity in the sense that a negligible change in the order size or in the fill price should yield negligible changes in the performance measure. Perhaps the most important property of a performance measure is that it should reflect the toughness of market condition at a particular time window and thus allow one to judge the quality of execution. We will show later on that the performance measure proposed in this paper possesses all of these qualities.
The key contribution of this paper is the very definition of Negative Selection. Although the mathematical tools used in definition and calculation of NS are rather simple, linear programming and vector norm, the obtained measure is a powerful tool for measuring the performance of trading algorithm, given that it takes into account complete market activity within the trading window, provides absolutely objective measure of the quality of execution and possesses desirable qualities like continuity with respect to order size. This paper is organized as follows. In Sect. 2 we define Negative Selection for a single (market or limit) order. All statements are given for the buy side to simplify the presentation and the sell side is completely symmetric. Then we define the Negative Selection of a complex order consisting of several positions-both passive and aggressive. Some empirical properties of Negative Selection are discussed in Sect. 3. We consider a black box trading strategy to measure the quality of different execution algorithms using Negative Selection. The results are compared with VWAP and IS as performance measures. Some conclusions are drawn in Sect. 4.

Negative selection
The definition of Negative Selection is given here assuming that we have to buy Q shares either by placing a single market order or taking a passive position at some of the bid levels. For the opposite case, selling Q shares, the definition is completely symmetric. We consider a market governed by the limit order book implying that the orders are placed in queues by price and arrival time priority. Next, let us assume that the buy order of the size Q has to be executed within the time window [0, T]. At t = 0 the following information is available.
The price vector is P = [P 0 , P 1 , . . . , P k ] T , with P 0 being the price for market orders (i.e. the ask price at t = 0), and P 1 , . . . , P k being the bid prices at the corresponding bid levels. Clearly P k < P k-1 < · · · < P 1 < P 0 . In the sequel we use the short notation bid1, . . . , bidk and the corresponding ask notation to denote the sequence of bid and ask prices. Thus in the vector P above we have P 0 as ask1 price, i.e. the smallest ask price, P 1 is called bid1 price and so on. The volume ahead, represents the sizes of the existing orders in the corresponding bid queues at t = 0. We will assume that V 0 = 0, so a market order with price P 0 is immediately traded.
The gain coefficients are defined as Clearly, 0 = g 0 < g 1 < · · · < g k . We consider first a simple order of size Q, which can be placed either as the market order or as a passive order at some bid level at the end of the existing queue. We are assuming that Q is small enough so it can be traded as a simple order, at a single price level. Later on, we will discuss the case of larger Q, when one splits the quantity into several smaller orders to be executed within the trading window [0,T]. For technical reasons it is more convenient here to define the order vector The order vector will have the following property Q m = Q for some m ∈ {0, 1, . . . , k} and Q j = 0, j = m, j = 0, 1, . . . , k.
At the end of the trading window, at t = T some additional information are available. The traded quantity during (0, T] at every price level is represented by and we assume that T 0 ≥ 0Q,. i.e., there has been enough liquidity so the market order could have been filled at P 0 . To avoid technical difficulties we assume slightly stronger condition, T 0 > Q from now on. The available quantity now is defined as The assumption T 0 > Q implies that the set of indices is nonempty. So, the buy order Q could have been completely filled during [0, T]. In other words, we are assuming that the order size Q is up to some percentage of the average traded volume within [0, T]. Denote further by l = max{i : i ∈ I L }. We also define the set of indices This set is nonempty and let h = max{i : i ∈ I H } be its maximal element.
We are now in position to define the optimal placement. It is defined afterwards, i.e., at t = T when all of the above vectors are available. The optimal placement represents the best we could have done at t = 0 to execute the order during [0, T], if we knew in advance, at t = 0 all information for the trading time interval. In other words, the optimal placement represents the perfect scenario that would have allow us to execute the order with the lowest possible price. So, let us denote the optimal placement as With this notation we are assuming that the quantity O 0 has been traded as a market order, O 1 has been placed at the first bid level and so on. Since the objective is to buy Q shares at the lowest possible price, the optimal placement is a solution of the following Linear Programming Problem.
subject to Let us briefly explain the objective function and the constraints above. The objective function states that we want to minimize the total cost of buying k i=0 O i = Q shares at prices levels P 0 , . . . , P l . The first constraint states that the quantity we want to buy is equal to Q. The second constraint specifies that we can buy only the available quantities at each price levels. But it is slightly more sophisticated that simply stating O i ≤ A i due to the price-queue priority execution of the market order book. The following toy example shows that filling the available quantities from below does not yield the smallest price for the total order of Q shares. Assume that order with Q = 10 is submitted at price 99.0 and we have ask1 and three available bid levels with the price vector At t = T the traded volume is T = [80, 50, 10,9] T , so the available quantity is defined as If one considers the positions obtained by filling from below i.e. by taking the available quantities from the lowest price up until Q is reached, such order would be [5, 0, 0, 5] T and the price of buying 10 shares with such order would be (5 · 98.5 + 5 · 100)/10 = 99.25. On the other hand, solving the LP above one gets the optimal order as O = [1, 0, 9, 0] T and its price is (9 · 99 + 1 · 100)/10 = 99.1. In other words, if we had submitted the order O at t = 0 to the existing queue, then our 9 shares placed at bid2 would have been traded before the 4 shares at bid3 due to price-time priority of the order book. Thus, the traded volume would have changed and our order would have been executed with the average price of 99.1. Hence the optimal placement i.e. the lowest price is not achieved by filling from below. This fact motivated the definition above and is a consequence of price-order trading mechanism.
The statement below claims that the LP (3)- (6) has an unique solution and its proof is given in Appendix.

Theorem 1 The vector given by
is the unique solution of (3)- (6).
From now on we will refer to the vector (7)-(10) as the optimal placement. We are now ready to define the performance measure.

Definition 1
For an order with the size Q at the price level P m and execution time window [0, T], Negative Selection is defined as where O is the optimal placement vector, Q is the order vector and G is the vector of gain coefficients defined by (1).
The following properties of Negative Selection make it a well defined performance measure with desired qualities, namely objectivity and continuity.

Theorem 2
The following properties hold: (a) Negative Selection of an optimally placed order is zero. (2) If the larger order is unfilled then Proof See Appendix.
Remark It is important to point out that Negative Selection is not a predictive model. Instead, it is a post-trade measurement model that analyses one's own trading decisions to the activity of market for a specific security. At its core, this retrospective analysis observes the state of the orderbook for a given stock before a trading commences and quantifies whether the trading decisions were optimal with respect to the options available at t 0 and the market trading activity that followed.
When placing a buy order, one is faced with the dilemma of being aggressive and cross the spread to buy at the prevailing asking price or take the chance of a better price by bidding at some bid price. In a rising market, a passive order at the best bid at t = 0 will remain unfilled which would lead to chasing the market to get filled, and yield a larger slippage than the slippage obtained by crossing the spread at t = 0. While in a sideways market, one is likely to save the spread cost by being passive. In the case of a falling market, a buyer is considered too aggressive if the entire order is placed at the best bid since one would achieve a better average price by having placed it at an even more passive price level. However, in the latter case, the probability of fill decreases significantly with more passive orders. Therefore, there is a need to split the orders into multiple price levels.
Let us now define Negative Selection for an order distributed across multiple price levels. Assume that the buy order for Q shares is allocated as the market order for Q 0 and a sequence of passive orders Q 1 , . . . , Q k at the corresponding bid levels i = 1, . . . , k. Clearly Q i ≥ 0, i = 0, 1, . . . , k and k i=1 Q i = Q. We can represent this multilevel order for buying Q shares as Each component of this vector S has its own (simple) order vector as defined by (2) i.e.
For each component of the vector in (13) we can calculate Negative Selection, N i as stated above. Then, Negative Selection for the complex orders is defined as the vector Naturally, we can compute the norm of N (S) and define it as a performance measure suitable for comparison of different strategies if needed. Unlike the case of simple order, here exists a certain interaction between the optimal placements for simple orders at different price levels i.e. one must take into account one's own trading.

Empirical results
In this Section, we demonstrate some basic properties of Negative Selection using real trade data. The test data consists of tick data for Vodafone Group ( One of the principal advantages of the NS as a performance measure is that it reflects the toughness of market at any given time. To demonstrate this property we compare the behaviour of NS, VWAP and IS benchmarks in both falling and rising markets. A simple example is considered. We place an order at the best bid level until filled or the time of 10 minutes expires. If the order is not completely filled within 10 minutes, the residual is filled by crossing the spread at the end of given time window. For this simple trading strategy a sequence of orders with increasing sizes, from 0 to 35% of average traded quantity in the selected time window is tested. The average traded quantity for AZN is 50,000 shares in 10 minutes so the simulations are performed for orders of size 1 to 17,500 shares with the step size of 500 shares. The 10 minutes windows are chosen randomly. The relevant trajectories for AZN are shown at Fig. 1 and Fig. 2. The price trajectories are shown at the left-hand side pictures while the right-hand side pictures show the slippages with respect to all three benchmarks at both Figures. The horizontal axis shows the traded amount in thousands. Figure 1 shows the case of falling market. The slippage to VWAP is positive and decreasing with the increase of order quantity. Being positive gives the true information of the execution strategy, but the decrease with respect to traded quantity is actually a false information. The decreasing slippage implies that the execution strategy is good, although it is quite clear that in the failing market one should have placed orders at lower price levels. This decrease in the slippage is a consequence of the already mentioned VWAP flaw -the slippage is decreasing due to the impact of large traded quantity. With IS, the situation is different: the slippage is negative and constant. Its value is the difference of Arrival Price and the best bid price at the beginning of the time window. The negative sign of slippage here gives again a false information on the execution performance as a consequence of insensitivity of Arrival Price to the market conditions in the trading time window. The Negative Selection is increasing with the order size and providing the correct information: the execution is too aggressive and gets worse with the increase of the order size.
In the rising market shown in Fig. 2, an order placed at the best bid can be regarded as passive. If the order is not filled, it will result in crossing the spread at the end of the time window and paying a higher price. The slippage to VWAP is positive because the order is filled at a price higher than the benchmark. But again, we see the decrease in the slippage with the increase of the order size, giving the false impression that the execution strategy is actually improving with the order size. The slippage to Arrival Price is high and positive. It is constant while there is enough liquidity, but when the order size increases enoughabove the quantity available at the best ask, the order starts to "walk the book" and the slippage to Arrival Price rises. Whereas, Negative Selection is negative and increasing with the order size. Thus the information we get is correct-the execution strategy should have been more aggressive.
To demonstrate some properties of NS empirically, we consider a sequence of orders generated by a Black Box, BB trading strategy with inventory. It is a momentum trading strategy generating signals using a mathematical model. The common parameters of a BB trading strategy are time execution window, cancel threshold and order size. A combination of the time window width and the cancel threshold are used as the cancellation criterion: an order is canceled if either time expires or the cancellation threshold is reached. Therefore, there are only two possibilities: an order is (partially or completely) filled or canceled within the time window. The algorithm keeps track of open position, i.e., all positions are closed with the opposite operation (buy/sell). For example, let us fix the order size to 100 shares. The first signal is to buy, and assume that 85 shares are bought until the cancel threshold is reached (or the execution time expires). The open position is now 85 shares. The second signal is sell and thus we want to sell 100 + 85 = 185 shares, and so on. The BB parameters are selected as follows: the time window T is 10 minutes and the cancel threshold is 45bps. The tested order sizes vary from 1% and 5% of average traded volume in the time window, which is approximately 40,000 to 200,000 shares for Vodafone, 500 to 2500 shares for AstraZeneca, 3000 to 15,000 for Barclays PLC, 420 to 2100 shares for Sanofi SA, respectively.

Figure 2 VWAP, Arrival Price and Negative Selection for rising market
In addition to the BB trading strategy, we also consider the so-called Default, D, strategy which is formulated as the alternation of buy and sell signal every 10 minutes. When producing signals, the strategy does not take into account the actual market conditions. But like BB, it obeys rules regarding the possible cancellation of an order. As the quality of signals, in terms of profitability, is quite random, the purpose of D strategy is to give us the baseline for market conditions during the observed period. The D strategy, in fact, reflects the toughness of the market as it landscapes the data.
The properties of D and BB are presented in Table 1. The dollar sign represents monetary units. We report the results for three price levels; thus bid/ask1 means that we place orders at the best bid and ask level, while bid/ask2 and bid/ask3 mean that the orders are places at the second and third price level respectively. The tested order size is 5% of the average traded volume in the time window. For each price level and both BB and D strategy we report several results: the total number of triggers (Trig), the total number of trades (Trad) percentage of profitable days (Pday), the profit in thousands (P), then the slippage to VWAP in basis points (VWAPs), the ratio of win and loss trades in monetary units (W/L$), the average profit per trade in monetary units (AP$) and the percentage of profitable trades (PT). Clearly, the BB strategy has short-term alpha and can generate profit. The D strategy is obviously losing money. Table 2 contains the simulation results for the BB strategy. We tested two order sizes and five order placement positions, for all four stocks, across the whole data set. The order sizes were 1% and 5% of average traded quantity in 10 minutes intervals. The placement positions include all five bid/ask positions. In other words, for a buy signal we considered placing the order at bid1, bid2,. . . ,bid5 and analogously for a sell signal. The mean values across the whole data set are given in Table 2. One can easily see that the theoretical properties stated in Theorem 2 are empirically confirmed. For all stocks, NS of the smaller order (1%) is smaller than the Negative Selection of the larger order (5%). Furthermore,  as the trading becomes more passive the Negative Selection is becoming more negative. The actual mean values of NS vary quite significantly between four considered stocks. In other words, Negative Selection indeed captures the true properties of the market. VOD is the most liquid stock with the widest spread (21.65bps) in this data sample-trading takes place at bid1 and ask1 for an extended period followed by a shift in price to the next price level or a few price levels above/below and repeat the bid/ask bouncing. Unlike VOD, AZN is the least liquid stock with the smallest spread (6.42bps). AZN price tends to trade in a narrow price channel e.g. going from bid1 to bid3 and then bounce back and repeated the process, with a different price trajectory. Such behaviour justifies the fact that VOD has the best performance, in terms of profits and NS, at bid/ask1 and for AZN we see the same at the second price level, bid/ask2. More detailed results for the first three bid/ask levels are given in Table 3, where we report the mean values of NS, the standard deviation, the coefficient of variation and the median values of NS. Again, the results are in line with theoretical properties. In this table we also included mean values of the needed to fill an order, T fill and the cancelation time, T cancel . Recall that cancellation is due either to the expiration of the execution time (in that case T cancel = 10 minutes) or to the price movement i.e. reaching the price threshold (so T cancel < 10 minutes). Figure 3 illustrates the property of NS described in Theorem 2(d) for VOD. A random sample of triggers is used. Orders of 5% of the average traded quantity are placed at five price levels, from bid/ask1 to bid/ask5. Similar results are obtained for the other shares, AZN, BARC, and SASY. Clearly, the Negative Selection behaves as stated in Theorem 2(d), being more negative as the order placement is more passive.
When an order is filled we notice that passive orders have absolute NS lower than aggressive, because the price went in our direction affecting optimal placement to be passive. This way passive orders were "awarded" by the smaller value of NS, i.e. they were closer to the optimal placement. In the opposite case, when for example for all bid levels the order was unfilled, for each level NS is negative, but the best bid order has the lowest absolute value. This reflects the fact that the price went in the adverse direction, so the best strategy was to trade aggressively i.e. more passive orders were undesirable. Figure 4 illustrates Theorem 2(e). We are interested in NS for the orders at the same price level but of different size. Again, we consider two order sizes, 1% and 5% of the average traded quantity. Clearly, if there was enough liquidity to fill the larger order, then there was enough liquidity to fill the smaller one. In this case, NS of larger order dominates the NS of the smaller order, which enable us to capture the impact caused by our own trading. It also indicates that in the situation when the price is going in our direction, both orders will be filled at an unfavourable price, but the effect is larger for the large order, i.e., the overall costs are larger for suboptimal large order than the cost of a suboptimal smaller order. On the other hand, if the larger order is unfilled, there are two possibilities: First, the smaller order is filled i.e. there was enough liquidity to fill the smaller one, but not enough to fill the larger. Hence, the smaller order has nonnegative NS, while the large order has negative NS. In the second case, the smaller order is also unfilled. Then, both orders have negative NS, with the larger order being more negative. Obviously, the strategy was too passive for the smaller order, but for the larger order, there is an additional cost for passive Figure 3 Comparison of Negative Selection for VOD by price levels behaviour, as filling the larger order, when the price is going away from us, requires more aggressive behaviour. Figure 5 represents the relative distribution of Negative Selection for the best bid/ask of BB strategy. For more liquid stocks, Vodafone and Barclays, BB strategy has positive Negative Selection for bid/ask1, and negative for bid/ask2. This indicates that price was trending in an adverse direction so the aggressive strategy was more profitable. Moreover, trading at bid/ask2 and especially at bid/ask3 level, because of passive behaviour we were exposed to the cost of crossing the spread. For less liquid stocks AstraZeneca and Sanofi trading at bid/ask1 resulted in positive Negative Selection, which means that with aggressive trading, a majority of orders were filled at the unfavourable price, while at bid/ask2 BB has slightly positive Negative Selection that implies that it was more profitable. At bid/ask3 we see that the strategy is too passive resulting in less profit.
The distribution of Cancel Time and Fill time for the same sequence of orders is depicted on Fig. 6. Cancel Time corresponds to points with negative Negative Selection, while Fill time is on the nonnegative side of the axis. Basically, this is a consequence of Theorem 2(a)-(c), because filled orders have nonnegative NS, while unfilled orders have negative NS. Time limit for all orders was T = 10 minutes causing a grouping of cancel time data at the 10th minute.

Conclusion
We presented Negative Selection as a post-trade performance measure for execution algorithms. It is based on the concept of Optimal Placement-the placement at t = 0 that   Properties of Negative Selection are tested using a simulator built in Matlab and MySQL, on real trade data for three liquid stocks from London Stock Exchange and one stock from Euronext. The obtained empirical results are aligned with the theoretical expectations and demonstrate the ability of Negative Selection to capture all important properties of a trading strategy. The comparison between NS and two main benchmarks, VWAP and IS are also presented.
Consider the following linear programming problem, minimize c T x, where

Theorem 1 ([11])
A solution x * of linear programming problem (14) is unique if and only if it remains a solution to all linear programs obtained from (14) by arbitrary but sufficiently small perturbation of its cost vector c, or equivalently for each q ∈ R n there exist a positive real number such that x * remains a solution of the perturbed linear program minimize (c + q) T x, Proof of Theorem 1 Given that A j = 0 for j = l + 1, . . . k, constrains (5)- (6) imply O j = 0 for j = l + 1, . . . k. Thus (10) holds. So, it is sufficient to consider the following problem The standard form of (16)-(19) is the following Recall that I L = {j : A j > 0, j = 1, . . . , k}, l = max{i : i ∈ I L }, I H = {j : l i=j A j ≥ Q, j = 0, 1, . . . , l} and h = max{i : i ∈ I H }.
The following vector v is a basic solution of (20), with the basis matrix B and the non-basis matrix N Here, U(c) is an upper triangular matrix with all nonzero elements equal to c, L(c) is a lower triangular matrix with all nonzero elements equal to c, 0 is the zero matrix, and 1 has elements equal to 1, E is the identity matrix. As the inverse of B is   is an optimal solution of (16)-(19) and the optimal solution of (3)-(6) is indeed given by (7)- (10).
The uniqueness will be proved using Mangasarian's result [11], Theorem 1 above. Let q ∈ R l+h+1 be an arbitrary vector. We will show that there is positive number > 0 such that the vector v, defined in (21), remains a solution of perturbed problem minimize (c + q) T x, The vector v is a basic solution of the problem (22), and the reduced costs for (22) are O j = P h + q h -(P j + q j ) = P h -Pj + (q hq j ), j = 0, . . . , h -1, d j = (P j + q j ) -(P j-1 + q j-1 ) = (P j -P j-1 ) + (q jq j-1 ), j = h + 1, . . . , l.
This means that v is an optimal solution of (22). (c) If the order is unfilled at level m then m ≥ l. Assume that m < l. Then P m > P l and as A l > 0, it is clear that there has been some trading at the level l. Therefore, the price decreased from P m to P l . But that further implies that all orders at the price P m were filled, which is in contradiction with the assumption m < l. Thus,