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 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,Iwouldlikeyoutobuildadecision−supportspreadsheetwithRTDlinkstothesimulatedmarketsinordertocollecttherelevantinformationaboutquotesandliquidityinrealtime.Usingthatinformation,youwillthenneedtoprogramanalgorithmthatcoversacceptedordersinawaythatmanagesbothmarketpriceriskandliquidityrisk.Asdescribedintheemailabovebyyoursupervisor,youwillneedtouseyourknowledgeofliquidityriskandmarketpricerisktoevaluatetheriskinessoftheorder,acceptordeclineitdependingonthetradeoffbetweenriskandpotentialreturns,andthenuseyouralgorithmtocoveryourpositionappropriately.Toevaluatethetradeoffbetweenriskandpotentialreturns,itwillbeusefultoreviewsomemeasuresofliquidity.Reviewofsomemeasuresofliquidity:Recallthatthereareseveralrelatedmeasuresofliquidityorilliquidityassociatedwithasecuritytradingonapureorder−drivenmarket.Forexample:•Bid−Askspread•BreadthandDepthofthelimitorderbook(volume−basedmeasures)•Resiliency•PriceimpactWhichmeasure(s)oneusestoquantifyliquidityriskwilldependonone’sroleandconsequentlyonone’sexposuretothecostsofilliquidity.Thebid−askspreadmeasureisveryimportantforamarket1Forthiscase,wedefinemarketpriceriskastheriskthatthemarketpriceofthesecuritywillchangeovertimeforexogenousreasons;whereastheimplicationofilliquiditywillinvolvepotentialpriceimpactassociatedwithyourorder(endogenouspricechanges).Copyrightc◯2016,RotmanSchoolofManagement.4maker(pleaseseetheALGO2caseformoredetails)butitislessimportantinthisALGO3case.Thisisbecause,asintheLT3andLT4cases,youwillonlybelookingatonesideofthemarketwhile‘working’anordersinceyouwillonlybebuyingorsellingdependingonthetradethatyouexecutedwiththeirclient.Breadthanddepthofthelimitorderbooksmeasurevolumeavailabletotrade.Depthofthemarketmeasuresthenumberofsharesthatareavailabletobuy(orsell)ataparticularprice.Itisanindicatorofhowlargetheorderhastobebeforecausingapricechange(movingdownthebook).Intheexamplebelow,thedepthofthemarketatthefirstlevelofthebook’sbidquotesis1,000.Breadthishowmanylevelsoforders(atdifferentpricequotesasonemovesdownthebook)arecurrentlyavailableinthebook.Thatis,breadthofthelimitorderbookindicateswhethertheordersarenumerousacrossawiderangeofpricelevels.Breadthanddepthofthemarketarestronglycorrelated,asmarketswithgooddepthalsotendtofosterbreadth.Onewaytomeasureliquidityfromtheperspectiveofaliabilitytraderistoevaluatehowmuchthepricewouldchangeifalargemarketorderweretobesubmitted.Thelessthepricechangeforaspecificvolume,themoreliquidthemarketis.ThisiscalledpriceimpactandhasbeendiscussedintheLiabilityTrading3case(LT3).Thedecision−supporttemplatesfortheLT3caseandthemultipleexchangeLT4casecanbeusedtocomputepotentialpriceimpactforanymarketordersizeinrealtime.TheLT4versionprovidesaglobalintegratedlimitorderbook(forwhichliquidityavailableinalltheexchangesiscombinedintoonelimitorderbook)whichcanbeusedtocomputethepotentialpriceimpactassociatedwiththeoptimalroutingoftheorderacrosstheavailableexchanges.Althoughnotasrelevantforthiscase,anothermeasurethatcanbeusedtoevaluatetheliquidityisthe“resiliency”.Resiliencycanbemeasuredbythere−fillrate,thatis,howquicklynewlimitordersaresubmittedtothevisiblebookwhenliquidityisremovedfromthebook.Resiliencymeasuresthetimeforthepricetorecoverafteralargetrade.Itrepresentsthedegreetowhichpricemovementsaresmooth.Severalratioshavebeendevelopedbybothacademicsandpractitionerstomeasuretheresiliencyinthemarket.OnethatcanbeeasilyappliedintheRITistheMarketEfficiencyCoefficient(MEC)thatmeasuresdifferencesbetweenthevolatilityinashort−periodcomparedtothevolatilityoveralong−period.Moreformally,letvvvvvv(rrwwwweeeeeeee)betheweeklyvarianceofthereturnsandvvvvvv(rrdddddddddd)bethedailyvarianceofthereturns,assumingthatthereare5tradingdaysinaweek,theMECiscalculatedas:MMMMMM=vvvvvv(rrwwwwwwwwwwww) 5∗vvvvvv(rrdddddddddd) Copyrightc◯2016,RotmanSchoolofManagement.5WhenMECislowerthan1,itsuggeststhatthemarketisilliquidbecausethevarianceoftheshortperiodreturnsishigherthanthevarianceofthelong−periodreturns.Inotherwords,thisratioprovidessomeinformationontheproportionbetweentemporaryandlonger−termpricemovements.YoucaneasilyimplementthisratiointheRIT.Forexample,usea30secondmovingwindowforthelong−periodanda6secondmovingwindowfortheshort−period.LinkthehistoricalpricestoExcelanddothecalculationstocomeupwithareal−timeMEC2.ExecutionIfyouwantedtobuy20,000sharesofTHOR,howcouldyoudoit?Shouldyoutradeononlyonemarket?Theobjectiveofthecaseistoprocesstheordersandseekthebestexecution.Therefore,youshouldtakeadvantageofliquidityonbothexchanges.Intheexampleabove,wecouldcalculatetheaggregateorderbookasshownbelow–again,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,youwouldbuy7,400 shares at 19.98fromtheMainmarket,9,500sharesat19.98 from the Alternative market
and 3,100 shares at 19.99fromtheMainmarket.TheVolumeWeightedAveragePrice(VWAP)ofthetransactionwillbe19.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.991andyouwouldhavecausedthepricetomoveto20.01. If you traded the 20,000
shares only on the Alternative market, the VWAP of the transaction would have been ~19.991andyouwouldhavecausedthepricetomoveto20.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.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