SlideShare a Scribd company logo
FS_ALGO#1401 VWAP Customizations -
Order Logic on Best Quantities
FS Number FS ALGO#1401
Client BROKER
DU Business Analyst Milton Ko
Date 10/12/2014
Internal Enhancement
Reference(s)
Page 1 of 17
Revision history
Version Date Description By
0.1 10/12/2014 Initial version Milton Ko
0.2 19/12/2014
Corrected some typos and added page
numbers Milton Ko
0.3 29/12/2014
Modified the definition of A’ and B’ in 1.3.1,
added section 1.3.2, and inserted scenarios
1(f), 1(g), 3(f) and 3(g) Milton Ko
Page 2 of 17
Contents
1 Business Requirements....................................................................................................................4
1.1 Background and Objective............................................................................................................4
1.2 Scopes.......................................................................................................................................... 4
1.3 Details and Definitions of the New Logic.......................................................................................4
1.3.1 The Logic of Order Placement................................................................................................5
1.3.2 The Maximum Possible Quantities A’ and B’..........................................................................6
1.4 Business Requirements................................................................................................................6
1.4.1 Requirement Catalogue..........................................................................................................7
1.4.2 Detailed Requirements and Scenarios...................................................................................7
1.4.2.1 Req001 – Add “Order Quantity Factor” and “Aggressive Time” for Input for Start-up......7
1.4.2.2 Req002 – Implement the Logic Stated in 1.3 as a Logic of Order Placement of VWAP...7
7
1.4.2.3 Req003 – VWAP Control Center Customization............................................................15
1.4.2.3.1 The Aggressive Time...............................................................................................15
1.4.2.3.2 Mode Button............................................................................................................15
1.4.2.3.3 Order Quantity Factor..............................................................................................15
1.4.2.3.4 Scenarios Induced by VWAP Control Center..........................................................15
2 Authorization of Business Requirement.......................................................................................17
Page 3 of 17
1 Business Requirements
1.1 Background and Objective
The algorithm VWAP in the automated trading platform of DECIDE aims at assisting traders to break
down large size orders into small trading orders and execute. The model used for breaking size orders
bases on historical data. The first VWAP version on the production of BROKER is 2.0.8, whose Go-Live
date was in April 2014. After over half a year of experience working with VWAP, BROKER has decided to
add in a customized trading logic regarding the order placement. This document means to specify this logic
and related definitions in a precise and closed way.
1.2 Scopes
The logic of order placement in the recent VWAP (referred as original logic hereafter) is logically closed
(including responses for all scenarios). The logic specified in this document (referred as new logic
hereafter) is an add-on to that. Any situation not described by the new logic will follow the original logic.
The scope of the customizations specified in this document includes:
1. the add-on logic described in Section 1.3;
2. the GUI requirements specified in Section 1.4.2.3 ;
Anything not included in the above 2 items is out of scope.
1.3 Details and Definitions of the New Logic
VWAP works on both buy and sell size orders. The new logic applies to both. Indeed, the new logic on
buy size orders is just the “reverse” of that on sell size orders. For the new logic, we need to introduce 2
new parameters entered by users:
1. Order Quantity Factor, denoted by c, a positive number;
2. Aggressive Time, denoted by T, with format HH:MM:SS (for example, 15:30:00).
There are a few more notations that we will need for the description of the logic.
3. the maximum quantity allowed for order placement by VWAP, denoted by M, set up in VWAP
Control Center.
4. the price at one tick below best ask, denoted by Pa. (In case when ask side is empty, Pa is the best
bid)
Page 4 of 17
5. the price at one tick above best bid, denoted by Pb. (In case when bid side is empty, Pb is the best
ask)
6. the quantity at the best ask and best bid, denoted by A and B respectively. (In case ask side is
empty, A = 0; in case bid side is empty, B = 0)
7. the maximum possible quantity in front of our VWAP order in the queue lining up at the price Pa for
buy size orders, and or at Pb for sell size orders, denoted by A’ and B’ respectively. The estimation
logic will be described in Section 1.3.2
8. the quantity of the order placed by VWAP at a moment, denoted by Q.
1.3.1 The Logic of Order Placement
Let us now describe the logic on buy size orders first. When the market is empty, no order is placed, as
the recent VWAP does. Suppose now the market depth is non-empty and a running VWAP places a buy
order, and the following logic is applied only when the current time is before time T, and the order is up at
the price Pa.:
(B1) When A<Q, the placed order stays at Pa and wait until any of the following is true:
(a) Someone fills the best ask with more quantities such that A ≥ Q. Then if (B2) is NOT true, VWAP
converges the order up to match at the best ask price; otherwise, follow the consequences of (B2);
(b) Someone executes this order partially at Pa, and Q decreases so that A ≥ Q. Then if (B2) is NOT true,
VWAP converges the partially matched order up to match at the best ask price.
(c) Someone fully executes the order at Pa.
(B2) When A' + Q ≤ cM, the placed order stays at Pa and wait until any of the following is true:
(a) Someone fully executes the order at Pa.
(b) The best ask increases, which means Pa increases. Then VWAP converges the order, either
unmatched or partially matched, up at the new Pa and repeat the same logic, (B1) and (B2), again.
Similarly, we describe the logic on sell size orders. Suppose now the market depth is non-empty and a running
VWAP places a sell order, and the following logic is applied only when the current time is before time T, and the order
is down at the price Pb.:
(S1) When B<Q, the placed order stays at Pb and wait until any of the following is true:
(a) Someone fills the best bid with more quantities such that B ≥ Q. Then if (S2) is NOT true, VWAP
converges the order down to match at the best bid price; otherwise, follow the consequences of (S2);
(b) Someone executes this order partially at Pb, and Q decreases so that B ≥ Q. Then if (S2) is NOT true,
VWAP converges the partially matched order down to match at the best bid price.
(c) Someone fully executes the order at Pb.
(S2) When B' + Q ≤ cM, the placed order stays at Pb and wait until any of the following is true:
Page 5 of 17
(a) Someone fully executes the order at Pb.
(b) The best bid decreases, which means Pb decreases. Then VWAP converges the order, either
unmatched or partially matched, down at the new Pb and repeat the same logic, (S1) and (S2), again.
It is emphasized that the above logics, (B1) and (B2), or (S1) and (S2), are applied only when the current
time is before time T, the aggressive time. After time T, VWAP enters the so called Aggressive Mode1
,
defined as the mode in which logic (B1) and (B2), or (S1) and (S2), would be suppressed, and VWAP
follows the original logic on the placement of orders. Moreover, this aggressive mode can be turned on by a
button in VWAP Control Center, supposed to be implemented upon the graphical user interface (GUI)
requirement stated in this document. We will describe more about this button in 1.4.2.3 for GUI
requirement.
1.3.2 The Maximum Possible Quantities A’ and B’
The estimation of A’ by VWAP follows the following logic. Suppose now VWAP is running on a buy size
order. Right after VWAP places a buy order at the price Pa, VWAP detects the total volume at this level,
denoted by Va, and put A’ = Va – Q. Then A’ is the number of shares in front of our order at this moment,
and will be updated immediately only after the occurrence of any of the following:
(i) There is a transaction at the price Pa. Then A’ will be deducted by the transaction quantity.
(ii) When Va, the total volume at Pa, is updated, and A’ > Va – Q, VWAP will set A’ = Va – Q.
(iii) When Va is updated and A’ < 0, VWAP will set A’ = 0.
(iv) When the order is partially executed, VWAP will set A’ = 0.
Please be noted that in the case when there are cancellations of some order at the price Pa, it is not
possible to know if the cancelled orders were in front of our order or behind. In this case, VWAP will not
update A’ (unless (ii) and (iii) is true), and this makes A’ the maximum possible quantity in front of our order
instead of exact. In other words, the estimation by the above logic always gives an upper bound of the
quantity in front of our order.
We have the same estimation logic of B’ for sell VWAP. Suppose now VWAP is running on a sell size
order. Right after VWAP places a sell order at the price Pb, VWAP detects the total volume at this level,
denoted by Vb, and put B’ = Vb – Q. Then B’ is the number of shares in front of our order at this moment,
and will be updated immediately only after the occurrence of any of the following:
(v) There is a transaction at the price Pb. Then B’ will be deducted by the transaction quantity.
(vi) When Vb, the total volume at Pb, is updated, and B’ > Vb – Q, VWAP will set B’ = Vb – Q.
(vii) When Vb is updated and B’ < 0, VWAP will set B’ = 0.
(viii) When the order is partially executed, VWAP will set B’ = 0.
Scenarios for illustrating the above logic will be stated in 1.4.2.2.
1.4 Business Requirements
1
The motivation of having this aggressive time and mode is to avoid incomplete execution. Imagine for a
buy VWAP, if logic (B2) is true, an order stays at Pa and the market depth keeps unchanged until the end
time comes, that order would never be executed. Therefore, time T should be set as a time a short duration
before the end time of a VWAP job, say 30 minutes. After this time, VWAP execute orders in a more
aggressive manner by following the original logic.
Page 6 of 17
1.4.1 Requirement Catalogue
Req ID UseCase
ID
Requirement Description: Comments /Explanation /Details
RQ001 - Add 2 parameter inputs in the
start-up frame of VWAP: Order
Quantity Factor and Aggressive
Time
Order Quantity Factor is used in logic (B2)
and (S2); Aggressive Time defines the
time when VWAP enters the aggressive
mode
RQ002 - VWAP follow the logic stated in
section 1.3
This is the most important requirement of
this document
RQ003 - VWAP Control Center has
(a) a field showing the aggressive
time for users to modify it
(b) a button for users to switch on
and off the aggressive mode
(c) a field showing the Order
Quantity Factor for users to modify
it
1.4.2 Detailed Requirements and Scenarios
In this section, unless otherwise specified, VWAP refers to the VWAP algorithm with the customized
logic stated in 1.3.
1.4.2.1 Req001 – Add “Order Quantity Factor” and “Aggressive Time” for
Input for Start-up
When VWAP is started, in the startup frame, it is required that the parameters “Order Quantity Factor”
and “Aggressive Time” can be set. If “Order Quantity Factor” is left empty, it is default 1; if “Aggressive
Time” is left empty, it is default 30 minutes before the end time of this VWAP job.
1.4.2.2 Req002 – Implement the Logic Stated in 1.3 as a Logic of Order
Placement of VWAP
We will illustrate the logic stated in 1.3 by the following scenarios. These scenarios will be used as test
cases for the implemented solution. Let us employ the term “non-aggressive mode” for referring to the
mode when VWAP is not on aggressive mode (for definition please refer to the last paragraph of 1.3), and
call a VWAP job a buy VWAP if it works on a buy size order and a sell VWAP if it works on a sell size order.
We will use the notations defined in 1.3. Moreover, in the subsections we always assume that the
parameters set by users are as follow: M = 20000, c = 1.5.
In scenario 1 and 2, we assume the underlying buy size order has limit 253. This means that VWAP will
not place any buy order with limit greater than 253, no matter what happens. Similarly, in scenario 3 and 4,
we assume the underlying sell size order has limit 248. This means that VWAP will not place any sell order
with limit less than 248.
Page 7 of 17
Scenario 1: A Buy VWAP on Non-Aggressive Mode with Insufficient Supply at
Best Ask
(a) The market depth at this moment is as follows:
Bid Ask
Quantity Price Price Quantity
200000 250 251 5000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Pa = 250, one tick below the best ask. Suppose now VWAP places a buy order with quantity 8000.
Hence Q = 8000. The order then converges up at price 250 and the market depth becomes as follow:
Bid Ask
Quantity Price Price Quantity
208000 250 251 5000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
At this moment, A = 5000 < Q, thus (B1) is true. VWAP then keeps the order at this price, standing by for
the update of the market depth.
(b) Continuing from (a), assume someone places a sell order at 251 with quantity 5000. Then right at this
moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
208000 250 251 10000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Q = 8000 < A = 10000. Moreover A’ + Q = 208000 ≥ 1.5 × 20000 = 30000, (B2) is not true. Hence
VWAP converges the order up to 251 and fully executes it.
(c) Continuing from (a), assume someone places a sell order at 250 with quantity 202000. Then right at
this moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
6000 250 251 5000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Q = 6000 > 5000 = A. Hence according to (B1), still VWAP keeps the order at 250.
(d) Continuing from (a), assume someone places a sell order at 250 with quantity 204000. Then right at
this moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
Page 8 of 17
4000 250 251 5000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Q = 4000 < 5000 = A. Hence according to (a) of (B1), we check also (B2). And now A’ = 0, and A’ + Q = 4000
< 30000. VWAP keeps the order at 250 and waits for execution.
(e) Continuing from (a), assume someone places a buy order at 250 with quantity 200000, and another
places a sell order at 250 with quantity 204000. Then right at this moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
204000 250 251 5000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Q = 4000 < 5000 = A. Hence according to (a) of (B1), we check also (B2). And now A’ = 0, and A’ + Q = 4000
< 30000. VWAP keeps the order at 250 and wait for execution.
(f) Continuing from (a), assume someone places a buy order at 250 with quantity 200000, and the 200000
shares in front of our order got cancelled. Yet, VWAP can only tell there is a cancellation of 200000 shares
but cannot tell if that is in front of us or not. Thus A’ = 200000 (refer to 1.3.2). Then right at this moment the
market depth becomes
Bid Ask
Quantity Price Price Quantity
208000 250 251 5000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Same as the conclusion of (a), A = 5000 < Q, thus (B1) is true. Hence VWAP keeps the order at this price
as expected. Assume then someone places a sell order at 251 with quantity 5000. Then right at this
moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
208000 250 251 10000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Still A’ + Q = 208000 ≥ 1.5 × 20000 = 30000, and (B2) is not true. Hence VWAP converges the order up
to 251 and fully executes it.
(g) Continuing from (a), assume someone places a buy order at 250 with quantity 200000, and the 200000
shares in front of our order got cancelled. Moreover, someone places a sell order at 250 with quantity 1000
and our order is partially executed. The remaining quantity of our order Q becomes 7000. Thus A’ = 0 (refer
to (iv) under 1.3.2). Then right at this moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
207000 250 251 5000
250000 249 252 150000
220000 248 253 180000
Page 9 of 17
300000 247 254 160000
Same as the conclusion of (a), A = 5000 < Q, thus (B1) is true. Hence VWAP keeps the order at this price
as expected. Assume then someone places a sell order at 251 with quantity 5000. Then right at this
moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
207000 250 251 10000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Still A’ + Q = 7000 ≤ 1.5 × 20000 = 30000, and (B2) is rue. Hence VWAP keeps the order at 250 and
waits for execution.
(h) The market depth at this moment is as follows:
Bid Ask
Quantity Price Price Quantity
200000 250
250000 249
220000 248
300000 247
As the ask side is empty, Pa = 250, the best bid. Suppose now VWAP places a buy order with quantity
8000. Hence Q = 8000. The order then converges up at price 250 and the market depth becomes as follow:
Bid Ask
Quantity Price Price Quantity
208000 250
250000 249
220000 248
300000 247
Again, as ask side is empty, A = 0, and A < Q. By (B1), VWAP keeps the order at this price, standing by
for the update of the market depth.
Scenario 2: A Buy VWAP on Non-Aggressive Mode with Short Queue at Best
Bid
(a) The market depth at this moment is as follows:
Bid Ask
Quantity Price Price Quantity
15000 250 251 200000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Pa = 250, one tick below the best ask. Suppose now VWAP places a buy order with quantity 8000.
Hence Q = 8000. The order then converges up at price 250 and the market depth becomes as follow:
Bid Ask
Quantity Price Price Quantity
Page 10 of 17
23000 250 251 200000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then A’ + Q = 23000 ≤ 30000. Hence, according to (B2), VWAP keeps the order at 250 and wait for
execution.
(b) Continuing from (a), assume at this moment someone places a buy order at 251 with quantity 230000.
The market depth becomes
Bid Ask
Quantity Price Price Quantity
30000 251 252 150000
23000 250 253 180000
250000 249 254 160000
220000 248
300000 247
Then Pa = 251, hence VWAP first converges the order up to 251, and have the following right at the next
moment:
Bid Ask
Quantity Price Price Quantity
38000 251 252 150000
15000 250 253 180000
250000 249 254 160000
220000 248
300000 247
Now Q = 8000 < 150000 = A, and A’ = 30000 hence A’ + Q = 38000 ≥ 30000. Hence (B1) and (B2) are
not true, and VWAP converges the order up at 252 and execute it.
Scenario 3: A Sell VWAP on Non-Aggressive Mode with Insufficient Supply at
Best Bid
(a) The market depth at this moment is as follows:
Bid Ask
Quantity Price Price Quantity
5000 250 251 200000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Pb = 251, one tick above the best bid. Suppose now VWAP places a sell order with quantity 8000.
Hence Q = 8000. The order then converges down at price 251 and the market depth becomes as follow:
Bid Ask
Quantity Price Price Quantity
5000 250 251 208000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
At this moment, B = 5000 < Q, and thus (S1) is true. VWAP then keeps the order at this price, standing by
for the update of the market depth.
Page 11 of 17
(b) Continuing from (a), assume someone places a buy order at 250 with quantity 5000. Then right at this
moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
10000 250 251 208000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Q = 8000 < B = 10000. Moreover B’ + Q = 208000 ≥ 1.5 × 20000 = 30000, (S2) is not true. Hence
VWAP converges the order down to 250 and fully executes it.
(c) Continuing from (a), assume someone places a buy order at 251 with quantity 202000. Then right at
this moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
5000 250 251 6000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Q = 6000 > 5000 = B. Hence according to (S1), still VWAP keeps the order at 251.
(d) Continuing from (a), assume someone places a buy order at 251 with quantity 204000. Then right at
this moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
5000 250 251 4000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Q = 4000 < 5000 = B. Hence according to (a) of (S1), we check also (S2). And now B’ = 0, and B’ + Q = 4000
< 30000. VWAP keeps the order at 251 and wait for execution.
(e) Continuing from (a), assume someone places a sell order at 251 with quantity 200000, and another
places a buy order at 251 with quantity 204000. Then right at this moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
5000 250 251 204000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Q = 4000 < 5000 = A. Hence according to (a) of (S1), we check also (S2). And now B’ = 0, and B’ + Q = 4000
< 30000. VWAP keeps the order at 251 and wait for execution.
(f) Continuing from (a), assume someone places a sell order at 251 with quantity 200000, and the 200000
shares in front of our order got cancelled. Yet, VWAP can only tell there is a cancellation of 200000 shares
but cannot tell if that is in front of us or not. Thus B’ = 200000 (refer to 1.3.2). Then right at this moment the
market depth becomes
Bid Ask
Page 12 of 17
Quantity Price Price Quantity
5000 250 251 208000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Same as the conclusion of (a), B = 5000 < Q, thus (S1) is true. Hence VWAP keeps the order at this price
as expected. Assume then someone places a buy order at 250 with quantity 5000. Then right at this
moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
10000 250 251 208000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Still B’ + Q = 208000 ≥ 1.5 × 20000 = 30000, and (S2) is not true. Hence VWAP converges the order
down to 250 and fully executes it.
(g) Continuing from (a), assume someone places a sell order at 251 with quantity 200000, and the 200000
shares in front of our order got cancelled. Moreover, someone places a buy order at 251 with quantity 1000
and our order is partially executed. The remaining quantity of our order Q becomes 7000. Thus B’ = 0 (refer
to (viii) under 1.3.2). Then right at this moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
5000 250 251 207000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Same as the conclusion of (a), B = 5000 < Q, thus (S1) is true. Hence VWAP keeps the order at this price
as expected. Assume then someone places a buy order at 250 with quantity 5000. Then right at this
moment the market depth becomes
Bid Ask
Quantity Price Price Quantity
10000 250 251 207000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Still B’ + Q = 7000 ≤ 1.5 × 20000 = 30000, and (S2) is rue. Hence VWAP keeps the order at 251 and
waits for execution.
(h) The market depth at this moment is as follows:
Bid Ask
Quantity Price Price Quantity
251 200000
252 150000
253 180000
254 160000
As the bid side is empty, Pb = 251, the best ask. Suppose now VWAP places a buy order with quantity
8000. Hence Q = 8000. The order then converges down at price 251 and the market depth becomes as
follow:
Page 13 of 17
Bid Ask
Quantity Price Price Quantity
251 208000
252 150000
253 180000
254 160000
Again, as ask side is empty, B = 0, and B < Q. By (S1), VWAP keeps the order at this price, standing by
for the update of the market depth.
Scenario 4: A Sell VWAP on Non-Aggressive Mode with Short Queue at Best
Ask
(a) The market depth at this moment is as follows:
Bid Ask
Quantity Price Price Quantity
200000 250 251 15000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then Pb = 251, one tick above the best bid. Suppose now VWAP places a sell order with quantity 8000.
Hence Q = 8000. The order then converges down at price 251 and the market depth becomes as follow:
Bid Ask
Quantity Price Price Quantity
200000 250 251 23000
250000 249 252 150000
220000 248 253 180000
300000 247 254 160000
Then B’ + Q = 23000 ≤ 30000. Hence, according to (S2), VWAP keeps the order at 251 and wait for
execution.
(b) Continuing from (a), assume at this moment someone places a sell order at 250 with quantity 230000.
The market depth becomes
Bid Ask
Quantity Price Price Quantity
250000 249 250 30000
220000 248 251 23000
300000 247 252 150000
253 180000
254 160000
Then Pb = 250, hence VWAP first converges the order down to 250, and have the following right at the next
moment:
Bid Ask
Quantity Price Price Quantity
250000 249 250 38000
220000 248 251 15000
300000 247 252 150000
253 180000
254 160000
Page 14 of 17
Now Q = 8000 < 250000 = B, and B’ = 30000 hence B’ + Q = 38000 ≥ 30000. Hence (S1) and (S2) are
not true, and VWAP converges the order down at 249 and execute it.
1.4.2.3 Req003 – VWAP Control Center Customization
The first 3 subsections in the following describe the customized features required to be incorporated in VWAP
Control Center. The forth subsection illustrates these requirements by scenarios.
1.4.2.3.1 The Aggressive Time
In the VWAP Control Center of the customized VWAP, it is required to have a text field displaying the
aggressive time. Once the current time is in between the aggressive time and the end time of the
corresponding VWAP job, the aggressive mode is forced ON (users cannot turn off Mode Button, see
1.4.2.3.2), and the corresponding logic applies (refer to the last paragraph of 1.3). The aggressive time can
be edited by users. If the aggressive time is set to a time earlier than current time, aggressive mode is
forced on, and the placement logic switches to aggressive mode immediately; if the aggressive time is set
to a time later than current time, the aggressive mode remains as before (that is, if aggressive mode was
on before, it is still on, but now users can turn to non-aggressive mode by Mode Button; if aggressive mode
was off before, it is still off).
1.4.2.3.2 Mode Button
In the VWAP Control Center of the customized VWAP, it is required to have a button, namely Mode
Button, which allows users to switch on and off the aggressive mode. When current time is after aggressive
time, this utton must be ON and cannot be turned off. Suppose the current time is after the aggressive time
now, hence the button is on. In order to turn this button off, users have to first set the aggressive time after
the current time, then press Mode Button. And upon pressing this button, the placement logic switches
between aggressive mode and non-aggressive mode immediately.
1.4.2.3.3 Order Quantity Factor
In the VWAP Control Center of the customized VWAP, it is required to have a text field displaying Order
Quantity Factor. This is denoted by c in 1.3, which plays an important role for the placement logic (please
see (B2) and (S2)). During non-aggressive mode, upon the modification of this value, the placement logic
adapts to the update of this value immediately.
1.4.2.3.4 Scenarios Induced by VWAP Control Center
Scenario 5: Turning Aggressive Mode ON in Existing Scenarios
(a) Continuing from the end of Scenario 1 (a), if the aggressive mode is turned on, either by pressing Mode
Button or setting the aggressive time earlier than current time, VWAP will converge the order up at 251 and
match 5000 shares, then converge the remaining 3000 shares up at 252 and fully execute it. This is
because the logic (B1) and (B2) are suppressed.
(b) Continuing from the end of Scenario 1 (c), if the aggressive mode is turned on, VWAP will converge the
order up at 251 and match 5000 shares, then converge the remaining 1000 shares up at 252 and fully
execute it. This is because the logic (B1) and (B2) are suppressed.
(c) Continuing from the end of Scenario 1 (d), if the aggressive mode is turned on, VWAP will converge the
order up at 251 and fully execute the 4000 shares as the logic (B1) and (B2) are suppressed.
Page 15 of 17
(d) Continuing from the end of Scenario 1 (e), if the aggressive mode is turned on, VWAP will converge the
order up at 251 and fully execute the 4000 shares as the logic (B1) and (B2) are suppressed.
(e) Continuing from the end of Scenario 2 (a), if the aggressive mode is turned on, VWAP will converge the
order up at 251 and fully execute the 8000 shares as the logic (B1) and (B2) are suppressed.
(f) Continuing from the end of Scenario 3 (a), if the aggressive mode is turned on, VWAP will converge the
order down at 250 and match 5000 shares, then converge the remaining 3000 shares up at 249 and fully
execute it. This is because the logic (S1) and (S2) are suppressed.
(g) Continuing from the end of Scenario 3 (c), if the aggressive mode is turned on, VWAP will converge the
order down at 250 and match 5000 shares, then converge the remaining 1000 shares up at 249 and fully
execute it. This is because the logic (S1) and (S2) are suppressed.
(h) Continuing from the end of Scenario 3 (d), if the aggressive mode is turned on, VWAP will converge the
order down at 250 and fully execute 4000 shares as the logic (S1) and (S2) are suppressed.
(i) Continuing from the end of Scenario 3 (e), if the aggressive mode is turned on, VWAP will converge the
order down at 250 and fully execute 4000 shares as the logic (S1) and (S2) are suppressed.
(j) Continuing from the end of Scenario 4 (a), if the aggressive mode is turned on, VWAP will converge the
order down at 250 and fully execute 8000 shares as the logic (S1) and (S2) are suppressed.
Scenario 6: Modifying Order Quantity Factor c in Existing Scenarios
(a) Continuing from the end of Scenario 1 (d), suppose Order Quantity Factor c is modified to 0.1. Then
checking (B2), A’ + Q = 4000 > 2000 = 0.1 × 20000. VWAP will converge the order up at 251 and fully
execute the 4000 shares.
(b) Continuing from the end of Scenario 1 (e), suppose Order Quantity Factor c is modified to 0.1. Then
checking (B2), A’ + Q = 4000 > 2000 = 0.1 × 20000. VWAP will converge the order up at 251 and fully
execute 4000 shares.
(c) Continuing from the end of Scenario 2 (a), suppose Order Quantity Factor c is modified to 1. Then
checking (B2), A’ + Q = 23000 > 20000 = 1 × 20000. VWAP will converge the order up at 251 and fully
execute 8000 shares.
(d) Continuing from the end of Scenario 3 (d), suppose Order Quantity Factor c is modified to 0.1. Then
checking (S2), B’ + Q = 4000 > 2000 = 0.1 × 20000. VWAP will converge the order down at 250 and fully
execute 4000 shares.
(e) Continuing from the end of Scenario 3 (e), suppose Order Quantity Factor c is modified to 0.1. Then
checking (S2), B’ + Q = 4000 > 2000 = 0.1 × 20000. VWAP will converge the order down at 250 and fully
execute 4000 shares.
(f) Continuing from the end of Scenario 4 (a), suppose Order Quantity Factor c is modified to 1. Then
checking (B2), A’ + Q = 23000 > 20000 = 1 × 20000. VWAP will converge the order up at 251 and fully
execute 8000 shares.
Page 16 of 17
2 Authorization of Business Requirement
By signing at the space below, BROKER agrees that the requirements and the corresponding logic stated in this
document, FS_ALGO_1401_VWAP Customizations - Order Logic on Best Quantities v0.3, fulfil the customization
requirement on the recent version of VWAP.
For the Client:
Name:
Position:
Date:
Signature:
For the Supplier:
Name:
Position:
Date:
Signature:
For the Client:
Name:
Position:
Date:
Signature:
For the Supplier:
Name:
Position:
Date:
Signature:
For the Client:
Name:
Position:
Date:
Signature:
For the Supplier:
Name:
Position:
Date:
Signature:
Page 17 of 17

More Related Content

PDF
Chapter 6 Flow control Instructions
PDF
¿Cómo se percibe la ciudadanía en el Perú desde la escuela pública? .
PDF
Mohamed Said CV1
ODP
B is for book
DOCX
Jordi
PDF
Get started with dropbox
PPTX
Endevina endevinalla!
PDF
La rivalutazione del limone-Classe 5^ G-Circolo Didattico V _Bagheria
Chapter 6 Flow control Instructions
¿Cómo se percibe la ciudadanía en el Perú desde la escuela pública? .
Mohamed Said CV1
B is for book
Jordi
Get started with dropbox
Endevina endevinalla!
La rivalutazione del limone-Classe 5^ G-Circolo Didattico V _Bagheria

Viewers also liked (6)

PPTX
How Do You Locate the Information You Need for a Citation
DOC
Project Charter Template
DOC
Firas Barahme
PDF
исеть1
PPTX
loyalty and brand
PPTX
Відкритий урок проектна робота
How Do You Locate the Information You Need for a Citation
Project Charter Template
Firas Barahme
исеть1
loyalty and brand
Відкритий урок проектна робота
Ad

FS_ALGO_1401_VWAP Customizations - Order Logic on Best Quantities (No names)

  • 1. FS_ALGO#1401 VWAP Customizations - Order Logic on Best Quantities FS Number FS ALGO#1401 Client BROKER DU Business Analyst Milton Ko Date 10/12/2014 Internal Enhancement Reference(s) Page 1 of 17
  • 2. Revision history Version Date Description By 0.1 10/12/2014 Initial version Milton Ko 0.2 19/12/2014 Corrected some typos and added page numbers Milton Ko 0.3 29/12/2014 Modified the definition of A’ and B’ in 1.3.1, added section 1.3.2, and inserted scenarios 1(f), 1(g), 3(f) and 3(g) Milton Ko Page 2 of 17
  • 3. Contents 1 Business Requirements....................................................................................................................4 1.1 Background and Objective............................................................................................................4 1.2 Scopes.......................................................................................................................................... 4 1.3 Details and Definitions of the New Logic.......................................................................................4 1.3.1 The Logic of Order Placement................................................................................................5 1.3.2 The Maximum Possible Quantities A’ and B’..........................................................................6 1.4 Business Requirements................................................................................................................6 1.4.1 Requirement Catalogue..........................................................................................................7 1.4.2 Detailed Requirements and Scenarios...................................................................................7 1.4.2.1 Req001 – Add “Order Quantity Factor” and “Aggressive Time” for Input for Start-up......7 1.4.2.2 Req002 – Implement the Logic Stated in 1.3 as a Logic of Order Placement of VWAP...7 7 1.4.2.3 Req003 – VWAP Control Center Customization............................................................15 1.4.2.3.1 The Aggressive Time...............................................................................................15 1.4.2.3.2 Mode Button............................................................................................................15 1.4.2.3.3 Order Quantity Factor..............................................................................................15 1.4.2.3.4 Scenarios Induced by VWAP Control Center..........................................................15 2 Authorization of Business Requirement.......................................................................................17 Page 3 of 17
  • 4. 1 Business Requirements 1.1 Background and Objective The algorithm VWAP in the automated trading platform of DECIDE aims at assisting traders to break down large size orders into small trading orders and execute. The model used for breaking size orders bases on historical data. The first VWAP version on the production of BROKER is 2.0.8, whose Go-Live date was in April 2014. After over half a year of experience working with VWAP, BROKER has decided to add in a customized trading logic regarding the order placement. This document means to specify this logic and related definitions in a precise and closed way. 1.2 Scopes The logic of order placement in the recent VWAP (referred as original logic hereafter) is logically closed (including responses for all scenarios). The logic specified in this document (referred as new logic hereafter) is an add-on to that. Any situation not described by the new logic will follow the original logic. The scope of the customizations specified in this document includes: 1. the add-on logic described in Section 1.3; 2. the GUI requirements specified in Section 1.4.2.3 ; Anything not included in the above 2 items is out of scope. 1.3 Details and Definitions of the New Logic VWAP works on both buy and sell size orders. The new logic applies to both. Indeed, the new logic on buy size orders is just the “reverse” of that on sell size orders. For the new logic, we need to introduce 2 new parameters entered by users: 1. Order Quantity Factor, denoted by c, a positive number; 2. Aggressive Time, denoted by T, with format HH:MM:SS (for example, 15:30:00). There are a few more notations that we will need for the description of the logic. 3. the maximum quantity allowed for order placement by VWAP, denoted by M, set up in VWAP Control Center. 4. the price at one tick below best ask, denoted by Pa. (In case when ask side is empty, Pa is the best bid) Page 4 of 17
  • 5. 5. the price at one tick above best bid, denoted by Pb. (In case when bid side is empty, Pb is the best ask) 6. the quantity at the best ask and best bid, denoted by A and B respectively. (In case ask side is empty, A = 0; in case bid side is empty, B = 0) 7. the maximum possible quantity in front of our VWAP order in the queue lining up at the price Pa for buy size orders, and or at Pb for sell size orders, denoted by A’ and B’ respectively. The estimation logic will be described in Section 1.3.2 8. the quantity of the order placed by VWAP at a moment, denoted by Q. 1.3.1 The Logic of Order Placement Let us now describe the logic on buy size orders first. When the market is empty, no order is placed, as the recent VWAP does. Suppose now the market depth is non-empty and a running VWAP places a buy order, and the following logic is applied only when the current time is before time T, and the order is up at the price Pa.: (B1) When A<Q, the placed order stays at Pa and wait until any of the following is true: (a) Someone fills the best ask with more quantities such that A ≥ Q. Then if (B2) is NOT true, VWAP converges the order up to match at the best ask price; otherwise, follow the consequences of (B2); (b) Someone executes this order partially at Pa, and Q decreases so that A ≥ Q. Then if (B2) is NOT true, VWAP converges the partially matched order up to match at the best ask price. (c) Someone fully executes the order at Pa. (B2) When A' + Q ≤ cM, the placed order stays at Pa and wait until any of the following is true: (a) Someone fully executes the order at Pa. (b) The best ask increases, which means Pa increases. Then VWAP converges the order, either unmatched or partially matched, up at the new Pa and repeat the same logic, (B1) and (B2), again. Similarly, we describe the logic on sell size orders. Suppose now the market depth is non-empty and a running VWAP places a sell order, and the following logic is applied only when the current time is before time T, and the order is down at the price Pb.: (S1) When B<Q, the placed order stays at Pb and wait until any of the following is true: (a) Someone fills the best bid with more quantities such that B ≥ Q. Then if (S2) is NOT true, VWAP converges the order down to match at the best bid price; otherwise, follow the consequences of (S2); (b) Someone executes this order partially at Pb, and Q decreases so that B ≥ Q. Then if (S2) is NOT true, VWAP converges the partially matched order down to match at the best bid price. (c) Someone fully executes the order at Pb. (S2) When B' + Q ≤ cM, the placed order stays at Pb and wait until any of the following is true: Page 5 of 17
  • 6. (a) Someone fully executes the order at Pb. (b) The best bid decreases, which means Pb decreases. Then VWAP converges the order, either unmatched or partially matched, down at the new Pb and repeat the same logic, (S1) and (S2), again. It is emphasized that the above logics, (B1) and (B2), or (S1) and (S2), are applied only when the current time is before time T, the aggressive time. After time T, VWAP enters the so called Aggressive Mode1 , defined as the mode in which logic (B1) and (B2), or (S1) and (S2), would be suppressed, and VWAP follows the original logic on the placement of orders. Moreover, this aggressive mode can be turned on by a button in VWAP Control Center, supposed to be implemented upon the graphical user interface (GUI) requirement stated in this document. We will describe more about this button in 1.4.2.3 for GUI requirement. 1.3.2 The Maximum Possible Quantities A’ and B’ The estimation of A’ by VWAP follows the following logic. Suppose now VWAP is running on a buy size order. Right after VWAP places a buy order at the price Pa, VWAP detects the total volume at this level, denoted by Va, and put A’ = Va – Q. Then A’ is the number of shares in front of our order at this moment, and will be updated immediately only after the occurrence of any of the following: (i) There is a transaction at the price Pa. Then A’ will be deducted by the transaction quantity. (ii) When Va, the total volume at Pa, is updated, and A’ > Va – Q, VWAP will set A’ = Va – Q. (iii) When Va is updated and A’ < 0, VWAP will set A’ = 0. (iv) When the order is partially executed, VWAP will set A’ = 0. Please be noted that in the case when there are cancellations of some order at the price Pa, it is not possible to know if the cancelled orders were in front of our order or behind. In this case, VWAP will not update A’ (unless (ii) and (iii) is true), and this makes A’ the maximum possible quantity in front of our order instead of exact. In other words, the estimation by the above logic always gives an upper bound of the quantity in front of our order. We have the same estimation logic of B’ for sell VWAP. Suppose now VWAP is running on a sell size order. Right after VWAP places a sell order at the price Pb, VWAP detects the total volume at this level, denoted by Vb, and put B’ = Vb – Q. Then B’ is the number of shares in front of our order at this moment, and will be updated immediately only after the occurrence of any of the following: (v) There is a transaction at the price Pb. Then B’ will be deducted by the transaction quantity. (vi) When Vb, the total volume at Pb, is updated, and B’ > Vb – Q, VWAP will set B’ = Vb – Q. (vii) When Vb is updated and B’ < 0, VWAP will set B’ = 0. (viii) When the order is partially executed, VWAP will set B’ = 0. Scenarios for illustrating the above logic will be stated in 1.4.2.2. 1.4 Business Requirements 1 The motivation of having this aggressive time and mode is to avoid incomplete execution. Imagine for a buy VWAP, if logic (B2) is true, an order stays at Pa and the market depth keeps unchanged until the end time comes, that order would never be executed. Therefore, time T should be set as a time a short duration before the end time of a VWAP job, say 30 minutes. After this time, VWAP execute orders in a more aggressive manner by following the original logic. Page 6 of 17
  • 7. 1.4.1 Requirement Catalogue Req ID UseCase ID Requirement Description: Comments /Explanation /Details RQ001 - Add 2 parameter inputs in the start-up frame of VWAP: Order Quantity Factor and Aggressive Time Order Quantity Factor is used in logic (B2) and (S2); Aggressive Time defines the time when VWAP enters the aggressive mode RQ002 - VWAP follow the logic stated in section 1.3 This is the most important requirement of this document RQ003 - VWAP Control Center has (a) a field showing the aggressive time for users to modify it (b) a button for users to switch on and off the aggressive mode (c) a field showing the Order Quantity Factor for users to modify it 1.4.2 Detailed Requirements and Scenarios In this section, unless otherwise specified, VWAP refers to the VWAP algorithm with the customized logic stated in 1.3. 1.4.2.1 Req001 – Add “Order Quantity Factor” and “Aggressive Time” for Input for Start-up When VWAP is started, in the startup frame, it is required that the parameters “Order Quantity Factor” and “Aggressive Time” can be set. If “Order Quantity Factor” is left empty, it is default 1; if “Aggressive Time” is left empty, it is default 30 minutes before the end time of this VWAP job. 1.4.2.2 Req002 – Implement the Logic Stated in 1.3 as a Logic of Order Placement of VWAP We will illustrate the logic stated in 1.3 by the following scenarios. These scenarios will be used as test cases for the implemented solution. Let us employ the term “non-aggressive mode” for referring to the mode when VWAP is not on aggressive mode (for definition please refer to the last paragraph of 1.3), and call a VWAP job a buy VWAP if it works on a buy size order and a sell VWAP if it works on a sell size order. We will use the notations defined in 1.3. Moreover, in the subsections we always assume that the parameters set by users are as follow: M = 20000, c = 1.5. In scenario 1 and 2, we assume the underlying buy size order has limit 253. This means that VWAP will not place any buy order with limit greater than 253, no matter what happens. Similarly, in scenario 3 and 4, we assume the underlying sell size order has limit 248. This means that VWAP will not place any sell order with limit less than 248. Page 7 of 17
  • 8. Scenario 1: A Buy VWAP on Non-Aggressive Mode with Insufficient Supply at Best Ask (a) The market depth at this moment is as follows: Bid Ask Quantity Price Price Quantity 200000 250 251 5000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Pa = 250, one tick below the best ask. Suppose now VWAP places a buy order with quantity 8000. Hence Q = 8000. The order then converges up at price 250 and the market depth becomes as follow: Bid Ask Quantity Price Price Quantity 208000 250 251 5000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 At this moment, A = 5000 < Q, thus (B1) is true. VWAP then keeps the order at this price, standing by for the update of the market depth. (b) Continuing from (a), assume someone places a sell order at 251 with quantity 5000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 208000 250 251 10000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Q = 8000 < A = 10000. Moreover A’ + Q = 208000 ≥ 1.5 × 20000 = 30000, (B2) is not true. Hence VWAP converges the order up to 251 and fully executes it. (c) Continuing from (a), assume someone places a sell order at 250 with quantity 202000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 6000 250 251 5000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Q = 6000 > 5000 = A. Hence according to (B1), still VWAP keeps the order at 250. (d) Continuing from (a), assume someone places a sell order at 250 with quantity 204000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity Page 8 of 17
  • 9. 4000 250 251 5000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Q = 4000 < 5000 = A. Hence according to (a) of (B1), we check also (B2). And now A’ = 0, and A’ + Q = 4000 < 30000. VWAP keeps the order at 250 and waits for execution. (e) Continuing from (a), assume someone places a buy order at 250 with quantity 200000, and another places a sell order at 250 with quantity 204000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 204000 250 251 5000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Q = 4000 < 5000 = A. Hence according to (a) of (B1), we check also (B2). And now A’ = 0, and A’ + Q = 4000 < 30000. VWAP keeps the order at 250 and wait for execution. (f) Continuing from (a), assume someone places a buy order at 250 with quantity 200000, and the 200000 shares in front of our order got cancelled. Yet, VWAP can only tell there is a cancellation of 200000 shares but cannot tell if that is in front of us or not. Thus A’ = 200000 (refer to 1.3.2). Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 208000 250 251 5000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Same as the conclusion of (a), A = 5000 < Q, thus (B1) is true. Hence VWAP keeps the order at this price as expected. Assume then someone places a sell order at 251 with quantity 5000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 208000 250 251 10000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Still A’ + Q = 208000 ≥ 1.5 × 20000 = 30000, and (B2) is not true. Hence VWAP converges the order up to 251 and fully executes it. (g) Continuing from (a), assume someone places a buy order at 250 with quantity 200000, and the 200000 shares in front of our order got cancelled. Moreover, someone places a sell order at 250 with quantity 1000 and our order is partially executed. The remaining quantity of our order Q becomes 7000. Thus A’ = 0 (refer to (iv) under 1.3.2). Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 207000 250 251 5000 250000 249 252 150000 220000 248 253 180000 Page 9 of 17
  • 10. 300000 247 254 160000 Same as the conclusion of (a), A = 5000 < Q, thus (B1) is true. Hence VWAP keeps the order at this price as expected. Assume then someone places a sell order at 251 with quantity 5000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 207000 250 251 10000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Still A’ + Q = 7000 ≤ 1.5 × 20000 = 30000, and (B2) is rue. Hence VWAP keeps the order at 250 and waits for execution. (h) The market depth at this moment is as follows: Bid Ask Quantity Price Price Quantity 200000 250 250000 249 220000 248 300000 247 As the ask side is empty, Pa = 250, the best bid. Suppose now VWAP places a buy order with quantity 8000. Hence Q = 8000. The order then converges up at price 250 and the market depth becomes as follow: Bid Ask Quantity Price Price Quantity 208000 250 250000 249 220000 248 300000 247 Again, as ask side is empty, A = 0, and A < Q. By (B1), VWAP keeps the order at this price, standing by for the update of the market depth. Scenario 2: A Buy VWAP on Non-Aggressive Mode with Short Queue at Best Bid (a) The market depth at this moment is as follows: Bid Ask Quantity Price Price Quantity 15000 250 251 200000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Pa = 250, one tick below the best ask. Suppose now VWAP places a buy order with quantity 8000. Hence Q = 8000. The order then converges up at price 250 and the market depth becomes as follow: Bid Ask Quantity Price Price Quantity Page 10 of 17
  • 11. 23000 250 251 200000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then A’ + Q = 23000 ≤ 30000. Hence, according to (B2), VWAP keeps the order at 250 and wait for execution. (b) Continuing from (a), assume at this moment someone places a buy order at 251 with quantity 230000. The market depth becomes Bid Ask Quantity Price Price Quantity 30000 251 252 150000 23000 250 253 180000 250000 249 254 160000 220000 248 300000 247 Then Pa = 251, hence VWAP first converges the order up to 251, and have the following right at the next moment: Bid Ask Quantity Price Price Quantity 38000 251 252 150000 15000 250 253 180000 250000 249 254 160000 220000 248 300000 247 Now Q = 8000 < 150000 = A, and A’ = 30000 hence A’ + Q = 38000 ≥ 30000. Hence (B1) and (B2) are not true, and VWAP converges the order up at 252 and execute it. Scenario 3: A Sell VWAP on Non-Aggressive Mode with Insufficient Supply at Best Bid (a) The market depth at this moment is as follows: Bid Ask Quantity Price Price Quantity 5000 250 251 200000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Pb = 251, one tick above the best bid. Suppose now VWAP places a sell order with quantity 8000. Hence Q = 8000. The order then converges down at price 251 and the market depth becomes as follow: Bid Ask Quantity Price Price Quantity 5000 250 251 208000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 At this moment, B = 5000 < Q, and thus (S1) is true. VWAP then keeps the order at this price, standing by for the update of the market depth. Page 11 of 17
  • 12. (b) Continuing from (a), assume someone places a buy order at 250 with quantity 5000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 10000 250 251 208000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Q = 8000 < B = 10000. Moreover B’ + Q = 208000 ≥ 1.5 × 20000 = 30000, (S2) is not true. Hence VWAP converges the order down to 250 and fully executes it. (c) Continuing from (a), assume someone places a buy order at 251 with quantity 202000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 5000 250 251 6000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Q = 6000 > 5000 = B. Hence according to (S1), still VWAP keeps the order at 251. (d) Continuing from (a), assume someone places a buy order at 251 with quantity 204000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 5000 250 251 4000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Q = 4000 < 5000 = B. Hence according to (a) of (S1), we check also (S2). And now B’ = 0, and B’ + Q = 4000 < 30000. VWAP keeps the order at 251 and wait for execution. (e) Continuing from (a), assume someone places a sell order at 251 with quantity 200000, and another places a buy order at 251 with quantity 204000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 5000 250 251 204000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Q = 4000 < 5000 = A. Hence according to (a) of (S1), we check also (S2). And now B’ = 0, and B’ + Q = 4000 < 30000. VWAP keeps the order at 251 and wait for execution. (f) Continuing from (a), assume someone places a sell order at 251 with quantity 200000, and the 200000 shares in front of our order got cancelled. Yet, VWAP can only tell there is a cancellation of 200000 shares but cannot tell if that is in front of us or not. Thus B’ = 200000 (refer to 1.3.2). Then right at this moment the market depth becomes Bid Ask Page 12 of 17
  • 13. Quantity Price Price Quantity 5000 250 251 208000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Same as the conclusion of (a), B = 5000 < Q, thus (S1) is true. Hence VWAP keeps the order at this price as expected. Assume then someone places a buy order at 250 with quantity 5000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 10000 250 251 208000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Still B’ + Q = 208000 ≥ 1.5 × 20000 = 30000, and (S2) is not true. Hence VWAP converges the order down to 250 and fully executes it. (g) Continuing from (a), assume someone places a sell order at 251 with quantity 200000, and the 200000 shares in front of our order got cancelled. Moreover, someone places a buy order at 251 with quantity 1000 and our order is partially executed. The remaining quantity of our order Q becomes 7000. Thus B’ = 0 (refer to (viii) under 1.3.2). Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 5000 250 251 207000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Same as the conclusion of (a), B = 5000 < Q, thus (S1) is true. Hence VWAP keeps the order at this price as expected. Assume then someone places a buy order at 250 with quantity 5000. Then right at this moment the market depth becomes Bid Ask Quantity Price Price Quantity 10000 250 251 207000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Still B’ + Q = 7000 ≤ 1.5 × 20000 = 30000, and (S2) is rue. Hence VWAP keeps the order at 251 and waits for execution. (h) The market depth at this moment is as follows: Bid Ask Quantity Price Price Quantity 251 200000 252 150000 253 180000 254 160000 As the bid side is empty, Pb = 251, the best ask. Suppose now VWAP places a buy order with quantity 8000. Hence Q = 8000. The order then converges down at price 251 and the market depth becomes as follow: Page 13 of 17
  • 14. Bid Ask Quantity Price Price Quantity 251 208000 252 150000 253 180000 254 160000 Again, as ask side is empty, B = 0, and B < Q. By (S1), VWAP keeps the order at this price, standing by for the update of the market depth. Scenario 4: A Sell VWAP on Non-Aggressive Mode with Short Queue at Best Ask (a) The market depth at this moment is as follows: Bid Ask Quantity Price Price Quantity 200000 250 251 15000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then Pb = 251, one tick above the best bid. Suppose now VWAP places a sell order with quantity 8000. Hence Q = 8000. The order then converges down at price 251 and the market depth becomes as follow: Bid Ask Quantity Price Price Quantity 200000 250 251 23000 250000 249 252 150000 220000 248 253 180000 300000 247 254 160000 Then B’ + Q = 23000 ≤ 30000. Hence, according to (S2), VWAP keeps the order at 251 and wait for execution. (b) Continuing from (a), assume at this moment someone places a sell order at 250 with quantity 230000. The market depth becomes Bid Ask Quantity Price Price Quantity 250000 249 250 30000 220000 248 251 23000 300000 247 252 150000 253 180000 254 160000 Then Pb = 250, hence VWAP first converges the order down to 250, and have the following right at the next moment: Bid Ask Quantity Price Price Quantity 250000 249 250 38000 220000 248 251 15000 300000 247 252 150000 253 180000 254 160000 Page 14 of 17
  • 15. Now Q = 8000 < 250000 = B, and B’ = 30000 hence B’ + Q = 38000 ≥ 30000. Hence (S1) and (S2) are not true, and VWAP converges the order down at 249 and execute it. 1.4.2.3 Req003 – VWAP Control Center Customization The first 3 subsections in the following describe the customized features required to be incorporated in VWAP Control Center. The forth subsection illustrates these requirements by scenarios. 1.4.2.3.1 The Aggressive Time In the VWAP Control Center of the customized VWAP, it is required to have a text field displaying the aggressive time. Once the current time is in between the aggressive time and the end time of the corresponding VWAP job, the aggressive mode is forced ON (users cannot turn off Mode Button, see 1.4.2.3.2), and the corresponding logic applies (refer to the last paragraph of 1.3). The aggressive time can be edited by users. If the aggressive time is set to a time earlier than current time, aggressive mode is forced on, and the placement logic switches to aggressive mode immediately; if the aggressive time is set to a time later than current time, the aggressive mode remains as before (that is, if aggressive mode was on before, it is still on, but now users can turn to non-aggressive mode by Mode Button; if aggressive mode was off before, it is still off). 1.4.2.3.2 Mode Button In the VWAP Control Center of the customized VWAP, it is required to have a button, namely Mode Button, which allows users to switch on and off the aggressive mode. When current time is after aggressive time, this utton must be ON and cannot be turned off. Suppose the current time is after the aggressive time now, hence the button is on. In order to turn this button off, users have to first set the aggressive time after the current time, then press Mode Button. And upon pressing this button, the placement logic switches between aggressive mode and non-aggressive mode immediately. 1.4.2.3.3 Order Quantity Factor In the VWAP Control Center of the customized VWAP, it is required to have a text field displaying Order Quantity Factor. This is denoted by c in 1.3, which plays an important role for the placement logic (please see (B2) and (S2)). During non-aggressive mode, upon the modification of this value, the placement logic adapts to the update of this value immediately. 1.4.2.3.4 Scenarios Induced by VWAP Control Center Scenario 5: Turning Aggressive Mode ON in Existing Scenarios (a) Continuing from the end of Scenario 1 (a), if the aggressive mode is turned on, either by pressing Mode Button or setting the aggressive time earlier than current time, VWAP will converge the order up at 251 and match 5000 shares, then converge the remaining 3000 shares up at 252 and fully execute it. This is because the logic (B1) and (B2) are suppressed. (b) Continuing from the end of Scenario 1 (c), if the aggressive mode is turned on, VWAP will converge the order up at 251 and match 5000 shares, then converge the remaining 1000 shares up at 252 and fully execute it. This is because the logic (B1) and (B2) are suppressed. (c) Continuing from the end of Scenario 1 (d), if the aggressive mode is turned on, VWAP will converge the order up at 251 and fully execute the 4000 shares as the logic (B1) and (B2) are suppressed. Page 15 of 17
  • 16. (d) Continuing from the end of Scenario 1 (e), if the aggressive mode is turned on, VWAP will converge the order up at 251 and fully execute the 4000 shares as the logic (B1) and (B2) are suppressed. (e) Continuing from the end of Scenario 2 (a), if the aggressive mode is turned on, VWAP will converge the order up at 251 and fully execute the 8000 shares as the logic (B1) and (B2) are suppressed. (f) Continuing from the end of Scenario 3 (a), if the aggressive mode is turned on, VWAP will converge the order down at 250 and match 5000 shares, then converge the remaining 3000 shares up at 249 and fully execute it. This is because the logic (S1) and (S2) are suppressed. (g) Continuing from the end of Scenario 3 (c), if the aggressive mode is turned on, VWAP will converge the order down at 250 and match 5000 shares, then converge the remaining 1000 shares up at 249 and fully execute it. This is because the logic (S1) and (S2) are suppressed. (h) Continuing from the end of Scenario 3 (d), if the aggressive mode is turned on, VWAP will converge the order down at 250 and fully execute 4000 shares as the logic (S1) and (S2) are suppressed. (i) Continuing from the end of Scenario 3 (e), if the aggressive mode is turned on, VWAP will converge the order down at 250 and fully execute 4000 shares as the logic (S1) and (S2) are suppressed. (j) Continuing from the end of Scenario 4 (a), if the aggressive mode is turned on, VWAP will converge the order down at 250 and fully execute 8000 shares as the logic (S1) and (S2) are suppressed. Scenario 6: Modifying Order Quantity Factor c in Existing Scenarios (a) Continuing from the end of Scenario 1 (d), suppose Order Quantity Factor c is modified to 0.1. Then checking (B2), A’ + Q = 4000 > 2000 = 0.1 × 20000. VWAP will converge the order up at 251 and fully execute the 4000 shares. (b) Continuing from the end of Scenario 1 (e), suppose Order Quantity Factor c is modified to 0.1. Then checking (B2), A’ + Q = 4000 > 2000 = 0.1 × 20000. VWAP will converge the order up at 251 and fully execute 4000 shares. (c) Continuing from the end of Scenario 2 (a), suppose Order Quantity Factor c is modified to 1. Then checking (B2), A’ + Q = 23000 > 20000 = 1 × 20000. VWAP will converge the order up at 251 and fully execute 8000 shares. (d) Continuing from the end of Scenario 3 (d), suppose Order Quantity Factor c is modified to 0.1. Then checking (S2), B’ + Q = 4000 > 2000 = 0.1 × 20000. VWAP will converge the order down at 250 and fully execute 4000 shares. (e) Continuing from the end of Scenario 3 (e), suppose Order Quantity Factor c is modified to 0.1. Then checking (S2), B’ + Q = 4000 > 2000 = 0.1 × 20000. VWAP will converge the order down at 250 and fully execute 4000 shares. (f) Continuing from the end of Scenario 4 (a), suppose Order Quantity Factor c is modified to 1. Then checking (B2), A’ + Q = 23000 > 20000 = 1 × 20000. VWAP will converge the order up at 251 and fully execute 8000 shares. Page 16 of 17
  • 17. 2 Authorization of Business Requirement By signing at the space below, BROKER agrees that the requirements and the corresponding logic stated in this document, FS_ALGO_1401_VWAP Customizations - Order Logic on Best Quantities v0.3, fulfil the customization requirement on the recent version of VWAP. For the Client: Name: Position: Date: Signature: For the Supplier: Name: Position: Date: Signature: For the Client: Name: Position: Date: Signature: For the Supplier: Name: Position: Date: Signature: For the Client: Name: Position: Date: Signature: For the Supplier: Name: Position: Date: Signature: Page 17 of 17