ATQ2 Anatomy of an Algo1

  • Upload
    abydoun

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

  • 7/30/2019 ATQ2 Anatomy of an Algo1

    1/50908 Automated Trader | Q2 2011

    Te Scenario:It is March 2nd 2011 and CMEMarch 2012 Eurodollar utures have been rallyingsteadily since mid February. A US und manager isanticipating that this rally is likely to persist over thecoming weeks, but is looking or a pullback buyingopportunity. Te US ISM Non-ManuacturingComposite and Initial Jobless Claims are dueor release the ollowing day and both have beentrending positively in recent months. Related

    indicators have also been relatively resilient; payrollcompany Automatic Data Processing has justreported that the US private sector added 217,000

    jobs in February, considerably ahead o the 180,000predicted by many analysts.

    Against this backdrop, the manager takes the viewthat i the ISM and initial jobless stats are positive

    yet again then stocks are likely to rally and the

    Robert Almgren ChristianHauff

    Anatomy of an Algo

    A DifferentWorld

    Yet another first in this issues Automated Trader. While weve written about plenty of equity and

    FX algorithms, weve never featured one for the complex world of interest rates. Robert Almgren,President and Christian Hauff, CEO of Quantitative Brokers change all that by illustrating the use of

    an agency algorithm to take a long position in CME Eurodollar futures.

    Figure 1: Event Significance

  • 7/30/2019 ATQ2 Anatomy of an Algo1

    2/5Q2 2011 | Automated Trader8 091

    ANATOMY OF AN ALGO

    Eurodollar to sell o, thereby providing a suitableopening to take a long position. He thereore

    instructs his trading desk to buy 1090 lots o theMarch 2012 Eurodollar on March 3rd.

    Te Asset: CME March 2012 Eurodollar utures

    Te Challenge:o buy 1090 GEH2 Eurodollarutures contracts at an average price o 9903.30 orbetter

    Te Algo:Te algorithm, which targets eitherWAP or VWAP, has three core components:1. Volume Scheduling

    2. Order Placement3. Price Signals

    Volume Scheduling:Te algorithm tracks and monitors 62 recurringmarket events relating to interest rates. Tese rangerom economic data releases, FOMC meetings,Economic Statements (e.g. Beige Book, Fedminutes, etc), to reasury Auctions rom 10-YearNotes to IPS. Te most signicant o theseevents are listed in Figure 1.

    Te signicance o these events is calculated usingan exponentially weighted rolling average overthe last two years (i.e. last 24 events or monthlyannouncements). (Te two events that will aectthis trade - Initial Jobless claims and ISM Non-Manuacturing Composite - are highlighted inyellow in Figure 1.) Tese values are then usedto generate a volume orecast (see Figure 2) thatadds the specic event eect to the base prole

    around the announcement time. Te base proleis a 30 day exponentially weighted rolling average

    o volume or that specic contract (in this case theMarch 2012 Eurodollars). As the order progresses,the realised volume is monitored and used toupdate the remaining orecast or the order.

    Upon receipt o the parent order, the agencyalgorithm creates a customised envelope uniqueto that order (see the dark blue outline in Figure2). Te ahead and behind boundaries annotatedin Figure 2 contract during peak volume events inorder to mitigate exposure to market volatility.

    Order Placement:With the schedule in place, the algorithm thendeploys a combination o generic and order bookspecic placement rules.

    Te generic order placement characteristics o thealgorithm are as ollows: Te executed plus pending quantities will always be

    within envelope depicted in dark blue in Figure 2 Te algo will continuously monitor its lag

    which is a measure o the current lled quantityversus the ideal WAP schedule (linear line in

    Figure 2). Positive lag means behind scheduleand negative lag means ahead o schedule

    It will reduce positive lag by using new orderquantity (i available), otherwise it will take romthe resting quantity deepest in the order book tocross

    Child order distribution is also infuenced byprice signals (see Price Signals below)

    Te algo also incorporates knowledge o thespecic order book in which it is trading. TeCME uses our dierent matching engines orits interest rate utures complex, with Eurodollarutures matching being conducted using enginealgorithm A = Allocation. Te matching rules orEurodollar outrights, spreads and butterfies usethe ollowing ll allocation sequence:

    Hidden second generation price improvement(rst aggressor)

    op order until 100% exhausted Pro rata1

    - Direct order volume: including CME icebergs - Implied order volume: rst and second

    generation volume First in/rst out on any residual quantity

    Figure 2: Actual Envelope - Eurodollar order

    1 For pro rata, there is a minimum pro-rata allocation parameter of two lots. All lls are rounded down to thenearest integer and if an allocated trade quantity is less than two lots, it is rounded down to zero.

  • 7/30/2019 ATQ2 Anatomy of an Algo1

    3/50928 Automated Trader | Q2 2011

    Anatomy of an algo A Different World

    Te algorithm addresses thesematching rules with a specic

    set o order book logic orEurodollar outrights, spreadsand butterfies. Due to thepro-rata characteristics othe Eurodollar matchingengine outlined above, thealgorithm employs oversizing o the child orders(within the constraint o theahead boundary shown inFigure 2), which increasesthe probability o getting

    lled on its target quantity.It also has a bias towardsdynamically placing childorders close to the inside levelto improve the probability oachieving passive lls.

    Price signals:In addition to smart order placement, thealgorithm also uses various short-term (alpha)price signals to infuence order placement andmaximise execution quality. Tese signals allow the

    algorithm to take advantage o short-term alphaby posting passively (opportunistically) or crossingthe spread and include:

    Cointegration2 signals - these signals track themidpoint price o all neighbouring Eurodollarcontracts out to two years. Te algorithm detectsmidpoint shits in the neighbouring contracts topredict a midpoint shit inthe contract being traded(see Figure 3).

    Microprice signals - thesesignals examine the

    weighted midpoint o thecontract being traded topredict a midpoint shit inavour o where the currentbid-oer is weighted moreheavily.

    Hidden liquidity - Hiddenliquidity occurs when arst generation impliedoutright contract combines

    with a calendar spread

    containing that implied outright contract, toisolate the traded contract at a price inside thecurrent displayed market. (See the rst bulletin description above o the CME algorithm A= Allocation matching engine.) Tis presentsthe opportunity or an aggressive ll inside thedisplayed bid-oer. Hidden liquidity signalsdetect when these opportunities occur and

    will attempt to realise them i avourable toperormance. (See Figure 4 or an example o therelationships between CME listed Eurodollaroutrights, spreads and butterfies, with theMarch 2012 contract highlighted.)

    Figure 3: Prediction power of mid-point cointegration

    Figure 4: Implied Pricing Relationship of GEH2

    2 If two or more series each have a unit root, that is I(1), but a linear combination of them is stationary, I(0), then the series are saidto be cointegrated. e mean reverting properties of cointegrated time series are the basis of numerous sta tistical arbitrage tradingmodels, with pairs trading being one commonplace application.

  • 7/30/2019 ATQ2 Anatomy of an Algo1

    4/5Q2 2011 | Automated Trader8 093

    ANATOMY OF AN ALGO

    Average trade sizes - the algorithm tracks andanalyses historical and real time average trade

    sizes and average posted liquidity at each level.Tis encapsulates the inherent characteristicso the pro-rata market; namely that aggressiveorders are passively lled via a (pro rata)combination o passive orders, and that postedliquidity is signicantly larger due to the oversizing employed in the market.

    Mean reversion - mean reversion tends to be atits strongest in a dened time window ater a

    quote change (midpoint shit), but as time passes,the probability o this reversion weakens. Figure

    5 shows the distribution o quote changes overtime in an attempt to predict this as a short-term signal. As can be seen, this mean reversionis highly likely ater around our milliseconds(possibly due to cancellations or activity rom lowlatency traders) and again at around our seconds,but is less likely ater approximately 16 seconds.racking this behaviour can prove valuable inassisting the algorithm to either capture or avoidchasing fickers in the actual midpoint.

    Figure 5: Mid-point Mean Reversion for GEM2

    7:00:00 - Order received to buy 1090 GEH2. Orderbegins.

    7:30:00 - Te Initial Jobless Claims data releasedand are signicantly below many analysts predictionsat 368,000 or the week ending February 26th. Tis

    represents a urther 5.2% decline over and above theprevious weeks reduction and according to the USLabor Department is the lowest level o new claims orunemployment insurance since late May 2008.

    Te Eurodollar market immediately responds byselling o and the algorithm achieves passive lls atvarious points on the way down.

    8:20:35 - Te market ticks lower and the algorithmachieves a passive ll or 39 lots at 9905.00. Figure 6

    shows that just beore this large passive ll, the algohad a short positive lag. Most o the target quantity was

    working quantity that had not yet been lled, so therewas available spare quantity or this passive ll. Tere

    ranscript of trade execution(All times are in CME local time, which was Central Standard ime as o the trade date.)

  • 7/30/2019 ATQ2 Anatomy of an Algo1

    5/5

    was also a sharp decrease in slippage ater this passive ll.As the morning progresses, the envelope widens, andthe algo oversizes working orders towards the ahead

    boundary.

    11:56:05 - A passive ll or 45 lots is completedwhen the market dips lower at 9902.00. Tis was

    possibly due to thealgorithm not beingoverly aggressiveahead o this moveand leaving availablequantity workingbelow the bid. It hadalso been oversizingto nearly twice theamount it was lled.

    12:40 - Tealgorithm is ableto take advantageo hidden liquidity

    available in the bookvia a butterfy middleleg, as witnessed byaggressive child ordersbeing lled on the bidat 9902.25 (see redramed blow up inFigure 7).

    GEU1 (outright) is oered at 9951.50 GEU2 (outright) is oered at 9827.00 U1-H2-U2 (butterfy) is bid at -26.00

    Using ormula H2 (butterfy middle leg) =(1/2) ( [U1] + [U2] - [U1-H2-U2] )...thereore H2 is oered at 9902.25, via lls on the

    H2 middle legsat 9902.00 and9902.50.

    13:53:46 - Asthe market tickslower, the algorithmachieves several

    passive lls, two or3 lots apiece, beore alarger passive ll or32 lots, all done at9900.50.

    14:50:00 - Tealgorithms schedulingenvelope begins tosmooth back towardsthe WAP line asmarket liquidity

    tapers near the closeat 15:00:00 C andthe order completes.

    0948 Automated Trader | Q2 2011

    Anatomy of an algo A Different World

    Figure 6: Real-time Slippage + Envelope

    Figure 7: Market Movement + Child Orders