presentation ccfea london stock exchange sets simulator and exercises on how to implement automated...

49
Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer School Program 2008 (1-19 September 2008 ) High Frequency Finance (HFF) and Electronic Trader Training (ETT) Professor Sheri Markose Director CCFEA University of Essex Assisted by CCFEA students: Azeem Malik, Simone Giansante, Nivesh Pawar, Shaimma Masry and Pankaj Shah Centre for Computational Finance and Economic Agents and Economics Department

Post on 20-Dec-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Presentation

CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies

CCFEA/i4MT Summer School Program 2008 (1-19 September 2008 )High Frequency Finance (HFF) and Electronic Trader Training (ETT)

Professor Sheri MarkoseDirector CCFEAUniversity of Essex

Assisted by CCFEA students: Azeem Malik, Simone Giansante, Nivesh Pawar, Shaimma Masry and Pankaj Shah

Centre for Computational Finance and Economic Agents and Economics Department

Page 2: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

ROAD MAP OF TUTORIAL

1. Introduction HISTORY: Challenges from Electronic Trading New interdisciplinary area referred to as computational

market microstructure at forefront with electronic financial markets and automated trading.

2.The CCFEA SETS Multi agent simulator Project 3. Objective pursued here to test bed algo strategies .a

VWAP and advances on VWAP Pairs Trading

Page 3: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

INTRODUCTION: Potted History of E-Fin Markets

• Pre www era markets were a given from venerable forms lost in the mystery of time

• Continuous double auction trading facilitated primarily by a market maker or specialist system has had a long tradition

• Post www era with its electronic financial markets and automated

trading : E- markets can be designed

• Rapid decentralized and global access to e-trading platforms • Challenges to floor-based centralized exchanges and restrictive

practices of established intermediaries • E- online order submission began in the mid 1990s • Early 1990’s, NYSE and LSE hybridize floor-based market maker

based continuous double auctions by replacing open outcry by an automated screen based quotation system and execution of best price. LSE SEAQ

Page 4: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Recent Developments

• 1/3 of all US stock trades in 2006 were driven by automatic programs and by 2010 claimed to reach 50%. In 2006, at the London Stock Exchange over 40% of all orders were entered by so called algo traders and 60% is predicted for 2007. Futures and options markets amenable to e-trading and both foreign exchange and bond markets are moving toward this.[1]

• Practitioners expending very large budgets on IT based trading systems in order to cope with the optimal limit and market order scheduling in a very fast and complex environment of the electronic limit order system

• Algo trading in stat-arb and VWAP strategies

• Competitive co-evolution : Trading algorithms called Guerrillas , Snipers and Sniffers

• [1] The electronic derivatives markets include Eurex, Globex, Matif while those for fixed income securities are eSpeed, Euro MTS, BonkLink and BontNet.

Page 5: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

1.2 The new trend of computational market microstructureDEBACLE OF NO TRADE RESULTS OF TRADITIONAL FINANCE

WITH GROWING TRADING VOLUMES

●Assumption :Fully optimizing traders necessary for efficient markets and the postulation of the possibility of a homogenous rational expectations HRE not tenable.

●The impossibility of a HRE in financial markets where profits arise from being contrarian : Arthur (1991,1994) highly influential vignette of the El Farol/Minority game

Self-referential and contrarian decision problems typical of financial

markets: DEFY a unique, homogenous and effective procedure for finding solutions and hence deduction in forecast rules to determine the winning strategy, Markose (200

●Endogenous heterogeneity in expectations and strategies among

initially identical agents Red Queen type arms race in technology that is already evident in the IT

innovations of trading in E- markets

Page 6: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

HIA and Multi-Agent Models

●New paradigm of heterogeneous interacting agent models (Reviewed in Markose, Arifovic and Sunder (2007))

●Zero intelligence traders Gode and Sunder (1993). Fully

optimizing traders not necessary for efficient exploitation of gains from trade; the onus on robust trading rules and institutional design.

●Markose et al (2007) and Markose and Sunder (2007 c) “model verite ” in artificial models : represent real time data with no simplifying assumptions. The historical simulator of the actual SETS1 data and the agent abased replica of the same fall into this category of models.

Page 7: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

1.3 NEW HIGH FREQUENCY FINANCIAL ECONOMETRICS FOR IRREGULARLY ARRIVING MARKET EVENTS WITH

AUTOCORRELATION/CLUSTERING

• New trend with Biasis et. al. (1995) investigate the ELOB system as is. New high frequency financial econometrics have highlighted statistical properties of market events in at least three different ways

• Engle and Russell (1994) ACD models : the clustering in trade duration (time between trades), with short trade durations implying fast markets.

• Dufour and Engle (2000) they find that as time duration between trades decrease, the price impact of trades decrease and spreads decrease.

• Extensions to multivariate models with ACI models (see, Hall and Hautsch, 2004). The ACD/ACI models point to a fundamental persistence or the clustering first observed in trade durations can lead to predictability and the design of trading strategies.

• ACI models can tackle multivariate analysis; Hall and Hautsch (07) develops 6 dimensional model; Vasco Leemans (2007) analyses 12

dimensional model

Page 8: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Second class of models Econometric testing of Market Micro-Structure ( MMS)

• Based on explicit theoretical models of order placement (Sandås (2001))or an informally stated hypothesis (see, Ellul et. al. 2007 ) then conduct econometric tests with ELOB data.

• Sandås (2001):The model based estimates are found to yield a flat market impact function relative to the data driven estimates for the same.

• Hasbrouck (2007) gives the most up to date discussion of the econometric approach for the testing of hypothesis relating to market microstructure.

●The third class of empirical studies of LOBs Dacorogna et. al. (2001) as well as Bouchaud et. al. (2006), Farmer

et. al. (2003), Gabaix et. al. (2003) and Eisler et al. (2007) highlight certain fat tailed properties of (limit) order price changes.

As yet no consensus of the size of the power exponent on price changes: Farmer et. al. find power law price impact function of 0.25, Gabaix et. al report 0.5.

Page 9: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

SELF-REFLEXIVITY IN PRICES

• Arthur et. al. (1997) they make a case for heterogeneous multi-agent models where each agent uses genetic algorithms to arrive at future price predictions.

• Why Artificial Stock Markets With Adaptive Learning Agents? • (i) Price determination is reflexive and arises from how stock market

prices are based on agents expectations of the price .Self-reflexivity :• That is, the price at t+1 is based on strategies of agents, bit (to buy or

sell) based on their respective beliefs, on the price at t+1.• The implication of this self-reflexive structure: is that there is no • there is no unique way in which agents can form expectations of

the price.• Most ASMs have agents who are heterogeneous in how they form

price forecasts. • In Arthur et. al. (1997) they make a case for heterogeneous multi-agent

models where each agent uses genetic algorithms to arrive at future price predictions.

Page 10: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

HAMS: TREND FOLLOWERS and Contrarian Fundamentalists

• HAMS include popular archetypes :

• Trend followers (who accentuate the direction of historical prices)

• Fundamentalists (who effectively implement the contrarian strategy by selling when the market price goes above a threshold and buying when it goes below)

Page 11: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

1.4 The demise of traditional ‘informed’/’uninformed’ trader models

• View of trading : critiqued by Rosu (2006) Over representing the arrival of new information and on the

asymmetry of information among traders as the main drivers for trades and their role in explaining features such as price impact and changes in the bid-ask spreads.

• Glosten and Milgrom (1985) and Kyle (1985), so called informed and uninformed traders interact and increased spreads arise because market makers or liquidity providers need to protect themselves from informed traders who aim to trade large volumes as directed by their knowledge of the true value.

• In a dynamic price setting Easley and O’ Hara (1992) find :Spread is an inverse function of trade durations The absence of trades and the low volume, in this theory, imply high

probability of no information (or less asymmetry of information) Hence risk of adverse selection faced by liquidity providers decreases

and with it the spread.

Page 12: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Easley and O’Hara (1992) result contradicted

• By empirical ACD based Dufour and Engle (2001) analysis that spreads fall under brisk trading conditions with short trade durations. Information based theory of trades that a slow market when traders arrive more slowly to the market has smaller spread, has seriously damaged its empirical validity in view of serial correlation in trade durations and the fact that more trades occur when spreads are small.

• Laboratory experimental testing by Bloomfield et. al. (2003) of the informed and uninformed trader hypothesis: found negative evidence that informed agents keen to make a speedy transformation of their informational advantage into profits will dominate market orders. Informational advantage did not prevent these agents from making large numbers of limit orders as well.

• With institutional investors, large orders naturally arise from liquidity demands and knowledge of this by other price setting parties in the market will enable them to skew prices against the purveyors of large orders. Following, Rosu (2006) it appears to us that fictions such as ‘informed’ and ‘uninformed’ traders are best abandoned as a useful frame of reference to trading in ELOBs.

Page 13: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

2.5Models of Trader Behaviour

• Focus on optimal order placement strategies within a game theory

framework (see, Parlour (1998), Goettler et. al. ( 2003)) have important insights into conditions that could drive individual traders.

• But they abstract from ingredients of the ELOB for purposes of analytical tractability.

• Optimal order submission strategy models: Simple one of Bertsimas and Lo(2000), to elaborate AI based adaptive learning strategies (see, footnote 7) with Kissel and Glantz (2003) giving a good survey of some the state of the art order placement strategies.

• As yet no consensus as to what information is contained in the LOB !

• Idea first mooted in Berkowitz et. al. (1988) that the best unbiased estimate of the price a certain quantity can be transacted at in any relevant trading period by a randomly selected trader is given by the Volume Weighted Average Price (VWAP) on the relevant side of the LOB book.

• Order book VWAP information available ex ante to a trader• Basis of trader strategy as well as the market price impact function that is

estimated.

Page 14: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Part I : Artificial SETS Simulator

Market Microstructure of ELOB2.1 The LSE SETS1 and transparent ELOB Buy limit orders: bids Sell limit orders: offers or asks

Best Price and Spread : (lowest ask - highest bid) Market depth on each side of the market is the listed the

volumesPrice Priority and time priority (P, V) vector Rank determined by uniquely different price-1 : Competitive 0 : Best 1: 2nd best2: ……..4+

Page 15: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

In SETS1 market orders of a volume greater than the volume at the best price on the LOB is allowed to walk the order

book.

That is, the remaining volume of the market order that remains after execution at best price is converted into a limit order with time priority only if it cannot be fully executed at the 2nd best price and so on further down the order book.

Each of the limit prices at which the market order is executed then assume best price status in quick succession.

• Limit orders once entered can leave the system only if they are matched in a trade, cancellation, modification or expiry. The maximum time a market, limit or iceberg order can sit on the order book is 90 calendar days.

• Iceberg Orders

Page 16: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Objectives of CCFEAE-LOB Project

●ASSUMPTIONS AND BUILDING OF BENCHMARK ELOB SIMULATOR

●EXPERIMENTS : ‘SLOW’ AND ‘FAST’ MARKETS WITH EXOGENOUS MARKET EVENTS

RESULTS FROM ELOB SIMULATOR AND COMPARISONS WITH REAL WORLD SETS LOB DATA FOR A TYPICAL DAY

ACD Signatures and Market Price Impact Functions

Page 17: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Why Build Trading Simulators ?

Prop Trader’s view: Kerr Hatrick (Deutsche Bank)

S easonality and S imulation• What is a good s imulator?

– Algorithmic trader’s definition:• one which, for a particular market, mimics the market as

clos ely as pos s ible, in order that regularities in the market might be taken advantage of by agents us ing the s imulator

• T his means , at s ome s tage, embedding s eas onality, and an impact model, in s ome form

• Other, s impler cons traints - number of trades , depth of orderbook, typical trade s ize – s hould be pres erved, to jus tify the cos t es timates of the algorithm des igner, and allow exploratory data analys is

• P enn-L ehman exchange s imulator: developed jointly by L ehman B ros prop desk (NY ) and Univers ity of P ennsylvania

• Utilizes Is land order book data • Integrates orders originating from different trading

s trategies with Is land data us ing proprietary fill model to assess cost

• F ill model – unfortunately - US centric & opaque

Page 18: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

A Prop Trader’s Wish List for a E-Trading Simulator contd

11

C osting HF T rading S cenarios• K ey P roblem: Difficult to estimate cost

sens itivity of key algorithm parameters• What if I changed the aggres s iveness ?• What confidence intervals can I place on the

impact of my activity with s tealth algorithm X to be?

• At what time would it be best to us e algorithm x?• What algorithm should I use today?

• A s imulator constrained by real-world seasonality would provide the ideal quantitative framework to analyze questions above…• B ut it has to embed knowledge of local market

microstructure in a way that is cons itent with real world impact models , for derived costs to be relevant

Page 19: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Data Base (I)

Rebuild Limit Order Book

E-Platform (II)Merge Client orders with Real Time Historical Data of Limit Order Book using exact SETS Market Micro-structure RulesProvide Real Time Screen Based Information on Traded VWAP; Spreads etc

API (III)Format forClients of e-Plat to send in their Algo trades. In turn receives Trade Confirmation etc

Client Decision Support System (IV)

Queries Data Base (I) using SQL Commands ; Obtains Real Time Feeds from historical Market Data in (II). This data can be used to generate trading strategies and evaluate strategies using the ASM AI based agents

Schema of the CCFEA E-Simulator for a SETS type market : Fully Rebuild SETS

Page 20: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

SETS Data Rebuilding Order Book

Page 21: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

SET Data

Page 22: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer
Page 23: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Simulator useful for testbedding Algo Strategies

• Check robustness over different stocks and over different market regimes (boom/bust)

• We will consider two work horses of algo

strategies and put them through their paces:

VWAP

Pairs Trading

Page 24: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Algo VWAP Strategy: Sell (buy) of X units in a given period T so that the executed

VWAP(e) is (below) than the market Traded VWAP(m)

jj

jjjm

t

V

VP

VWAPk

1=

1==

where jP and jV is the price and volume of thj trade respectively, is the

total number of trades over the interval t0 and tk when over which the strategy is being evaluated.

The algo- trading strategy sell (buy) for this will have the following

pseudo code : Sell (Buy) at the bid (ask) whenever the bid (ask) is greater (less) than the

market ).,(, 0 kjjm

t ttttVWAPj

Page 25: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer
Page 26: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Note in the figures above for BGY, the market VWAP is below the Bid and Ask till about 4pm, so it is a good time to sell as a market order but not so good to buy. For DMG and GSK, with the Bid and Ask below the VWAP, it gives ample opportunities to buy, but not a good time to sell.

Page 27: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Automated : Ask < Market VWAPImpact of 5000 Buy order Size

Fig Price Impact of large volume

Page 28: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Explanation of large volume price impact impact

The figures above shows how the algo VWAP strategy to buy at ask when below market VWAP, responds to a large order size of 5000. The first graph is the market without the algo trade. Note, how the ask jumps up in the second graph, followed by a sharp rise in the bid as well below as the market finds it difficult to absorb the large 5000 size buy order. When failing to find enough volume at best ask, the large buy market order, walks the book, raising the ask immediately and hence the spread. This then makes the algo execution of the 5000 buy order at ask below VWAP no possible and the remainder of the order adds to the buy side by raising the bid.

Page 29: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

‘Advanced’ VWAP Strategies Competition:Buy100,000 shares

over the day and max P/L

• The common complaint re. VWAP is that it

does not ‘optimize’ P/L

Crude VWAP algo does not try and get price

improvements and does not place greater volume at more advantageous prices during the day

Eg: Consider DMGT, whilst buying using crude VWAP one could have bought it through out

Page 30: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

It is hard to ask your broker to do better than VWAP : but you can get an algo to do better

Results on 1st of March, 2007

P/L Ordinary

Vwap Advanced 1

Vwap Advance 2

Vwap BGY (ADV %) -4612.90 -297.25 +2657.50 DMGT (ADV %) -1617.00 -395.00 +190.22

Page 31: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Advance 2 VWAP

Page 32: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Pairs Trading:Simple Take

• Hard to predict directional changes in stock price movements accurately; instead take relative movements

• The pairs trade was developed in the late 1980s by quantitative analysts and pioneered by Gerald Bamberger while at Morgan Stanley. With the help of others at Morgan Stanley at the time, including Nunzio Tartaglia, Bamberger found that certain securities, often competitors in the same sector, were correlated in their day-to-day price movements. When the correlation broke down, i.e. one stock traded up while the other traded down, they would sell the outperforming stock and buy the underperforming one, betting that the "spread" between the two would eventually converge. (Wikipedia)

Page 33: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Trading Pairs

by Douglas S. Ehrman

Pairs trading is a non-directional strategy that identifies two companies (or futures contracts) with similar characteristics whose price relationship is outside of its historical range. The strategy simply buys one instrument and sells the other in hopes that relationship moves back toward normal. The idea is the price relationship between two related instruments tends to fluctuate around its average in the short term, while remaining stable over the long term.

Page 34: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Pairs Trading Using price ratios and algo triggers using (+1,-1)std deviation bands

Page 35: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Ingredients to Pairs Algo: At each cycle/round trip of open and close profit non-negative

• Step 1 take a pair of stocks (BGY trading @ 414 and DMGT @710)

• Fix quantity of cheap BGY at 1000

• Volume of DMGT is then at price ratio 414/710

• Achieves cash neutrality (zero net position) when long in one and short in another

Page 36: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

How to install std deviation bands ?Try a dynamic rolling band

• Track the price ratio for 10 minutes from opening and take (+1, -1) std dev of it

• Project these bands to be the std dev for next 10 minutes

• Enter market as price ratio falls and hits

the -1 std deviation implying expensive stock price has become more expensive and the cheap one cheaper

Reverse position when price ratio hits +1 std dev

Page 37: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Tracking a Trade Cycle: start with buy cheap and sell the expensive then reverse trades at +1 std and price ratio has risen

TRADE CYCLE

Ratio Of Prices Quantity Buy /Sell Price Market Time

Profit n Loss

0.535623 1000 BUY 417.25 10:25:19 -417250 536 SELL 779 10:25:08 +417544

0.539923 1000 SELL 419.25 11:52:42 + 419250

Trading Cycle

536 BUY 776.5 11:52:42 -416204

Net P/L : P/L on BGY (cheaper stock) : 2 p X1000= 2000p = £20

P/L on DMGT (expensive stock): 2.5 p x 536= 1340 = £13.40

If new price ratio is used and 539 is bought of DMGT at 776.5 then outlay is 418533.5 which exceeds what was sold.

Page 38: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Problems with crude price ratio: Use same price ratio in first leg to determine volume of expensive whilst closing !

Consider Reversing by having to sell cheap asset and buy back the expensive one

Price Ratio (Cheap Asset/ Expensive Asset Denominator) has gone up

These are the possibilities

BGY(Cheap) DMGT (Expensive)

Up Down

Up Could lose on the expensive stock

Not applicable as ratio will go down

Down Best outcome Could lose on the cheap stock

Page 39: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Problems in determining theStd Deviation Bands

• Volatile pairs (or price ratios) give you more trading opportunities and profits

• But how does one determine these bands ?

• If one knew the actual std deviation and also the appropriate time window for which to estimate the bands, there are more profits to be had

Page 40: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

PROFIT AND LOSS CHART

Predicted Standard Deviation Actual Standard Deviation

10 Minutes

20 Minutes

10 Minutes

20 Minutes

LAST TRADE PRICE RATIOS SERIES

10540p

6111.5p

16771.5

25578.5p

ASK-BID PRICE RATIOS

-2385.5p

1990.5p

-8110.0p

27614p

Page 41: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Competition: Design a simple rule that will improve on the std dev bands for pairs trading

• Use bid ask prices rather than traded prices to determine price ratios

• Report pairs algo profits at end of day for the same pair of stock in the two teams

Page 42: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Concluding Remarks

• SETS Simulator which is precisely rebuilt from the SETS Order Book Data will give very good test beds for algo strategies

To be able to test out robustness of strategies across stocks and across regimes is ‘priceless’

CCFEA has done extensive precise price impact analysis with sensitivity to time of day/intra day seasonality to help in optimal trade scheduling

Behaviour of order book in market crises eg. August 2007 etc can be analysed in detail via the simulator to play the E-Limit Order Book game better

Page 43: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Pairs Trading: Quantitative Methods and Analysis by Ganapathy Vidyamurthy - 2004 - 230 pages

 

      

     

Trading Pairs

by Douglas S. Ehrman

Page 44: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Some References: Market Microstructure

• Hasbrouck, J., 2007, Empirical Market Microstructure: The Institutions, Economics and Econometrics of Securities Trading

• The Microstructure Approach to Exchange Rates by Richard K. Lyons Easley, D. and M. O’Hara (1987). Price, trade size, and information in securities markets. Journal of Financial Economics 19(1), 69–90.

• Easley, D. and M. O’Hara (1992). Time and the process of security price adjustment.

• Journal of Finance 47(2), 576–606.• Eisler, Zoltan; Kertesz, Janos; Lillo, Fabrizio; Mantegna, Rosario N. 2007

Diffusive behavior and the modeling of characteristic times in limit order executions, Quantitative Finance.

• Gabaix, X., P. Gopikrishnan, V. Plerou, and H. E. Stanley (2003). A theory of power-law distributions in financial market fluctuations. Nature 423, 267–270.

• Hasbrouck, J. (1991). Measuring the information content of stock trades. The Journal of Finance 46(1), 179–207.

• Kissell, R. and M. Glantz (2003). Optimal Trading Strategies: Quantitative Approaches for Managing Market Impact and Trading Risk. American Management Association.

• Gode, D.K and Sunder, S.(1993). “Allocative efficiency of markets with zero intelligence traders : markets as a partial substitute for individual rationality”, Journal of Political Economy, 101, 119-137.

Page 45: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

High Frequency Financial Econometrics

• Wing Lon Ng, 2007, “Analyzing Liquidity and Absorption Limits of Electronic Markets with Volume Durations”, Mimeo

• Bauwens and Hautsch (2006), Modelling Financial High Frequency Data using Point Processes, Core Discussion Paper 2006/80., Université catholique de Louvain

• Carrasco, M., and X. Chen (2002), Mixing and Moment Properties of Various GARCH and Stochastic volatility Models, Econometric Theory, 18(1), 17—39.

• Dufour, A. and Engle, R. F. (2000), The ACD-Model: Predictability of the time between consecutive trades, Discussion paper, ISMA Centre, University of Reading.

• Fernandes, M., and J. Grammig (2006), A Family of Autoregressive Conditional Durations Models, Journal of Econometrics, 130(1), 1—23.

• Härdle, W. (1990), Applied nonparametric regression, Cambridge University Press,Cambridge.

• Hautsch, N. (2002), Modelling intraday trading activity using Box-Cox ACD models, Working paper, CoFE.

• Hautsch, N. (2004), Modelling Irregularly Spaced Financial Data, Springer, Heidelberg.

Page 46: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Agent Based (ACE)Approach

• Reading on using ACE for real world market design:• Markose, M, et. al. A smart market for passenger road transport (SMPRT) congestion: An application of

computational mechanism design Journal of Economic Dynamics and Control , Volume 31, Issue 6, June 2007, Pages 2001-2032

• Markose, S., J. Arifovic and S. Sunder ( 2007), Advances in Experimental and Agent-based Modelling: Asset Markets, Economic Networks, Computational Mechanism Design and Evolutionary Game Dynamics

Volume 31, Issue 6, pages 1801-1807• Readings for rationale for ACE in complex dynamics with contrarian structures • Arthur, W.B., (1994). “Inductive Behaviour and Bounded Rationality”, American Economic Review,

84, pp.406-411.• Markose, S.M, 2005 , “Computability and Evolutionary Complexity : Markets as Complex Adaptive

Systems (CAS)”, Economic Journal , Vol. 115, pp.F159-F192. • Markose, S.M, 2004, “Novelty in Complex Adaptive Systems (CAS): A Computational Theory of Actor

Innovation”, Physica A: Statistical Mechanics and Its Applications, vol. 344, pp. 41- 49. Fuller details in University of Essex, Economics Dept. Discussion Paper No. 575, January 2004.

• Markose S.M., 2006 “Gödelian Foundations of Non-Computability and Heterogeneity In Economic Forecasting and Strategic Innovation”, Presented at Gödel Centenary Colloquium at Computability in Europe 2006 Logical Approaches to Computational Barriershttp://privatewww.essex.ac.uk/~scher/

.

Page 47: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Historical Data Analysis

Observed Stock

Market Capitalisation

Number of Order

Daily Average Price

Daily Average Volume

DMGT Small-Cap  43,547 804.07    4,192,801.24

BGY Mid-Cap  46,246 448.09  6,889,446.42

GSK Large-Cap  130,136  1,415.86  30,131,304.88

Page 48: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Duration Analysis

GSK DGMT

BGY

• help in analyzing length time spent in certain economic event

Page 49: Presentation CCFEA London Stock Exchange SETS Simulator and Exercises on How to Implement Automated VWAP and Pairs Trading Strategies CCFEA/i4MT Summer

Diurnal Pattern