Full Transcript

# Algorithmic Trading ## Course Overview ### Instructor and Information - Prof. Marcos López de Prado - Email: - Website: [www.QuantResearch.org](www.QuantResearch.org) - Office hours: By appointment ### Course Description Algorithmic trading is the implementation of a trading strategy...

# Algorithmic Trading ## Course Overview ### Instructor and Information - Prof. Marcos López de Prado - Email: - Website: [www.QuantResearch.org](www.QuantResearch.org) - Office hours: By appointment ### Course Description Algorithmic trading is the implementation of a trading strategy as a computer program. This course teaches students how to research, develop, and deploy profitable algorithmic trading strategies, while avoiding common pitfalls. We will cover the entire chain, from formulating a hypothesis, to back-testing and production. Students will learn how to apply quantitative methods and modern technology to solve some of the most challenging problems in finance. ### Prerequisites #### Programming - Comfortable programming in **Python** (***required***). - Experience with **NumPy**, **SciPy**, and **Pandas** is a plus. - Experience with **C++** is a plus. #### Probability and Statistics - Basic probability theory: probability spaces, random variables, expectations, variance, correlation. - Basic statistical analysis: hypothesis testing, linear regression. ### Course Objectives By the end of this course, students will be able to: 1. Formulate a trading idea into a testable hypothesis. 2. Back-test trading strategies, and avoid common statistical pitfalls. 3. Rank features by relative importance. 4. Design a robust strategy that is resilient to market changes. 5. Evaluate the performance of a trading strategy. 6. Manage risk and allocate capital. 7. Build a trading infrastructure. 8. Deploy a trading strategy in a production environment. ### Course Structure 1. Introduction 2. Linear Models 3. Backtesting 4. Nonlinear Models 5. Feature Importance 6. Structural Breaks 7. Strategy Design 8. Performance Evaluation 9. Risk Management 10. Execution 11. Research 12. Production ### Grading - Class Participation: 10% - Homework Assignments: 40% - Final Project: 50% ### Policies - **Late submissions** will not be accepted. - **Academic integrity** is expected. Any violation will result in a failing grade. - **Collaboration** is encouraged, but each student must submit their own work. - **Questions** should be asked during office hours or via email. # Course Details ## 1. Introduction ### What is Algorithmic Trading? - Implementation of a trading strategy as a computer program. - Also known as automated trading, black-box trading, or quant trading. ### Why Algorithmic Trading? - Speed - Cost - Consistency - Discipline - Scalability ### Challenges of Algorithmic Trading - Data - Computing Power - Statistical Analysis - Software Engineering - Market Microstructure - Execution ### The Trading Process 1. Idea 2. Data 3. Research 4. Backtesting 5. Strategy Design 6. Implementation 7. Execution 8. Monitoring ### Careers in Algorithmic Trading - Researcher - Strategist - Developer - Trader - Risk Manager ## 2. Linear Models ### Linear Regression - A linear approach for modelling the relationship between a scalar response and one or more explanatory variables (also known as independent and dependent variables). - The case of one explanatory variable is called simple linear regression. - For more than one explanatory variable, the process is called multiple linear regression. ### Ordinary Least Squares (OLS) - OLS seeks to minimize the sum of squared residuals. - Residuals are the difference between the observed value and the predicted value. ### Assumptions of OLS - The errors have zero mean. - The errors have constant variance. - The errors are uncorrelated. - The errors are normally distributed. ### Problems with OLS - Multicollinearity - Overfitting - Autocorrelation - Heteroskedasticity ### Regularization - Regularization is the process of adding information in order to solve an ill-posed problem or to prevent overfitting. - Also known as shrinkage or penalization. ### Ridge Regression - Also known as Tikhonov regularization. - Adds a penalty term to the OLS objective function that is proportional to the square of the magnitude of the coefficients. $\newline$ $\underset{\beta}{min} \sum_{i=1}^{n} (y_i - x_i^T \beta)^2 + \lambda \sum_{j=1}^{p} \beta_j^2$ $\newline$ Where: $\newline$ $y_i$ is the response variable for observation i, $\newline$ $x_i$ is the vector of predictors for observation i, $\newline$ $\beta$ is the vector of coefficients, $\newline$ $\lambda$ is the regularization parameter. - Ridge regression shrinks the coefficients towards zero, but does not set them exactly to zero. ### Lasso Regression - Adds a penalty term to the OLS objective function that is proportional to the absolute value of the magnitude of the coefficients. $\newline$ $\underset{\beta}{min} \sum_{i=1}^{n} (y_i - x_i^T \beta)^2 + \lambda \sum_{j=1}^{p} |\beta_j|$ $\newline$ Where: $\newline$ $y_i$ is the response variable for observation i, $\newline$ $x_i$ is the vector of predictors for observation i, $\newline$ $\beta$ is the vector of coefficients, $\newline$ $\lambda$ is the regularization parameter. - Lasso regression shrinks the coefficients towards zero, and can set some of them exactly to zero. ### Elastic Net Regression - Combines Ridge and Lasso regression. $\newline$ $\underset{\beta}{min} \sum_{i=1}^{n} (y_i - x_i^T \beta)^2 + \lambda_1 \sum_{j=1}^{p} |\beta_j| + \lambda_2 \sum_{j=1}^{p} \beta_j^2$ $\newline$ Where: $\newline$ $y_i$ is the response variable for observation i, $\newline$ $x_i$ is the vector of predictors for observation i, $\newline$ $\beta$ is the vector of coefficients, $\newline$ $\lambda_1$ is the Lasso regularization parameter, $\newline$ $\lambda_2$ is the Ridge regularization parameter. - Elastic Net regression shrinks the coefficients towards zero, and can set some of them exactly to zero. ### Example #### Data | Date | SPY | VIX | GLD | | :----- | :---- | :---- | :---- | | 202001 | 0.03 | 0.20 | 0.05 | | 202002 | -0.08 | 0.50 | 0.01 | | 202003 | -0.12 | 0.80 | 0.09 | | 202004 | 0.13 | -0.40 | -0.03 | | 202005 | 0.05 | -0.30 | 0.02 | #### Linear Regression $SPY = \beta_0 + \beta_1 VIX + \beta_2 GLD + \epsilon$ $\newline$ **Results**: | | Estimate | Std. Error | t value | Pr(>|t|) | | :----- | :------- | :--------- | :------ | :------- | | (Intercept) | 0.0018 | 0.0188 | 0.096 | 0.930 | | VIX | -0.1357 | 0.0681 | -1.993 | 0.156 | | GLD | 0.8197 | 0.4922 | 1.665 | 0.218 | - VIX has a negative coefficient. - GLD has a positive coefficient. - The p-values are high. - The $R^2$ is 0.769. ## 3. Backtesting ### What is Backtesting? - The process of testing a trading strategy on historical data. - Also known as historical simulation or retrospective testing. ### Why Backtesting? - Evaluate the performance of a trading strategy. - Identify potential problems. - Optimize parameters. - Compare different strategies. ### Challenges of Backtesting - Data snooping - Overfitting - Look-ahead bias - Transaction costs - Market impact - Liquidity ### Backtesting Framework 1. Data 2. Signals 3. Portfolio Construction 4. Execution 5. Performance Evaluation ### Data - Price data (OHLCV) - Fundamental data - Alternative data ### Signals - Technical indicators - Statistical models - Machine learning models ### Portfolio Construction - Asset allocation - Position sizing - Leverage ### Execution - Order placement - Order routing - Transaction costs ### Performance Evaluation - Returns - Risk - Sharpe ratio - Maximum drawdown ### Data Snooping - The misuse of data mining techniques to identify patterns in historical data that appear to be predictive but are not. Resulting in over-optimistic results. - Also known as data dredging, p-hacking, or cherry picking. ### Preventing Data Snooping - Holdout data - Cross-validation - Multiple testing correction ### Overfitting - The production of an analysis that corresponds too closely or exactly to a particular set of data, and may therefore fail to fit additional data or predict future observations reliably. ### Preventing Overfitting - Regularization - Early stopping - Ensemble methods ### Look-Ahead Bias - The use of information in a backtest that would not have been available at the time the trading decision was made. - Also known as foresight bias or hindsight bias. ### Preventing Look-Ahead Bias - Use only past data - Watanabe-Watkins estimator - Time series cross-validation ### Transaction Costs - The costs associated with trading, such as commissions, fees, and taxes. ### Incorporating Transaction Costs - Fixed transaction costs - Proportional transaction costs - Slippage ### Market Impact - The effect of a trader's orders on the price of an asset. ### Incorporating Market Impact - Volume Weighted Average Price (VWAP) - Implementation Shortfall ### Liquidity - The degree to which an asset can be bought or sold quickly in the market without affecting the asset's price. ### Incorporating Liquidity - Volume constraints - Price limits ## 4. Nonlinear Models ### Nonlinear Regression - A form of regression analysis in which observational data are modeled by a nonlinear function which depends on one or more independent variables. ### Why Nonlinear Models? - Capture nonlinear relationships - Improve accuracy - Generate more robust results ### Types of Nonlinear Models - Polynomial regression - Spline regression - Neural networks - Support vector machines - Decision trees ### Polynomial Regression - A form of regression in which the relationship between the independent variable $x$ and the dependent variable $y$ is modeled as an nth degree polynomial in $x$. - $y = \beta_0 + \beta_1 x + \beta_2 x^2 +... + \beta_n x^n + \epsilon$ ### Spline Regression - A form of regression in which the relationship between the independent variable $x$ and the dependent variable $y$ is modeled as a piecewise polynomial function. - Splines are defined by a set of knots, which are points where the polynomial pieces join. ### Neural Networks - A computational model inspired by the structure and function of biological neural networks. - Neural networks are composed of layers of interconnected nodes, or neurons. - Each connection between neurons has a weight associated with it. - The output of a neuron is a nonlinear function of its inputs. ### Support Vector Machines - A supervised learning model that uses a set of hyperplanes to separate data into classes. - SVMs can be used for both classification and regression. ### Decision Trees - A supervised learning model that uses a tree-like structure to make decisions. - Decision trees are composed of nodes, branches, and leaves. - Each node represents a feature, each branch represents a decision rule, and each leaf represents a class or a value. ### Example #### Data | Date | SPY | VIX | GLD | | :----- | :---- | :---- | :---- | | 202001 | 0.03 | 0.20 | 0.05 | | 202002 | -0.08 | 0.50 | 0.01 | | 202003 | -0.12 | 0.80 | 0.09 | | 202004 | 0.13 | -0.40 | -0.03 | | 202005 | 0.05 | -0.30 | 0.02 | #### Neural Network Regression $SPY = f(VIX, GLD)$ $\newline$ **Results**: - The neural network can capture nonlinear relationships between VIX, GLD, and SPY. - The neural network parameters are difficult to interpret. - The neural network can overfit the data. ## 5. Feature Importance ### What is Feature Importance? - A numerical value assigned to a feature that indicates how useful that feature is for predicting a target variable. - Also known as variable importance or attribute importance. ### Why Feature Importance? - Identify the most important features. - Improve model accuracy. - Reduce overfitting. - Gain insight into the data. ### Types of Feature Importance - Model-based feature importance - Permutation feature importance - SHAP values ### Model-Based Feature Importance - Feature importance based on the coefficients of a linear model. - Feature importance based on the tree structure of a decision tree. - Feature importance based on the weights of a neural network. ### Permutation Feature Importance - Feature importance based on the decrease in model performance when a feature is randomly shuffled. - Also known as mean decrease accuracy (MDA). ### SHAP Values - Feature importance based on game theory. - SHAP values decompose the prediction into the contribution of each feature. ### Example #### Data | Date | SPY | VIX | GLD | | :----- | :---- | :---- | :---- | | 202001 | 0.03 | 0.20 | 0.05 | | 202002 | -0.08 | 0.50 | 0.01 | | 202003 | -0.12 | 0.80 | 0.09 | | 202004 | 0.13 | -0.40 | -0.03 | | 202005 | 0.05 | -0.30 | 0.02 | #### Random Forest Regression $SPY = f(VIX, GLD)$ $\newline$ **Results**: | Feature | Importance | | :------ | :--------- | | VIX | 0.60 | | GLD | 0.40 | - VIX is the most important feature. - GLD is less important. ## 6. Structural Breaks ### What are Structural Breaks? - A structural break is an unexpected change in the parameters of a model over time. - Also known as a regime shift or a change point. ### Why Structural Breaks? - Identify changes in the market. - Improve model performance. - Adapt trading strategies. ### Types of Structural Breaks - Sudden structural breaks - Gradual structural breaks - Recurring structural breaks ### Detecting Structural Breaks - Visual inspection - Statistical tests - Change point detection algorithms ### Visual Inspection - Plot the data and look for sudden changes in the mean, variance, or correlation. ### Statistical Tests - Chow test - CUSUM test - Rolling regression ### Change Point Detection Algorithms - Bayesian change point detection - Hidden Markov models ### Handling Structural Breaks - Train models on recent data - Use adaptive models - Employ regime switching models ### Train Models on Recent Data - Train models on data from the most recent regime. - Discard old data that is no longer relevant. ### Use Adaptive Models - Use models that can adapt to changes in the data. - Examples: Kalman filters, recursive least squares. ### Employ Regime Switching Models - Use models that explicitly model different regimes. - Examples: Hidden Markov models, Threshold autoregressive models. ### Example #### Data | Date | SPY | | :----- | :---- | | 201901 | 0.05 | | 201902 | 0.03 | | 201903 | 0.02 | | 201904 | 0.04 | | 201905 | -0.06 | | 201906 | 0.07 | | 201907 | 0.01 | | 201908 | -0.03 | | 201909 | 0.02 | | 201910 | 0.03 | | 201911 | 0.04 | | 201912 | 0.01 | | 202001 | 0.03 | | 202002 | -0.08 | | 202003 | -0.12 | | 202004 | 0.13 | | 202005 | 0.05 | #### Chow Test - Test for a structural break in 202001. - The p-value smaller than 0.05. - Reject the null hypothesis. - There is a structural break in 202001. ## 7. Strategy Design ### What is Strategy Design? - The process of creating a trading strategy that is expected to be profitable. - Also known as strategy development or strategy construction. ### Why Strategy Design? - Generate profits - Manage risk - Achieve investment goals ### Types of Trading Strategies - Trend following - Mean reversion - Statistical arbitrage - Event driven - High frequency trading ### Trend Following - A strategy that seeks to profit from assets that are trending up or down. - Buy when the price is trending up. - Sell when the price is trending down. ### Mean Reversion - A strategy that seeks to profit from assets that are expected to revert to their mean. - Buy when the price is below its mean. - Sell when the price is above its mean. ### Statistical Arbitrage - A strategy that seeks to profit from temporary mispricings between related assets. - Identify pairs of assets that are highly correlated. - Buy the underpriced asset. - Sell the overpriced asset. - Wait for the mispricing to correct. ### Event Driven - A strategy that seeks to profit from specific events, such as mergers, acquisitions, or bankruptcies. - Buy the stock of a company that is about to be acquired. - Sell the stock of a company that is about to go bankrupt. ### High Frequency Trading - A strategy that uses high speed computers and algorithms to execute a large number of orders in a very short period of time. - Profit from small price discrepancies. ### Strategy Design Process 1. Idea generation 2. Data collection 3. Feature engineering 4. Model selection 5. Backtesting 6. Optimization 7. Risk management 8. Implementation ### Idea Generation - Read research papers - Attend conferences - Talk to other traders - Brainstorm ### Data Collection - Collect relevant data for the strategy. - Clean and prepare the data. ### Feature Engineering - Create new features from the existing data. - Use domain knowledge to create features that are likely to be predictive. ### Model Selection - Select a model that is appropriate for the strategy. - Consider the trade-off between accuracy and complexity. ### Backtesting - Test the strategy on historical data. - Avoid data snooping and overfitting. ### Optimization - Optimize the parameters of the strategy. - Use a robust optimization method. ### Risk Management - Identify potential risks and develop strategies to manage them. - Set stop-loss orders. - Limit position size. ### Implementation - Implement the strategy in a production environment. - Monitor the strategy and make adjustments as needed. ### Example #### Idea - Buy breakouts. - A breakout is when the price of an asset moves above a resistance level or below a support level. #### Data - Collect daily OHLCV data for SPY. #### Feature Engineering - Calculate the 20-day high and low. #### Model Selection - Use a simple rule-based strategy. - Buy when the price exceeds the 20-day high. - Sell when the price falls below the 20-day low. #### Backtesting - Test the strategy on historical data. - Calculate the Sharpe ratio, maximum drawdown, and other performance metrics. #### Optimization - Optimize the lookback period for the high and low. #### Risk Management - Set a stop-loss order at 1% below the purchase price. - Limit position size to 1% of the portfolio. #### Implementation - Implement the strategy in a production environment. - Monitor the strategy and make adjustments as needed. ## 8. Performance Evaluation ### What is Performance Evaluation? - The process of measuring the performance of a trading strategy. - Also known as performance measurement or performance attribution. ### Why Performance Evaluation? - Determine if a strategy is profitable. - Compare different strategies. - Identify areas for improvement. - Allocate capital. ### Performance Metrics - Returns - Risk - Risk-adjusted returns - Drawdown - Turnover ### Returns - The profit or loss generated by a trading strategy over a period of time. - Measured in dollars or as a percentage of capital. - Types of returns: - Gross returns - Net returns - Arithmetic returns - Geometric returns - Time-weighted returns - Money-weighted returns ### Risk - The uncertainty associated with a trading strategy. - Measured by: - Volatility - Beta - Value at Risk (VaR) - Expected Shortfall (ES) ### Risk-Adjusted Returns - Returns adjusted for the risk taken to generate them. - Sharpe Ratio $\newline$ $SharpeRatio = \frac{R_p-R_f}{\sigma_p}$ - $R_p$ is the portfolio return - $R_f$ is the risk-free rate - $\sigma_p$ is the standard deviation of the portfolio ### Drawdown - The peak-to-trough decline during a specified period. - Maximum Drawdown - Average Drawdown - Time Underwater ### Turnover - The amount of trading activity in a portfolio. - The higher the turnover, the more transaction costs will be incurred. ### Benchmarking - Compare the performance of a trading strategy to a benchmark. - Examples of benchmarks: - S&P 500 - MSCI World - HFRX Global Hedge Fund Index ### Attribution - Determine the sources of a trading strategy's performance - Factor-based attribution - Position-based attribution ### Factor-Based Attribution - Attribute performance to different risk factors, such as: - Market risk - Size risk - Value risk - Momentum risk ### Position-Based Attribution - Attribute performance to individual positions in the portfolio. - Useful for identifying the best and worst performing positions. ### Example #### Strategy - Buy SPY when the 50-day moving average crosses above the 200-day moving average. - Sell SPY when the 50-day moving average crosses below the 200-day moving average. #### Performance Metrics - Annualized Return: 10% - Volatility: 15% - Sharpe Ratio: 0.67 - Maximum Drawdown: -20% - Turnover: 1x - Benchmark: S\&P 500 #### Benchmarking | Metric | Strategy | S\&P 500 | | :---------------- | :------- | :------- | | Annualized Return | 10% | 12% | | Volatility | 15% | 18% | | Sharpe Ratio | 0.67 | 0.67 | | Maximum Drawdown | -20% | -25% | #### Attribution - The strategy's performance is primarily driven by market risk. - The strategy's best performing positions are in large-cap stocks. ## 9. Risk Management ### What is Risk Management? - The process of identifying, assessing, and controlling risks. - Also known as risk control or risk mitigation. ### Why Risk Management? - Protect capital - Limit losses - Ensure the long-term viability of a trading strategy ### Types of Risks - Market risk - Credit risk - Liquidity risk - Operational risk - Model risk ### Market Risk - The risk of losses due to changes in market conditions, such as: - Interest rates - Exchange rates - Commodity prices - Equity prices ### Credit Risk - The risk of losses due to a borrower's failure to repay a debt. ### Liquidity Risk - The risk of losses due to the inability to buy or sell an asset quickly enough to prevent a loss. ### Operational Risk - The risk of losses due to errors, fraud, or other operational failures. ### Model Risk - The risk of losses due to the use of inaccurate or inappropriate models. ### Risk Management Techniques - Diversification - Hedging - Stop-loss orders - Position sizing - Capital allocation ### Diversification - Reduce risk by investing in a variety of assets. - Correlation is the key to diversification. ### Hedging - Reduce risk by taking offsetting positions in related assets. ### Stop-Loss Orders - Limit losses by automatically selling an asset when it reaches a certain price. ### Position Sizing - Control risk by limiting the size of each position. #### Kelly Criterion - A formula for determining the optimal size of a bet. $f^* = \frac{bp - q}{b} = \frac{p(b+1)-1}{b}$ Where: - $f^*$ is the fraction of current wealth to bet - $b$ is the net odds received on the wager; that is, you could win \$b for every \$1 wagered - $p$ is the probability of winning - $q$ is the probability of losing, which is $1 - p$ ### Capital Allocation - Allocate capital to different trading strategies based on risk and return. ### Risk Metrics - Volatility - Beta - Value at Risk (VaR) - Expected Shortfall (ES) - Stress testing ### Volatility - A measure of the dispersion of returns for a given security or market index. $\sigma = \sqrt{\frac{\sum_{i=1}^{n}(x_i - \bar{x})^2}{n-1}}$ Where: - $x_i$ is the i-th observation - $\bar{x}$ is the mean of the observations - $n$ is the number of observations ### Beta - A measure of the volatility, or systematic risk, of a security or a portfolio in comparison to the market as a whole. $\beta = \frac{Cov(r_e,r_m)}{Var(r_m)}$ Where: - $r_e$ is the return on the asset - $r_m$ is the return on the overall market - $Cov(r_e,r_m)$ is the covariance between the return on the asset and the return on the overall market - $Var(r_m)$ is the variance of the return on the overall market ### Value at Risk (VaR) - A measure of the risk of loss for investments. - Estimates how much a set of investments might lose (with a given probability), given normal market conditions, in a set time period such as a day. ### Expected Shortfall (ES) - Measure of risk, closely related to VaR, that quantifies the expected loss beyond the VaR level. ### Stress Testing - Simulate extreme market conditions to assess the potential impact on a portfolio. ### Example #### Strategy - Buy SPY when the 50-day moving average crosses above the 200-day moving average. - Sell SPY when the 50-day moving average crosses below the 200-day moving average. #### Risk Management Techniques - Stop-loss orders: Set a stop-loss order at 1% below the purchase price. - Position sizing: Limit position size to 1% of the portfolio. - Capital allocation: Allocate 10% of the portfolio to this strategy. #### Risk Metrics - Volatility: 15% - Beta: 1.0 - VaR: 2% - ES: 3% ## 10. Execution ### What is Execution? - The process of implementing a trading strategy in the market. - Also known as order execution or trade execution. ### Why Execution? - Generate profits - Minimize transaction costs - Minimize market impact - Ensure timely execution ### Order Types - Market order - Limit order - Stop order - Stop-limit order - Fill or Kill (FOK) - Immediate or Cancel (IOC) - Day order - Good-Til-Cancelled(GTC) ### Market Order - An order to buy or sell an asset immediately at the best available price. ### Limit Order - An order to buy or sell an asset at a specified price or better. Has a limit price. ### Stop Order - An order to buy or sell an asset when it reaches a certain price. ### Stop-Limit Order - Combination of a stop order and a limit order. ### Fill or Kill (FOK) - A type of time-in-force order that instructs a brokerage to execute the entire order immediately and completely or not at all. ### Immediate or Cancel (IOC) - An order that instructs a broker to execute all or part of the order immediately and to cancel any unfilled portions of the order. ### Day Order - An order that expires at the end of the trading day if it is not executed. ### Good-Til-Cancelled(GTC) - An order that remains in effect until it is either executed or cancelled by the investor. ### Execution Venues - Exchanges - Electronic Communication Networks (ECNs) - Dark pools - Over-the-counter (OTC) markets ### Exchanges - A marketplace where securities, commodities, derivatives and other financial instruments are traded. - Examples: - New York Stock Exchange (NYSE) - Nasdaq - Chicago Mercantile Exchange (CME) ### Electronic Communication Networks (ECNs) - A computerized system that automatically matches buy and sell orders for securities in the market. ### Dark Pools - A private exchange or forum for trading securities, derivatives, and other financial instruments. ### Over-the-Counter (OTC) Markets - A decentralized market in which market participants trade securities, commodities, currencies, or other instruments directly between two parties, without a central exchange or broker. ### Execution Algorithms - Volume Weighted Average Price (VWAP) - Time Weighted Average Price (TWAP) - Percentage of Volume (POV) - Implementation Shortfall (IS) ### Volume Weighted Average Price (VWAP) - An execution algorithm that seeks to execute an order at the volume-weighted average price for a specified period. $VWAP = \frac{\sum_{j}^{}P_{j}\times V_{j}}{\sum_{j}^{}V_{j}}$ Where: - $P_j$ = Price of trade j - $V_j$ = Volume of trade j ### Time Weighted Average Price (TWAP) - An execution algorithm that seeks to execute an order at the time-weighted average price for a specified. ### Percentage of Volume (POV) - An execution algorithm that seeks to execute a specified percentage of the market volume. ### Implementation Shortfall (IS) - An execution algorithm that seeks to minimize the difference between the paper return and the actual return. ### Market Impact - The effect of a trader's orders on the price of an asset. ### Reducing Market Impact - Use stealth orders - Trade during periods of high liquidity - Use execution algorithms ### Slippage - The difference between the expected price of a trade and the actual price at which the trade is executed. ### Reducing Slippage - Use limit orders - Trade during periods of high liquidity - Use execution algorithms ### Example #### Strategy - Buy SPY when the 50-day moving average crosses above the 200-day moving average. - Sell SPY when the 50-day moving average crosses below the 200-day moving average. #### Execution - Use a VWAP execution algorithm to execute the orders over a 1-hour period. - Limit order ## 11. Research ### What is Research? - The process of investigating and studying materials and sources in order to establish facts and reach new conclusions. ### Why Research? - Generate new trading ideas - Improve existing trading strategies - Understand the market - Identify risks ### Research Process 1. Formulate a research question 2. Collect data 3. Analyze data 4. Draw conclusions 5. Implement findings ### Research