Jun 19, 2009 - price discovery is an order that can be executed imme- diately at ... rent state of the order are process
JOT_Cover:Layout 1 8/6/09 6:19 AM Page 1
JOT
R:Layout 1
LMER
SUMMER2009VOLUME4NUMBER3
W W W. I I J OT. C O M
19-06-2009
22:52
Page 30
Algorithmic Trading: A Primer MAX PALMER
he recent turmoil in equity markets
T
Sponsored by or of Algorithmic has called into question existing at FlexTrade practices. One area under review is Inc. in Great the role of computer-controlled or Y. algorithmic trading in meeting the needs of @flextrade.com
EVOLUTION OF ALGORITHMS: HOW DID WE GET HERE AND WHERE ARE WE GOING?
Goldman Sachs | UBS Investment Bank buy-side traders. Algorithm usage grew apace until recent volatility made some traders more comfortable working orders “by hand.” In light
of Influence | iijournals.com Initially, broker/dealersThe and Voices technology firms, such as execution management system vendors, provided trading algorithms as a means of enhancing productivity and providing value-
IIJ-JOT-PALMER:Layout 1
19-06-2009
22:52
Page 30
Algorithmic Trading: A Primer MAX PALMER
MAX PALMER is a director of Algorithmic Solutions at FlexTrade Systems, Inc. in Great Neck, NY.
[email protected]
he recent turmoil in equity markets has called into question existing practices. One area under review is the role of computer-controlled or algorithmic trading in meeting the needs of buy-side traders. Algorithm usage grew apace until recent volatility made some traders more comfortable working orders “by hand.” In light of this, one might wonder about the future of algorithmic trading—have we reached a peak? In this article, we step back and, while addressing the aforementioned question, focus our attention on giving the buy-side trader an understanding of how algorithms are constructed, the assumptions they make, and how they operate. Our goal is to help the buy-side trader be a better consumer of trading algorithms. While our survey is not comprehensive, we aim to inform through illustration and assist traders who are new to algorithmic trading, or not yet comfortable in selecting from the broad range of offerings in the marketplace. Properly used, algorithms can increase the productivity of the buy-side trader. And they are here to stay. It is practically impossible in today’s equity markets to not use an algorithm of one sort or another—even when working orders by hand. Let’s first take up the question asked above: Has the volatility of the past year presaged the peak in algorithmic trading?
T
ALGORITHMIC TRADING: A PRIMER
EVOLUTION OF ALGORITHMS: HOW DID WE GET HERE AND WHERE ARE WE GOING?
Initially, broker/dealers and technology firms, such as execution management system vendors, provided trading algorithms as a means of enhancing productivity and providing valueadded capabilities to their products and services. Then, in 2005, the SEC introduced Regulation National Market System (Reg NMS), which all but guarantees a future for trading algorithms. It did this by creating a common regulatory framework for equity markets conducive to the use of electronic trading and algorithms. Prior to Reg NMS, there had been an ongoing discussion in the trading community about which type of market structure was better: order driven or quote driven markets. The former had the advantage of providing certainty of execution. If your order got to the displayed bid or ask first (depending on whether you were a seller or a buyer), then you got an execution. Quote driven markets did not always provide the same level of execution certainty, but provided an opportunity for price improvement. Each side had its advocates. In Regulation NMS, the SEC promulgated a rule, known as Rule 611 or the Order Protection Rule, which resolved this issue. The Order Protection Rule states that only those limit orders that are “immediately and
SUMMER 2009
IIJ-JOT-PALMER:Layout 1
19-06-2009
22:52
Page 31
automatically accessible” via an Immediate or Cancel (IOC) order will have their prices protected (i.e., cannot be traded through).1 In addition, an order is not deemed to be immediately and automatically accessible if there is manual intervention in the order, a hallmark of quote driven markets. The regulatory motivation behind Rule 611 was clear: the SEC believes the foundation of price discovery is an order that can be executed immediately at a known price. The impact was felt among all U.S. markets, though some continued to provide manually operated quote driven markets in addition to order driven capabilities. Why do order driven markets and Reg NMS favor electronic trading and algorithms? In order driven markets, the “priority of place” afforded to participants on a trading floor (or quote driven market) is diminished. Now orders may be entered into U.S. markets from anywhere in the world and, if they create the top-of-book quote in the market, are afforded price protection. This democratization of access to the market favors not only trading algorithms, but also buy-side firms seeking greater control over their orders. The specific nature of Rule 611, that quotes must be immediately and automatically accessible, also engenders use of algorithms as this execution framework is easily incorporated into a trading program. Orders can be sent (as IOC) with the knowledge they will be immediately executed (full or partial) and/or given an out. Equally important are the effects of Reg NMS on U.S. markets. For the first time, U.S. markets operate under a common regulatory framework for trade execution. This leveling of the playing field has unleashed competition in which every exchange attempts to differentiate itself and grab a greater share of trading volume. Some differentiate on price. Some differentiate on speed of order handling and execution. And as the roundtrip time to process an order and match a trade has plummeted,2 it has fostered a new breed of electronic traders who move rapidly into and out of markets. As a result, the overall pace of the market has increased with price moves occurring in increasingly shortened periods of time. In such rapidly moving or trending markets, algorithms provide a way to keep up. Of course, as competition grew among the markets, so did fragmentation.3 This creates a need for re-bundling liquidity now dispersed among the 11 national securities exchanges and a handful of ECNs. Smart Order Routers (SORs) provide this functionality, simultaneously accessing
SUMMER 2009
liquidity at all venues displaying quotes equal to or better than the customer’s limit price. SORs are the most commonly used algorithm and have become increasingly sophisticated in divining where to access liquidity. SORs are an algorithm that almost every trader will need and use. There is no other way to rapidly and comprehensively access liquidity. What lies ahead? The technology arms race in execution markets and trading algorithms continues, though perhaps at a diminished rate given current resource restrictions. Exchanges continue to vie for market share, with some already offering SOR functionality. Orders sent to their market first scan their own book, with any remaining shares forwarded to other markets displaying quotes that meet the limit price of the order. So algorithms are here to stay. Given that they remain a fixture of the trading landscape, how best to use them? We begin with anatomy. ALGORITHM ANATOMY: HOW MANY MOVING PARTS ARE THERE?
The marketing monikers vendors have given to their algorithms are colorful descriptives of forces acting in unknown ways to execute orders. Yet all algorithms are built on a common framework. The starting point—and the key to every algorithm—is the performance criterion or benchmark. The benchmark is the bogey against which the algorithm works. It may be defined by the user, e.g., a limit price, or it may be defined relative to trading in the market (e.g., be 10% of volume or slice the order evenly over the next hour). It may also be a tradeoff involving multiple variables, such as in arrival price algorithms that minimize the market impact of trading now vs. the likelihood that the stock’s price drifts away from you the longer you wait to act. All told, the key to algorithm usage is to select one whose benchmark matches your objective in executing the order. The benchmark, along with other inputs, feeds the algorithm engine. This is where inputs, data, and the current state of the order are processed to decide upon the next action. Many algorithms incorporate historical data, by which we mean any data not arriving in real time into the application. Some of this data may be from prior trading days, such as used in VWAP algorithm, or it may be as recent as what went on in the market in the last few seconds, such as used by SORs. If the engine decides that
THE JOURNAL OF TRADING
IIJ-JOT-PALMER:Layout 1
19-06-2009
22:52
Page 32
a street order should be placed in the market, or that an existing street order should be replaced or cancelled, there is a component of code, the execution logic, that decides where to place the order or how to modify the existing open orders. Trading algorithms run in data driven mode. That is, they react to and process each piece of input to the program, and it is this data that drives the execution of the algorithm. By far, the largest amount of this data is information from the markets in the form of quotes, trades, and information on the algorithm’s street orders (such as fills, outs, cancels, etc). Of late, algorithms have also begun to process real-time news feeds in digital format. And many algorithms are designed to also accept manual input (e.g., a change in an operating parameter of the algorithm). See the Exhibit for a schematic diagram showing the various components and inputs/outputs of a trading algorithm. PEERING UNDER THE HOOD: WHAT SHOULD I WATCH OUT FOR?
To the extent possible, one should understand the assumptions and models within an algorithm. Why? Because those assumptions and models, which control the operation of the algorithm, may not apply today to the order on your desk. It is not always possible to learn this about each algorithm you use; some firms view their models as proprietary (but you should always ask). Yet many commonly used algorithms use assumptions and models that are widely described in the literature. For example, Volume Weighted Average Price (VWAP) algorithms work from a framework of historical patterns in
intraday trading volume. Other algorithms, such as arrival price, use a mathematical model for the evolution of stock prices and measuring risk. Following are two common mathematical models used in a broad range of algorithms. Mathematical Assumptions and Models
The most common mathematical assumption underpinning financial models is log normality of stock returns.4 This assumption implies that the random fluctuations in the price of a stock (or sector or index) taking place over successive intervals of time during the day are independent of each other. This assumption is used in pricing derivatives, calculating Value At Risk (a commonly used measurement of risk in a position or portfolio), and popular and common trading algorithms in use today. Why is this model used in finance? First, it has been found to accurately model a wide range of randomly occurring phenomena.5 Many view the fluctuations in stock prices as random and therefore fitting the model. Second, it yields results that are easy to compute. Log normality generally provides what are known as “closed form” solutions that are easy to calculate. For financial modelers, this is a double win. However, there is ample empirical evidence that this assumption does not always hold. There are too many days or events in which the returns—positive or negative—are very large for log normality to always hold.6 Does this mean that algorithms and risk measures using this assumption are not of any value? Not necessarily. It does mean, however, that the trader must understand when the assumption may or may not hold.
EXHIBIT Algorithm Components
ALGORITHMIC TRADING: A PRIMER
SUMMER 2009
IIJ-JOT-PALMER:Layout 1
19-06-2009
22:52
Page 33
When might it hold? If the market in a stock is adequately balanced between a large number of buyers and sellers, with active and balanced participation by both, then the log normality assumption seems reasonable, reflecting the back-and-forth action between buyers and sellers. If, on the other hand, there are distinctly more buyers than sellers, or the other way around, then the assumption does not seem reasonable. This can happen, for example, if there is breaking news in the stock today. Or it can happen on a market-wide basis on days when there is a large and sustained move in one direction. Log normality is also not a reasonable assumption if the amount of stock that you need to trade within the allocated time interval is a large percentage of the average volume traded in that interval. For example, if you are handed an order to buy or sell 50% of average daily volume in a mid-cap name with limited liquidity, and you are expected to complete the order today, using an algorithm that assumes log normality may not be appropriate.7 Another mathematical technique widely used in algorithms is that of statistical correlation. This technique analyzes historical data over days or as frequently as seconds, and looks for measured quantities that are highly correlated to each other. These measured quantities may be stock prices, economic indicators, or any numerically valued quantity. If, for example, an analyst discovers that the prices of two stocks are correlated to each other, then there is the basis for a trading algorithm in that relationship. If the price relationship between the two stocks deviates from the observed norm by a certain amount, then an algorithm might short the expensive stock and buy the cheap stock in the expectation that the two stock prices will revert to their historically observed relationship. This is an example of a pairs trading algorithm. Statistical correlations have been used for years in a wide range of algorithms and are the basis for many trading strategies. In particular, statistical correlation is at the root of VWAP algorithms. If one observes that a stock has historically traded 10% of its daily volume in the first half hour of trading, then a VWAP algorithm assumes it will do so again today. Smart Order Routers also use statistical correlation, though over much shortened intervals, to determine the likely location of liquidity in the markets. The problem with statistical-correlation-based algorithms is that there are often unanticipated jolts that cause the correlation to break down. At that point, the expectation of a reversion to the norm is destroyed and a new norm or perhaps even an absence of the historically
SUMMER 2009
observed correlation sets in. The buy-side trader should know if the algorithm he is about to use employs statistical correlation, what that correlation is, and whether that correlation still holds today for the order at hand. This is not as difficult as it may at first seem. For example, on earnings announcement days, or when a company releases marketmoving news intra-day, the historically observed patterns in intraday trading volume will likely differ from that of the current day. It may not be the best day to use a VWAP algorithm, unless it adapts to changing trading patterns. The bottom line is not that one should or should not use an algorithm because of the underlying assumptions or models contained in an algorithm. Rather, the buy-side trader should know as much as possible about these assumptions and models, and whether they apply today to the trades on your desk and current market conditions. QUESTIONS YOU SHOULD ASK/THINGS YOU SHOULD KNOW
Of course, there are topics of interest to the buyside trader not encompassed by models and assumptions. They have to do with practices. Following are answers to possible questions they may have about what happens to the order after it is submitted to a vendor’s algorithm server. Who will see my flow on trade date and subsequent days? Can I control with whom my flow will interact? Most broker/dealers offering trading algorithms offer a wide range of execution services. For example, some operate their own dark pools. Brokers have a range of customers, some of whom may not represent “natural” flow. And brokers also have a large group of employees providing technology, back-office, and other services to their customers. Buy-side traders typically have orders of size and are focused on minimizing the “footprint” their orders leave in the market. As a result, there are natural concerns about what happens to their orders after they enter the algorithm server. Buy-side traders should ascertain who gets to see their orders. Anonymity is important, especially given that many orders require multiple days to complete. The identity of the order and the customer must be protected through trade completion and beyond. Traders may also wish to control with whom and where their order flow interacts. Can they dictate that the order should or should not access dark pools? Can they specify that their orders only interact with other natural flow? While all desire anonymity, the interests of buy-side
THE JOURNAL OF TRADING
IIJ-JOT-PALMER:Layout 1
19-06-2009
22:52
Page 34
firms will vary in answer to these questions. Many algorithm vendors are able to tune where your street orders go and with whom they will interact. How does the execution logic of the algorithm work? Does it create signaling in the marketplace? When does the algorithm post for liquidity and when does it remove liquidity? It is one thing to remain anonymous within the confines of the algorithm vendor. It is equally important that your order remain undetected in the market. That is, it should not signal to other market participants what your intentions are. How does that happen? Execution logic that is inflexible and repeatable creates a pattern that can be detected in the market. This is not an issue where one bids for 1,000 shares of QQQQ or SPY every minute. Those orders are lost in the much larger volume transacted in those names. On the other hand, as liquidity decreases, regularly placed orders definitely signal other participants. Other execution patterns that create signals include the use of pegging orders8 and large display sizes. There is also discussion today about whether posting itself creates too much of a signal. There are classes of algorithms that focus on removing liquidity or posting in a non-displayed manner. Posting vs. removing liquidity has economic consequences of interest to the buy-side trader. Most U.S. equity markets follow a “maker/taker” model. In this model, traders who post for liquidity are paid a rebate (generally in the area of 20 mils/share or $0.002/share) and pay in the area of 30 mils to remove liquidity. These prices may vary according to volume discounts and to price promotions at a given market, but they serve as a good benchmark. There is a difference of a 1/2 penny per share between posting for liquidity and removing it. With the prices of many algorithms now under a penny per share, one readily sees the economic consequence to the algorithm vendor of using one type of order vs. the other. The buy-side trader should assure herself/himself that the algorithm uses the order type that is appropriate to the benchmark and order, and that the algorithm always executes in the best way possible at any given moment without regard to execution costs. WHEN DO I USE AN ALGORITHM? HOW DO I SELECT AN ALGORITHM TO EXECUTE A GIVEN TRADE?
These, of course, are the real questions to which the buy-side trader wants an answer. Regrettably, there is no
ALGORITHMIC TRADING: A PRIMER
simple checklist. If we have achieved our purpose, buyside traders know that intelligent use of algorithms comes with an awareness of their benchmark, their model, and the practices of their vendor. With these in hand, and with the knowledge gained from using algorithms, the buy-side trader can be just as comfortable in selecting algorithms for a trade as in choosing a sales trader to work a trade. Of course, there are some situations where the use of an algorithm strikes one as a natural choice. If one is looking to quickly access liquidity at a given price point, the best solution is a SOR. If one needs to manage relationships among multiple orders at once, then an algorithm is the only realistic way to do so. If the benchmark from the portfolio manager for executing the trade requires participation throughout the trading day in response to market conditions, then an algorithm may be the easiest and best way to handle the order. In terms of selecting the right algorithm for the trade, match the trade objective to the benchmark of the algorithm. Factor in the conditions of the market that day and in that stock to be sure that the conditions underlying the algorithm hold that day. When these line up, that is likely to be a good choice. As the trader gains experience using algorithms for different types of orders and under different conditions, then these decisions will become second nature. At that point, the algorithms perform their true function: to increase the productivity and results for the buy-side trader. ENDNOTES 1
Strictly speaking, it is only the top-of-book quotes in National Securities Exchanges and the Alternative Display Facility (ADF) that are protected. 2 It is now well below human response time. 3 There are no barriers in the United States to trading any stock in any market. As of this writing there is no listing exchange in the United States that can lay claim to 50% or more of trading in its listed names. 4 There are other closely associated terms, such as random walk, Gaussian process, Brownian motion, and white noise. All are alike in the independence of their movements over time. 5 In a paper written during his annus mirabilis, Albert Einstein used this mathematical model to describe the movement of particles suspended in liquids and gases. 6 These large-return days are at the root of reports appearing in the press about “large sigma” events. A sigma refers to a standard deviation of the distribution. It is a measurement of dispersion of observed events around the mean. When one
SUMMER 2009
IIJ-JOT-PALMER:Layout 1
19-06-2009
22:52
Page 35
sees these reports of “large sigma events,” it is not so much that the market is behaving unusually—after all, these events do occur with some frequency. It is more that the shortcomings of the underlying model are exposed. 7 More precisely, the performance result obtained from using the algorithm that day may not be appropriate. The trader may nonetheless decide to use the algorithm to trade the order.
SUMMER 2009
8
If you peg, as a buyer, beware of sellers who bid higher than you in order to move your bid up, then hit your bid and cancel theirs.
To order reprints of this article, please contact Dewey Palmieri at
[email protected] or 212-224-3675.
THE JOURNAL OF TRADING