Preface I Introduction Introduction to Modeling Price Impact The Handbook’s Scope Introduction What is Price Impact? Why do Traders Care About It? The Causality Challenge for Price Impact Models Four Core Modeling Principles A Brief History of Price Impact Models Trading Terminology Trading Strategies Trading Data: Fills, Orders, and Binned Data Trading Signals, Alpha Signals Intended, Predicted, and Realized Data Basic Trading Parameters Order Slippage, Arrival Price Alpha Slippage, Slippage Due to Price Impact Trading Experiments: A-B Tests and Back Tests Outlining Applications Transaction Cost Analysis (TCA) for Sell-Side Execu- tion Teams Portfolio Optimization for Buy-Side Statistical Arbi- trage Teams Liquidity Reports for Risk Management Teams Portfolio Consolidation Analysis for Senior Manage- ment Roadmap What to Expect from the Handbook A Brief Summary of Each Chapter II Acting on Price Impact 2 Mathematical Models of Price Impact 2.1 A Pedagogical Example 2.2 Mathematical Setup 2.2.1 Defining Price Impact and Instantaneous Transaction Costs 2.2.2 Establishing P & L in Discrete Time 2.2.3 Examples of Microstructure Assumptions 2.2.4 Reduced Form Models 2.3 The Obizhaeva and Wang (OW) Propagator Model 2.3.1 An Optimal Execution Problem 2.3.2 Closed- Form Optimal Trading Strategy 2.3.3 Intuition Behind the Optimal Trading Strategy 2.4 Extensions Related to the Objective Function 2.4.1 Alpha Signal 2.4.2 Two- Sided Trading 2.4.2.1 Bid- ask Spread as Regularization Term 2.5 Extensions Related to Time 2.5.1 Time Change 2.5.2 Stochastic Push 2.5.2.1 Sensitivity Analysis in Impact Space 2.5.3 Linear Propagator Models 2.6 Extensions Related to External Impact 2.6.1 Microstructure Assumptions 2.6.2 Optimal Trading Strategy with External Impact 2.6.3 Local Concavity 2.6.4 Global Concavity 2.7 Price Manipulation Paradoxes 2.7.1 Constraints on Price Impact Models 2.7.2 Extension to Locally Concave Models 2.7.3 Constraints on Volume Predictions 2.8 Summary of Results 2.8.1 Generalized OW Impact Model 2.8.2 Generalized OW Impact Model with External Impact 2.8.3 Control Problems 2.8.4 Price Manipulation Bounds 2.9 Exercises 3 Applications of Price Impact Models 3.1 A Pedagogical Example 3.2 Optimal Execution 3.2.1 Pre-Trade Cost Model 3.2.1.1 Idealized Optimal Execution Problem 3.2.1.2 Communication with the Portfolio Team 3.2.1.3 Implied Alpha 3.2.1.4 The Square- Root Law Including Alpha Signals in the Execution Strategy Alpha Latency Reactive Execution Schedule Allowing for Tactical Deviations at the Microstructure Level Quantifying Deviations’ Impact Block Trades and Auctions Changing the Execution Strategy when New Orders Arrive A Simulation Example Summary Transaction Cost Analysis (TCA) TCA Best Practices Control for Basic Trading Parameters TCA Predictions An Experiment to Size Orders Correctly Clean-Up Costs for Partial Executions An Experiment for Consecutive Orders A Simulation to Improve High-Touch Trading Summary of Results Optimal Execution Without Intraday Alpha Pre-Trade Cost Model Implied Alpha The Case of Sizable Orders Implied Alpha’s TCA Implication Clean-up Costs Intraday and Low-Latency Alphas Intraday Alpha The Cost of Tactical Algorithms Optimal Execution for Multiple Orders Combining Order Executions TCA for Consecutive Orders Exercises Further Applications of Price Impact Models A Pedagogical Example Statistical Arbitrage Using External Impact as an Alpha Signal Cont, Cucuringu, and Zhang’s Alpha Signal Model Architecture Extensions Adjusting Regression Techniques for Liquidity Using Price Impact for Simulation Waelbroeck’s Simulation Environment Business Applications of a Market Simulator Portfolio and Risk Management How Price Impact Distorts Accounting P&L and Perceived Risk Expected Closing P&L P&L Bias Examples P&L Bias in Steady State General Implications and Actions Portfolio Management Implications Liquidity Risk Implications Senior Management Implications Simulating Fire Sales Liquidation Without Fire Sale Liquidation With Fire Sale Combining Two Portfolios’ Trading Theory in the Case Without Mutual Information Theory in the Case With Mutual Information Empirical Simulation Approach Summary of Results Alpha Research Market Simulator Liquidity Risk Management Combining Two Portfolios’ Trading Exercises III Measuring Price Impact An Introduction to the Mathematics of Causal Inference A Pedagogical Example A Technical Primer on Causal Inference Causal Structures Do-Calculus Simpson’s Paradox Identifiability of Causal Formulas Methods to Reduce Causal Biases Standard A-B testing Causal Regularization Regularization in the Predictive Case Regularization in the Causal Case Summary of Results Causal Structures and Models Do-Calculus A-B Testing Interventional Data Causal Regularization Exercises Dealing with Biases when Fitting Price Impact Models A Pedagogical Example Chapter Roadmap A Non-Technical Primer on Causal Inference Applying Causal Inference to Trading A Template for Dealing with Causal Biases Prediction Bias Definitions Actions and Counterfactuals Why Impact Research is Complex Experiments and Regularization A Simulation Example Synchronization Bias Definitions Actions and Counterfactuals Experiments Implementation Bias Definitions Actions and Counterfactuals Experiments and Regularization Issuer Bias Definitions Actions and Counterfactuals Experiments and Regularization Concluding Thoughts Summary of Results Prediction Bias Synchronization Bias Implementation Bias Issuer Bias Exercises Empirical Analysis of Price Impact Models A Pedagogical Example Methodology Pre-Processing the Event-Based Data Definition of the Base Features and Binned Data Definition of the Time Kernel and Price Impact Computation Definition of the Prediction Horizon and Training Samples Definition of the Testing and Validation Samples Review of the Models in the Literature The Order Flow Imbalance (OFI) Model The Original OW Model The Locally Concave Bouchaud Model The Reduced-Form Model The Globally Concave AFS Model Empirical Model Comparisons Across Timescales Across Time of Day Across Clocks Across Stocks The Magnitude of Price Impact Cross-Impact Causal Bias for Cross-Impact Price Impact for Factor Trading Causal Graph for the EigenLiquidity Model Distinction Between do(Qi, Qj) and do(Q¯) Counterfactuals Under Cross-Impact for Risk-Management and Fac- tor Research Price Impact for Pairs Trading Bonds in Schneider and Lillo (2019)[200] Options in Said et al. (2021)[197] Commodity Futures in Tomas, Mastromatteo, and Benzaquen (2022)[217] Rosenbaum and Tomas (2021)[193] Sparse Equities Cross-Impact in Cont, Cu- curingu, and Zhang (2021)[71 Summary of Results Discrete Formulas for Price Impact Models The Original OW Model The Locally Concave Bouchaud Model The Reduced-Form Model The Globally Concave AFS Model Summary Table The EigenLiquidity Model Exercises IV Appendix A Using Kdb+ for Trading Models A Gentle Introduction to Kdb+ What is Kdb+ and Why Does It Matter to Quants? First Steps in Kdb+ Basic Operations in Q Q does not Follow the Traditional Order of Operations Assignments and Other Basic Operators Atoms, Lists, and Dictionaries Strings and Symbols Functions and Loops Tables are Flipped Dictionaries of Lists Setting Up a Small Database A Cheat-Sheet for Quantitative Trading Data Wrangling in Kdb+ Qsql Queries Joins Generalizing Qsql Long or Wide Format? Vectorized Operations and Parallelism in Kdb+ An Efficient Implementation of the Generalized OW Model Key Mathematical Idea Key Algorithmic Idea Computing Impact States An Efficient Implementation of TCA Key Algorithmic Idea Computing TCA Returns Functional Convergence Theorems for Microstructure Or How to Deal with Local Non-Linearities in Microstructure Functional Law of Large Numbers Functional Central Limit Theorem Further ReadingsSolutions to Exercises C. 1 Solutions to Chapter 2 C. 2 Solutions to Chapter 3 C.3 Solutions to Chapter 4 C.4 Solutions to Cha