RIT Case Brief – ALGO3 Smart Order Routing

199 阅读5分钟

RIT Case Brief – ALGO3
Build 1.01
Smart Order Routing
You are working as a summer intern on the algorithmic trading desk at JPLonegan Chase, one of the
world’s most prestigious financial institutions. Your company has to work orders for large buy-side
institutions in a new fragmented market environment. It is essential to meet regulatory requirements
to fill orders at the NBBO (National Best Bid and Offer). In addition, given fragmented markets,
managing liquidity risk by minimizing potential price impact has become even more challenging than
it used to be when liquidity was focused on the traditional exchanges.
Your task in this ALGO3 case:
Your supervisor would like to challenge your skills and has asked you to build a smart order router
algorithm for one of the stocks for which the desk deals. Since she knows that you might not be
familiar with this concept, she has provided you with a brief description of how smart order routing
works. Your supervisor’s email is provided below.
Dear intern,
Given the large number of exchanges that are available, it is common to find the same stock traded
on several exchanges. For example, Royal Bank of Canada trades in Toronto on the TSX and in New
York on the NYSE (as well as on other 写RIT Case Brief – ALGO3 Smart Order Routingsmaller exchanges). It is also possible for the same stock to
trade on two or more exchanges within the same country. In Canada, Royal Bank of Canada trades on
both the TSX (the primary and oldest exchange) as well as on the Alpha Trading System (commonly
known as Alpha). The latter is an alternative equity marketplace that competes with the main
exchanges.
Smart Order Routing (SOR) is a mechanism by which an algorithm discovers the best price and
available liquidity for a given security across all relevant exchanges. The algorithm will determine to
which exchanges orders have to be sent in order to obtain the best price. This requires monitoring of
both quotes and associated volumes since price fills will reflect any price impact due to limited
liquidity at the quoted prices. The algorithm will break large orders into smaller orders and route
them in a way that manages that liquidity risk.
Copyright © 2016, Rotman School of Management. 2
An example will help you understand how a smart order router works. Consider the following order
books for stock THOR in a Main Market and an Alternative Market, respectively:
Main Market
Bid Volume Bid Price Ask Price Ask Volume
6,700 19.97 19.98 7,400
5,400 19.96 19.99 5,400
5,500 19.95 20.00 5,600
5,300 19.94 20.01 5,300
6,000 19.93 20.02 5,300
4,800 19.92 20.03 6,300
Alternative Market
Bid Volume Bid Price Ask Price Ask Volume
9,000 19.97 19.98 9,500
8,300 19.95 20.00 9,700
8,400 19.93 20.02 9,000
8,000 19.91 20.04 7,200
8,000 19.89 20.06 8,100
9,000 19.87 20.08 8,500
Consider the case where one of our clients would like to buy 100,000 shares of THOR from our bank.
After a brief negotiation with our colleagues in Sales, the client agrees that he is willing to buy the
shares at a premium and pay 20.05/share.SinceourcolleaguesinSalesdonothaveamodeltoevaluatewhether20.05/share. Since our colleagues in Sales do not have a model to evaluate whether 20.05/share is a good price for THOR given the available liquidity, they will ask
for your input and you will have to decide whether to approve the transaction.
In order to make a decision, you need to evaluate the liquidity of the two markets together and in
order to do so you should build the “Aggregate Order Book”, a limit order book that combines all of
the orders from both the Main and the Alternative Exchanges. The aggregate order book for THOR is
provided below based on the quotes of the Main and Alternative markets. For ease of presentation,
we will only show the ask side of the book here but the same calculations can be done for the bid side.
Aggregate Order Book
Ask Price Ask Volume Cumulative
Ask Volume VWAP
19.98 16,900 16,900 19.980
19.99 5,400 22,300 19.982
20.00 15,300 37,600 19.990
20.01 5,300 42,900 19.992
Copyright © 2016, Rotman School of Management. 3
20.02 14,300 57,200 19.999
20.03 6,300 63,500 20.002
20.04 7,200 70,700 20.006
20.06 8,100 78,800 20.012
20.08 8,500 87,300 20.018
When evaluating the order, you can now make a decision and have more details about the liquidity
for THOR stock. If you decide to accept the transaction with the client as proposed by your colleagues
in Sales, our bank will sell 100,000 shares at 20.05. Since we do not have any estimates for the future
THOR stock price, we are required to hedge against market price risk1; therefore, we need to buy
back shares. In this example, you will notice that you can buy 70,700 shares at a price lower than
20.05(asshownintheCumulativeAskVolumecolumn).Youmightacceptsomerisksanddecidetotaketheorder;youwillbeabletocovermostofyourexposuretomarketpriceriskusingmarketordersandthenworktheremainingpartoftheorderusinglimitorderstominimizeliquidityrisk.Theexampleaboveiseasierthanmostoftheoffersthatourbankfacesonadailybasis.Therefore,IwouldlikeyoutobuildadecisionsupportspreadsheetwithRTDlinkstothesimulatedmarketsinordertocollecttherelevantinformationaboutquotesandliquidityinrealtime.Usingthatinformation,youwillthenneedtoprogramanalgorithmthatcoversacceptedordersinawaythatmanagesbothmarketpriceriskandliquidityrisk.Asdescribedintheemailabovebyyoursupervisor,youwillneedtouseyourknowledgeofliquidityriskandmarketpricerisktoevaluatetheriskinessoftheorder,acceptordeclineitdependingonthetradeoffbetweenriskandpotentialreturns,andthenuseyouralgorithmtocoveryourpositionappropriately.Toevaluatethetradeoffbetweenriskandpotentialreturns,itwillbeusefultoreviewsomemeasuresofliquidity.Reviewofsomemeasuresofliquidity:Recallthatthereareseveralrelatedmeasuresofliquidityorilliquidityassociatedwithasecuritytradingonapureorderdrivenmarket.Forexample:BidAskspreadBreadthandDepthofthelimitorderbook(volumebasedmeasures)ResiliencyPriceimpactWhichmeasure(s)oneusestoquantifyliquidityriskwilldependononesroleandconsequentlyononesexposuretothecostsofilliquidity.Thebidaskspreadmeasureisveryimportantforamarket1Forthiscase,wedefinemarketpriceriskastheriskthatthemarketpriceofthesecuritywillchangeovertimeforexogenousreasons;whereastheimplicationofilliquiditywillinvolvepotentialpriceimpactassociatedwithyourorder(endogenouspricechanges).Copyright©2016,RotmanSchoolofManagement.4maker(pleaseseetheALGO2caseformoredetails)butitislessimportantinthisALGO3case.Thisisbecause,asintheLT3andLT4cases,youwillonlybelookingatonesideofthemarketwhileworkinganordersinceyouwillonlybebuyingorsellingdependingonthetradethatyouexecutedwiththeirclient.Breadthanddepthofthelimitorderbooksmeasurevolumeavailabletotrade.Depthofthemarketmeasuresthenumberofsharesthatareavailabletobuy(orsell)ataparticularprice.Itisanindicatorofhowlargetheorderhastobebeforecausingapricechange(movingdownthebook).Intheexamplebelow,thedepthofthemarketatthefirstlevelofthebooksbidquotesis1,000.Breadthishowmanylevelsoforders(atdifferentpricequotesasonemovesdownthebook)arecurrentlyavailableinthebook.Thatis,breadthofthelimitorderbookindicateswhethertheordersarenumerousacrossawiderangeofpricelevels.Breadthanddepthofthemarketarestronglycorrelated,asmarketswithgooddepthalsotendtofosterbreadth.Onewaytomeasureliquidityfromtheperspectiveofaliabilitytraderistoevaluatehowmuchthepricewouldchangeifalargemarketorderweretobesubmitted.Thelessthepricechangeforaspecificvolume,themoreliquidthemarketis.ThisiscalledpriceimpactandhasbeendiscussedintheLiabilityTrading3case(LT3).ThedecisionsupporttemplatesfortheLT3caseandthemultipleexchangeLT4casecanbeusedtocomputepotentialpriceimpactforanymarketordersizeinrealtime.TheLT4versionprovidesaglobalintegratedlimitorderbook(forwhichliquidityavailableinalltheexchangesiscombinedintoonelimitorderbook)whichcanbeusedtocomputethepotentialpriceimpactassociatedwiththeoptimalroutingoftheorderacrosstheavailableexchanges.Althoughnotasrelevantforthiscase,anothermeasurethatcanbeusedtoevaluatetheliquidityistheresiliency.Resiliencycanbemeasuredbytherefillrate,thatis,howquicklynewlimitordersaresubmittedtothevisiblebookwhenliquidityisremovedfromthebook.Resiliencymeasuresthetimeforthepricetorecoverafteralargetrade.Itrepresentsthedegreetowhichpricemovementsaresmooth.Severalratioshavebeendevelopedbybothacademicsandpractitionerstomeasuretheresiliencyinthemarket.OnethatcanbeeasilyappliedintheRITistheMarketEfficiencyCoefficient(MEC)thatmeasuresdifferencesbetweenthevolatilityinashortperiodcomparedtothevolatilityoveralongperiod.Moreformally,let𝑣𝑣𝑣𝑣𝑣𝑣(𝑟𝑟𝑤𝑤𝑤𝑤𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒)betheweeklyvarianceofthereturnsand𝑣𝑣𝑣𝑣𝑣𝑣(𝑟𝑟𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑)bethedailyvarianceofthereturns,assumingthatthereare5tradingdaysinaweek,theMECiscalculatedas:𝑀𝑀𝑀𝑀𝑀𝑀=𝑣𝑣𝑣𝑣𝑣𝑣(𝑟𝑟𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤) 5𝑣𝑣𝑣𝑣𝑣𝑣(𝑟𝑟𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑) Copyright©2016,RotmanSchoolofManagement.5WhenMECislowerthan1,itsuggeststhatthemarketisilliquidbecausethevarianceoftheshortperiodreturnsishigherthanthevarianceofthelongperiodreturns.Inotherwords,thisratioprovidessomeinformationontheproportionbetweentemporaryandlongertermpricemovements.YoucaneasilyimplementthisratiointheRIT.Forexample,usea30secondmovingwindowforthelongperiodanda6secondmovingwindowfortheshortperiod.LinkthehistoricalpricestoExcelanddothecalculationstocomeupwitharealtimeMEC2.ExecutionIfyouwantedtobuy20,000sharesofTHOR,howcouldyoudoit?Shouldyoutradeononlyonemarket?Theobjectiveofthecaseistoprocesstheordersandseekthebestexecution.Therefore,youshouldtakeadvantageofliquidityonbothexchanges.Intheexampleabove,wecouldcalculatetheaggregateorderbookasshownbelowagain,foreaseofpresentation,wewillonlyshowtheasksideofthebooksinceourexamplerequiresyoutobuy20,000shares;butthesamecalculationscanbedoneforthebidside.IntegratedOrderBookAskPriceAskVolumeCumulativeAskVolumeVWAPMarket19.987,4007,40019.980Main19.989,50016,90019.980Alternative19.995,40022,30019.982Main20.005,60027,90019.986Main20.009,70037,60019.990Alternative20.015,30042,90019.992Main20.025,30048,20019.995Main20.029,00057,20019.999Alternative20.036,30063,50020.002Main20.047,20070,70020.006Alternative20.068,10078,80020.012Alternative20.088,50087,30020.018AlternativeIfyouwouldlikethebuy20,000sharesusingmarketorders,youshouldsubmitordersonbothmarketstoobtainthebestprice.Inparticular,youshouldsubmitanorderfor10,500sharesontheMainmarketandanorderfor9,500sharesontheAlternativemarket.Bydoingso,youwouldbuy20.05 (as shown in the Cumulative Ask Volume column). You might accept some risks and decide to take the order; you will be able to cover most of your exposure to market price risk using market orders and then work the remaining part of the order using limit orders to minimize liquidity risk. The example above is easier than most of the offers that our bank faces on a daily basis. Therefore, I would like you to build a decision-support spreadsheet with RTD links to the simulated markets in order to collect the relevant information about quotes and liquidity in real time. Using that information, you will then need to program an algorithm that covers accepted orders in a way that manages both market price risk and liquidity risk. As described in the email above by your supervisor, you will need to use your knowledge of liquidity risk and market price risk to evaluate the riskiness of the order, accept or decline it depending on the tradeoff between risk and potential returns, and then use your algorithm to cover your position appropriately. To evaluate the tradeoff between risk and potential returns, it will be useful to review some measures of liquidity. Review of some measures of liquidity: Recall that there are several related measures of liquidity or illiquidity associated with a security trading on a pure order-driven market. For example: • Bid-Ask spread • Breadth and Depth of the limit order book (volume-based measures) • Resiliency • Price impact Which measure(s) one uses to quantify liquidity risk will depend on one’s role and consequently on one’s exposure to the costs of illiquidity. The bid-ask spread measure is very important for a market 1 For this case, we define market price risk as the risk that the market price of the security will change over time for exogenous reasons; whereas the implication of illiquidity will involve potential price impact associated with your order (endogenous price changes). Copyright © 2016, Rotman School of Management. 4 maker (please see the ALGO2 case for more details) but it is less important in this ALGO3 case. This is because, as in the LT3 and LT4 cases, you will only be looking at one side of the market while ‘working’ an order since you will only be buying or selling depending on the trade that you executed with their client. Breadth and depth of the limit order books measure volume available to trade. Depth of the market measures the number of shares that are available to buy (or sell) at a particular price. It is an indicator of how large the order has to be before causing a price change (moving down the book). In the example below, the depth of the market at the first level of the book’s bid quotes is 1,000. Breadth is how many levels of orders (at different price quotes as one moves down the book) are currently available in the book. That is, breadth of the limit order book indicates whether the orders are numerous across a wide range of price levels. Breadth and depth of the market are strongly correlated, as markets with good depth also tend to foster breadth. One way to measure liquidity from the perspective of a liability trader is to evaluate how much the price would change if a large market order were to be submitted. The less the price change for a specific volume, the more liquid the market is. This is called price impact and has been discussed in the Liability Trading 3 case (LT3). The decision-support templates for the LT3 case and the multiple exchange LT4 case can be used to compute potential price impact for any market order size in real time. The LT4 version provides a global integrated limit order book (for which liquidity available in all the exchanges is combined into one limit order book) which can be used to compute the potential price impact associated with the optimal routing of the order across the available exchanges. Although not as relevant for this case, another measure that can be used to evaluate the liquidity is the “resiliency”. Resiliency can be measured by the re-fill rate, that is, how quickly new limit orders are submitted to the visible book when liquidity is removed from the book. Resiliency measures the time for the price to recover after a large trade. It represents the degree to which price movements are smooth. Several ratios have been developed by both academics and practitioners to measure the resiliency in the market. One that can be easily applied in the RIT is the Market Efficiency Coefficient (MEC) that measures differences between the volatility in a short-period compared to the volatility over a long-period. More formally, let 𝑣𝑣𝑣𝑣𝑣𝑣(𝑟𝑟𝑤𝑤𝑤𝑤𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒) be the weekly variance of the returns and 𝑣𝑣𝑣𝑣𝑣𝑣(𝑟𝑟𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑) be the daily variance of the returns, assuming that there are 5 trading days in a week, the MEC is calculated as: 𝑀𝑀𝑀𝑀𝑀𝑀 = 𝑣𝑣𝑣𝑣𝑣𝑣(𝑟𝑟𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤)  5 ∗ 𝑣𝑣𝑣𝑣𝑣𝑣(𝑟𝑟𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑)  Copyright © 2016, Rotman School of Management. 5 When MEC is lower than 1, it suggests that the market is illiquid because the variance of the shortperiod returns is higher than the variance of the long-period returns. In other words, this ratio provides some information on the proportion between temporary and longer-term price movements. You can easily implement this ratio in the RIT. For example, use a 30 second moving window for the long-period and a 6 second moving window for the short-period. Link the historical prices to Excel and do the calculations to come up with a real-time MEC2. Execution If you wanted to buy 20,000 shares of THOR, how could you do it? Should you trade on only one market? The objective of the case is to process the orders and seek the best execution. Therefore, you should take advantage of liquidity on both exchanges. In the example above, we could calculate the aggregate order book as shown below – again, for ease of presentation, we will only show the ask side of the book since our example requires you to buy 20,000 shares; but the same calculations can be done for the bid side. Integrated Order Book Ask Price Ask Volume Cumulative Ask Volume VWAP Market 19.98 7,400 7,400 19.980 Main 19.98 9,500 16,900 19.980 Alternative 19.99 5,400 22,300 19.982 Main 20.00 5,600 27,900 19.986 Main 20.00 9,700 37,600 19.990 Alternative 20.01 5,300 42,900 19.992 Main 20.02 5,300 48,200 19.995 Main 20.02 9,000 57,200 19.999 Alternative 20.03 6,300 63,500 20.002 Main 20.04 7,200 70,700 20.006 Alternative 20.06 8,100 78,800 20.012 Alternative 20.08 8,500 87,300 20.018 Alternative If you would like the buy 20,000 shares using market orders, you should submit orders on both markets to obtain the best price. In particular, you should submit an order for 10,500 shares on the Main market and an order for 9,500 shares on the Alternative market. By doing so, you would buy 7,400 shares at 19.98fromtheMainmarket,9,500sharesat19.98 from the Main market, 9,500 shares at 19.98 from the Alternative market
and 3,100 shares at 19.99fromtheMainmarket.TheVolumeWeightedAveragePrice(VWAP)ofthetransactionwillbe19.99 from the Main market. The Volume Weighted Average Price (VWAP) of the transaction will be 19.982.
2 For more information on how to link the real-time data from the RIT in Excel, please check our “RIT – User Guide
– RTD Documentation” file available in the RIT Client under “Help Files”.
Copyright © 2016, Rotman School of Management. 6
If you traded the 20,000 shares only on the Main market, the VWAP of the transaction would have
been ~19.991andyouwouldhavecausedthepricetomoveto19.991 and you would have caused the price to move to 20.01. If you traded the 20,000
shares only on the Alternative market, the VWAP of the transaction would have been ~19.991andyouwouldhavecausedthepricetomoveto19.991 and you would have caused the price to move to 20.02. Trading only on one of the exchanges would have
resulted in a higher VWAP.
Market Dynamic
During this ALGO3 case, you will receive 5 institutional orders. The institutional orders will be shown
as pop-up messages like the one shown below. You will have 30 seconds to decide whether to accept
the offer or not. You can track the time remaining before the offer expires by checking the number
between brackets beside the “Decline” button.
The simulation will last 5 minutes. There is only one stock trading in this case, THOR. You have been
given a net trading limit of 100,000 shares and a gross trading limit of 250,000 shares. There is a
maximum order size of 25,000 shares. Take fees are 0.01and0.01 and 0.005 on the main and alternative
exchanges respectively; and that you will receive a net rebate of $0.0025 per share for limit orders
that are filled on the alternative exchange. Marketable limit orders (limit orders that cross the
bid/ask spread) are treated 代 写RIT Case Brief – ALGO3 Smart Order Routingas market orders.
RTD Links and API will be enabled allowing you to link the RIT with Excel and VBA. You are allowed
to submit orders only through your algorithm and watch the order book for the different exchanges
in Excel (the order books are not available in the RIT). Trading from the RIT will be disabled.
Lastly, as in our LT3 and LT3 Decision Cases, your job as a liability trader is to only trade to unwind
positions that you accumulated as a consequence of transactions with institutional clients (accepted
tender offers). You should not trade for any other reason (e.g., arbitrage, market making, following
the trend, etc.). Your instructor or CRO will penalize you for front-running and other speculative
strategies, defined for this case as trading unrelated to unwinding accepted tender offers and not
completely covering accepted tenders prior to the end of the trading period. For WX:codehelp