Algoritma Trading Populer
The following is a very sparse list of mainstream algos currently in common use (mid-2010). One should point out that the prime function of most current algos is to ‘get’ the trade without market impact, anonymously, rapidly, without being ‘front run.’ Making an immediate profit on the trade is not of first importance to Tier 1 companies as most of these trades are of longer duration. Only the so-called ‘high frequency’ traders who use the technology to their main advantage by minimizing the ping time to the Exchanges and are happy with a couple of basis points per trade are ‘immediate profit oriented.’ Their operations are held strictly confidential and have caused a certain amount of controversy and regulatory interest.
Algos for the use of individual traders are designed to provide immediate returns
VWAP – Volume Weighted Average Price
This is probably the oldest and most used algo. It is often used as a benchmark by the Buy side placing orders with the Sell side. We shall therefore provide a more detailed treatment of VWAP than of the other algos that follow. It has a large number of variations designed to accomplish specific tasks and we shall concentrate on it to explain some of the various tweaks and variants that may be implemented.
The VWAP engine uses real-time and historic volume data as a criterion to size the slicing up of large orders over a set period of time or throughout the trading session with respect to the stock’s liquidity. The trader specifies the number of discrete time intervals (sometime called waves) for the algo to trade a quantity of shares which is directly proportional to the market volume in the time slice.
Often the main challenge is to make trades throughout the day which track the VWAP. With such orders, which must be worked over several hours, the automation of a VWAP algo provides meaningful manpower cost savings. Therefore the VWAP strategy is most often used on longer duration orders.
VWAP is very often used as a benchmark for block trades between the Buy side and the Sell side.
The slicing up of large orders into many smaller ones improves the chances of reducing the risk of market impact cost. It also helps making the order size invisible to other market participants.
The volume profile calculation and prediction together with the real-time actual volume govern the size and frequency of the orders put on by this strategy. The frequency is worked so as not to be ‘recognizable’ by a market competitor, as is the volume of each order wave to reduce the chance of being ‘front run.’
Due to stylistic and ergonomic features of the market it is not unusual for more volume to be traded during the early part and latter part of the session in order not to create an adverse impact on the price.
The basic formula to calculate VWAP is:
Pvwap = Σ(P ∗ V)/ΣV
where
Pvwap = volume weighted average price P = Price of each trade and
V = is the volume of each trade.
This basic algo has many variations which have been developed by the Tier 1 users over time, some tweaks being proprietary to specific entities and held very confidential. For example what lookback period we use for the VWAP calculation and various ‘tweaks’ to depart from the plain vanilla algo such as constraining execution price, or, more frequently constraining volume.
VWAP strategies may be implemented in a number of ways. The order may be sold to a broker who will guarantee VWAP execution on the day. (He will charge a fixed agreed upon commission in return.) Another way would be to take the trade directly through an automated participation trading algo which will slice up the trade and participate proportionately to the current volume in the market with hopefully as little market impact cost as possible. Again one must be careful of being ‘discovered’ and front run. More variations are constantly being tested and the basic implementation is being refined.
Orders can be sent to the market according to a preselected strategy – for example we can send waves into the market according to the well-known daily ‘volume smile’ where there is more activity at the start and at the end of the trading session.
In all cases we must be aware that we are dealing with a moving target – the volume pattern of a stock on any particular day may vary substantially from its average. It even depends on what type of average we use, and how long its lookback period is.
The volume distribution time function varies considerably between different stocks – more variation is experienced with thinly traded stocks both intraday (during the course of the trading session) and EOD (End Of Day), and predicting anything from historical volume data for a thinly traded stock is a dicey enterprise indeed.
For those interested in the source code for VWAP, there is an article by Andrew Peters on the website www.codeproject.com which gives an interpretation. As we have mentioned, the actual code on any algo implementation used by any particu- lar Tier 1 company is a well-kept secret as each company invariably makes small changes to suit their individual requirements as well as to improve the anonymity of the algo.
TWAP – Time Weighted Average Price
This algo strategy simply divides the order more or less evenly over a user specified time frame. Usually the order is sliced up equally into a specified number of discrete time intervals, or waves. Though convenient this may expose the trader to other market participants’ ‘sniffer’ algos which search for just this kind of predictability in a competitor’s trading and quickly take advantage of it by ‘front running’ it. This is often combated by leaving out a wave or using a ‘fuzzy’ time interval spacing or even a ‘fuzzy’ number of shares per wave. The more sophisticated (or more paranoid) trading desks use a random number generator ...
POV – Percentage of Volume
The main target here is to ‘stay under the radar’ while participating in the volume at a low enough percentage of the current volume not to be ‘seen’ by the rest of the market. The rate of execution to trade up to the order quantity total is kept proportional to the volume that is actually trading in the market. This provides a certain amount of ‘cover’ especially when trading a large quantity of shares.
‘Black Lance’ – Search for Liquidity
This menacingly named algo is designed to find liquidity in so-called ‘Dark Pools.’ This is accomplished by ‘pinging’ the many different venues and analyzing the responses to determine the level of liquidity available in the issue of interest.
The Peg – Stay Parallel with the Market
The PEG algo sends out limit orders, randomizing the fraction of the total order and follows the market, very similarly to a trailing order.
Iceberg – Large Order Hiding
Here we try to hide a large order from the other market participants to avoid them ‘front running’ it and generally to minimize market impact cost when we are trying to accumulate a significant position in a particular stock. This is done by slicing the
order into many smaller segments and randomizing the order placement. Smaller orders hopefully improve the chance of avoiding market impact cost. There is a limit order version of Iceberg which can be deployed over longer time periods.
Most of these major algos are used by institutions shifting huge amounts of stock. Just making the trade safely without being ‘front run’ takes priority over making immediate profitable returns. Anonymity rules.
This is in total contrast to the individual trader with limited capital where immediate profit has to be realized and the size of trades is small, in the region of 1000 shares per trade with a very occasional 2500.
Algos for the individual trader are therefore quite different from those we have described above. We call them ALPHA ALGOS and, as already mentioned, we shall describe exactly what we mean by that in Part II where we shall be dealing exclusively with these algos which are specifically designed for the individual trader.
There are a large number of variations derived from the basic trading algos. Some trading problems are more amenable for solution by one algo variant than another, some can only be solved by a very specific algo implementation. We have selected from the multitude a few algos just for reference and to feed the creative instincts. Here are a few more.
Recursive Algos
Recursive algos ‘call’ themselves over and over again until a preset condition is met. We are told that the famous Buddhist ‘Towers of Hanoi’ can be solved by a recursive algo. We have not tried it ... as myth has it that when the monk in charge of the golden disks in a Buddhist monastery moves the last disk over to its final resting place this will signify the end of the world. Can’t risk it!
Serial Algos
These algos are really a set series which executes on a computer serially, the algos are set up to follow one another possibly with some logic control to provide branching.
Parallel Algos
These algos make use of multi-core computer architecture and are able to execute multiple instructions simultaneously.
Iterative Algos
These use repetitive constructs like ‘if ... then,’ ‘Do while,’ ‘for ... Next’ to control execution flow similar to those available in programming languages, usually with some parameterizable values to test and make ‘decisions.’
Pair Trading Strategy
We will now have a look, in some detail, at pair trading strategies which initially provided the main impetus to algorithmic trading. The fundamental one we shall describe bears little resemblance to the sophisticated versions used by statistical arbitrageurs.
As volatility has increased not only at the individual stock level but also in the overall market swings becoming more drastic in the recent past, even without the earthquakes of potential market meltdowns which we have experienced in 2008, it has again become very attractive to find a ‘market neutral’ strategy.
Pair trading is market-neutral by its very structure as its operation does not depend on the direction of the market but on the correlative and anticorrelative behavior of the stock being traded.
Nunzio Tartaglia, while at Morgan Stanley, found that certain stocks, usually in the same sector and industry, showed strong correlation in their price movement. He therefore reasoned that any departure in the pattern of co-movement of the two stock prices would revert back to ‘normal’ over time. This conjecture proved to be correct and was worth a king’s ransom to Wall Street for the next 20 years.
When the correlated stocks started moving in opposite directions the strategy was simply to short the out-performing one and long the under-performing one.
The conjecture continues with the thought that the two stocks will exhibit a re- version to the mean type behavior and converge back to moving parallel. When this happens we obviously close out the trade with two profits.
An important point often missed in this strategy is that it is rock solid market- neutral as we have a short and a long position in place so that whatever the market does we are immune to it. (One of the occasions where risk again enters the picture with a vengeance is when one of the pair suffers a liquidity crisis and you cannot close out the trade.)
To trade a pair strategy we have to find two stocks which are highly correlated over our lookback period. The algo will watch out for their movement out of the security envelope and once the deviation crosses the trader’s preset limit will go into action. It will monitor progress (sometimes for quite an extended time period, such as days or even weeks) and when the prices revert to their normal correlation it will close out the trade.
Let us always remember to give credit where it is due: The pair trading strategy, as previously mentioned, was designed by a team of scientists from different focus areas such as mathematics, computer sciences, physics, etc. who were brought together by the Wall Street quant Nunzio Tartaglia who was the main driving force of the team.
In the 1980s Gerald Bamberger popularized this strategy as he headed the team of quants at Morgan Stanley. His team, along with Nunzio Tartaglia, proved beyond any reasonable doubt that certain securities, often competitors in the same sector, were correlated in their day-to-day price movement and they started putting their money on it with incredible success.
A useful website which has correlation information for use in the selection of pair trading candidates and also shows the topological relationship between stocks re- searched by Professor Vandewalle at the University of Liege is: www.impactopia.com. We have found that Vandewalle’s topological displays of stocks provide a visual map similar in many cases to our cluster analyses. XY scatter charts add clarity. This can be helpful in selecting cohorts of similar stocks with the conjecture that stocks with similar metrics will trade in a similar fashion.
Sumber : Edward LeShik and Jane Cralle
