HANDBOOK OF HIGH-FREQUENCY TRADING AND MODELING IN FINANCE Ionut Florescu Maria C. Mariani EDITED BY H. Eugene Stanley Frederi G. Viens Handbook of High-Frequency Trading and Modeling in Finance WileyHandbooksin FINANCIAL ENGINEERING AND ECONOMETRICS AdvisoryEditor Ruey S. Tsay TheUniversityofChicagoBoothSchoolofBusiness,USA Acompletelistofthetitlesinthisseriesappearsattheendofthisvolume. Handbook of High-Frequency Trading and Modeling in Finance Edited by IONUT FLORESCU MARIA C. MARIANI H. EUGENE STANLEY FREDERI G. VIENS Copyright©2016byJohnWiley&Sons,Inc.Allrightsreserved PublishedbyJohnWiley&Sons,Inc.,Hoboken,NewJersey PublishedsimultaneouslyinCanada Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmittedinanyform orbyanymeans,electronic,mechanical,photocopying,recording,scanning,orotherwise,exceptas permittedunderSection107or108ofthe1976UnitedStatesCopyrightAct,withouteithertheprior writtenpermissionofthePublisher,orauthorizationthroughpaymentoftheappropriateper-copyfee totheCopyrightClearanceCenter,Inc.,222RosewoodDrive,Danvers,MA01923,(978)750-8400, fax(978)750-4470,oronthewebatwww.copyright.com.RequeststothePublisherforpermission shouldbeaddressedtothePermissionsDepartment,JohnWiley&Sons,Inc.,111RiverStreet, Hoboken,NJ07030,(201)748-6011,fax(201)748-6008,oronlineat http://www.wiley.com/go/permission. LimitofLiability/DisclaimerofWarranty:Whilethepublisherandauthorhaveusedtheirbestefforts inpreparingthisbook,theymakenorepresentationsorwarrantieswithrespecttotheaccuracyor completenessofthecontentsofthisbookandspecificallydisclaimanyimpliedwarrantiesof merchantabilityorfitnessforaparticularpurpose.Nowarrantymaybecreatedorextendedbysales representativesorwrittensalesmaterials.Theadviceandstrategiescontainedhereinmaynotbe suitableforyoursituation.Youshouldconsultwithaprofessionalwhereappropriate.Neitherthe publishernorauthorshallbeliableforanylossofprofitoranyothercommercialdamages,including butnotlimitedtospecial,incidental,consequential,orotherdamages. Forgeneralinformationonourotherproductsandservicesorfortechnicalsupport,pleasecontactour CustomerCareDepartmentwithintheUnitedStatesat(800)762-2974,outsidetheUnitedStatesat (317)572-3993orfax(317)572-4002. Wileyalsopublishesitsbooksinavarietyofelectronicformats.Somecontentthatappearsinprint maynotbeavailableinelectronicformats.FormoreinformationaboutWileyproducts,visitourweb siteatwww.wiley.com. LibraryofCongressCataloging-in-PublicationData: Names:Florescu,Ionut,1973-editor. Title:Handbookofhigh-frequencytradingandmodelinginfinance/editedbyIonutFlorescu, MariaC.Mariani,H.EugeneStanley,FrederiG.Viens. Description:Hoboken,NJ:JohnWiley&Sons,Inc.,[2016]|Includesindex. Identifiers:LCCN2015043237(print)|LCCN2016000501(ebook)|ISBN9781118443989(cloth)| ISBN9781118593400(pdf)|ISBN9781118593325(epub) Subjects:LCSH:Investmentanalysis–Mathematicalmodels.|Investments–Mathematicalmodels.| Finance–Mathematicalmodels. Classification:LCCHG4529.H358632016(print)|LCCHG4529(ebook)| DDC332.64/20285–dc23 LCrecordavailableathttp://lccn.loc.gov/2015043237 PrintedintheUnitedStatesofAmerica 10 9 8 7 6 5 4 3 2 1 Contents NotesonContributors xiii Preface xv 1 TrendsandTrades 1 MichaelCarlisle,OlympiaHadjiliadis,andIoannisStamos 1.1 Introduction 1 1.2 Atrend-basedtradingstrategy 3 1.2.1 Signalingandtrends 3 1.2.2 Gainoverasubperiod 5 1.3 CUSUMtiming 7 1.3.1 Cusumprocessandstoppingtime 7 1.3.2 ACUSUMtimingscheme 10 1.3.3 UStreasurynotes,CUSUMtiming 11 1.4 Example:Randomwalkonticks 12 1.4.1 Randomwalkexpectedgainoverasubperiod 15 1.4.2 Simplerandomwalk,CUSUMtiming 18 1.4.3 Lazysimplerandomwalk,cusumtiming 21 1.5 CUSUMstrategyMonteCarlo 24 1.6 Theeffectofthethresholdparameter 27 1.7 Conclusionsandfuturework 39 Appendix:Tables 40 References 47 2 GaussianInequalitiesandTrancheSensitivities 51 ClaasBeckerandAmbarN.Sengupta 2.1 Introduction 51 2.2 Thetranchelossfunction 52 2.3 Asensitivityidentity 54 2.4 Correlationsensitivities 55 Acknowledgment 58 References 58 v vi Contents 3 ANonlinearLeadLagDependenceAnalysisofEnergy Futures:Oil,Coal,andNaturalGas 61 Germa´nG.CreamerandBernardoCreamer 3.1 Introduction 61 3.1.1 Causalityanalysis 62 3.2 Data 64 3.3 Estimationtechniques 64 3.4 Results 65 3.5 Discussion 67 3.6 Conclusions 69 Acknowledgments 69 References 70 4 PortfolioOptimization:ApplicationsinQuantum Computing 73 MichaelMarzec 4.1 Introduction 73 4.2 Background 75 4.2.1 Portfoliosandoptimization 76 4.2.2 Algorithmiccomplexity 77 4.2.3 Performance 78 4.2.4 Isingmodel 79 4.2.5 Adiabaticquantumcomputing 79 4.3 Themodels 80 4.3.1 Financialmodel 81 4.3.2 Graph-theoreticcombinatorialoptimization models 82 4.3.3 IsingandQubomodels 83 4.3.4 Mixedmodels 84 4.4 Methods 84 4.4.1 Modelimplementation 85 4.4.2 Inputdata 85 4.4.3 Mean-variancecalculations 85 4.4.4 Implementingtheriskmeasure 86 4.4.5 Implementationmapping 86 4.5 Results 88 4.5.1 Thesimplecorrelationmodel 88 4.5.2 Therestrictedminimum-riskmodel 91 4.5.3 TheWMISminimum-risk,maxreturnmodel 94 Contents vii 4.6 Discussion 95 4.6.1 Hardwarelimitations 97 4.6.2 Modellimitations 97 4.6.3 Implementationlimitations 98 4.6.4 Futureresearch 98 4.7 Conclusion 100 Acknowledgments 100 Appendix4.A:WMISMatlabCode 100 References 103 5 EstimationProcedureforRegimeSwitchingStochastic VolatilityModelandItsApplications 107 IonutFlorescuandForrestLevin 5.1 Introduction 107 5.1.1 Theoriginalmotivation 108 5.1.2 Themodelandtheproblem 108 5.1.3 Abriefhistoricalnote 109 5.2 Themethodology 110 5.2.1 Obtainingfilteredempiricaldistributionsat t ,…,t 110 1 T 5.2.2 ObtainingtheparametersoftheMarkovchain 112 5.3 Resultsobtainedapplyingthemodeltorealdata 113 5.3.1 Parti:financialapplications 113 5.3.2 Partii:physicaldataapplication.temperature data 119 5.3.3 Partiii:analysisofseismometerreadings duringanearthquake 121 5.3.4 Analysisoftheearthquakesignal:beginning 123 5.3.5 Analysis:duringtheearthquake 125 5.3.6 Analysis:endoftheearthquakesignal, aftershocks 127 5.4 Conclusion 127 5.A Theoreticalresultsandempiricaltesting 128 5.A.1 Howdoestheparticlefilterwork? 128 5.A.2 Theoreticalresultsaboutconvergenceand parameterestimates 129 5.A.3 Markovchainparameterestimates 131 5.A.4 Empiricaltesting 132 5.A.5 Alistofsupplementarydocuments 133 References 133 viii Contents 6 DetectingJumpsinHigh-FrequencyPricesUnder StochasticVolatility:AReviewandaData-Driven Approach 137 Ping-ChenTsaiandMarkB.Shackleton 6.1 Introduction 137 6.2 Reviewontheintradayjumptests 140 6.2.1 RealizedvolatilitymeasureandtheBNStests 140 6.2.2 TheABDandLMtests 142 6.3 Adata-driventestingprocedure 146 6.3.1 Spydataandmicrostructurenoise 146 6.3.2 Ageneralizedtestingprocedure 149 6.4 Simulationstudy 153 6.4.1 Modelspecification 153 6.4.2 Simulationresults 158 6.5 Empiricalresults 161 6.5.1 Resultsonthebackward-lookingtest 162 6.5.2 Resultsontheinterpolatedtest 165 6.6 Conclusion 165 Acknowledgments 166 Appendix6.A:Least-squareestimationofHAR-MA(2) modelforlog(BP)ofSPY 167 Appendix6.B:EstimationofARMA(2,1)modelfor log(BP)ofSPY 168 Appendix6.C:Minimizedlossfunctionloss(𝜌 ,𝜌 )for 1 2 SV2FJ_2𝜌model,SPY 169 Appendix6.D.1:Calibrationof𝜉 underSV2FJ_2𝜌modelat 2-minfrequency,E[N]=0.08 170 t Appendix6.D.2:Calibrationof𝜉 underSV2FJ_2𝜌modelat 2-minfrequency,E[N]=0.40 171 t Appendix6.D.3:Calibrationof𝜉 underSV2FJ_2𝜌modelat 5-minfrequency,E[N]=0.08 172 t Appendix6.D.4:Calibrationof𝜉 underSV2FJ_2𝜌Modelat 5-minfrequency,E[N]=0.40 173 t Appendix6.D.5:Calibrationof𝜉 underSV2FJ_2𝜌modelat 10-minfrequency,E[N]=0.08 174 t Appendix6.D.6:Calibrationof𝜉 underSV2FJ_2𝜌modelat 10-minfrequency,E[N]=0.40 175 t References 175