Presentation is loading. Please wait.

Presentation is loading. Please wait.

Algorithmic Trading Financial Engineering Club FINANCIAL ENGINEERING CLUB.

Similar presentations


Presentation on theme: "Algorithmic Trading Financial Engineering Club FINANCIAL ENGINEERING CLUB."— Presentation transcript:

1 Algorithmic Trading Financial Engineering Club FINANCIAL ENGINEERING CLUB

2 Definition Algorithmic trading, also called automated trading, black-box trading, or algo-trading, is the use of electronic platforms for entering trading orders with an algorithm which executes pre-programmed trading instructions whose variables may include timing, price, or quantity of the order, or in many cases initiating the order by automated computer programs.

3 Motivation Algorithms can process larger amounts of data than humans. Algorithms can make computations and decisions faster than humans. Algorithms can execute more precisely. A simple strategy can be automated so that people can focus their time elsewhere.

4 Objectives Smart Execution Automating a Strategy

5 Objectives Smart Execution Automating a Strategy Smart Execution Automating a Strategy Smart Execution Automating a Strategy Deals with the execution of an order. Used by large brokers, asset managers, etc. when placing orders How can I place a large order and not get screwed?

6 How To Not Get Screwed When placing a large order, try to minimize your impact on the market. Scenario: I want to buy 50,000 shares of Chipotle (CMG) for $33,204,500: a)Put in order for all 50,000 at once b)Break order into 500 100-share lots and post all c)Break order in 500 100-share lots and post over one hour, considering how the market reacts

7 How To Not Get Screwed When placing a large order, try to minimize your impact on the market. Scenario: I want to buy 50,000 shares of Chipotle (CMG) for $33,204,500: a)Put in order for all 50,000 at once b)Break order into 500 100-share lots and post all c)Break order in 500 100-share lots and post over one hour, considering how the market reacts

8 How To Not Get Screwed Impact Driven Algorithms Reduce the effect that trading has on an asset’s price Iceberging – split larger order into many smaller ones: TWAP – Time Weighted Average Price VWAP – Volume Weighted Average Price More dynamic derivations Stops others from knowing you placed a large order and changing their positions, costing you money!

9 Time Weighted Average Price Attempt to match the benchmark of how an asset price changes over time. Implementation example: Buy 10,000 shares in 5 hours Place order for 500 shares every 15 minutes Improvements: Random lot sizes and intervals Offer more/less orders early on Adjust size based on market price

10 Volume Weighted Average Price VWAP is the volume-weighted average. Benchmark on trading price that gives large volume transactions more weight in deciding the price. Implementation example: Buy 10,000 shares Place order for proportional to volume traded in a 15-minute period every 15-minutes

11 Minimizing Impact Even More Routing orders to dark pools Private exchanges for trading securities Not available to general public No transparency Came about to facilitate block trades when we want to minimize market impact

12 Other Algorithms Cost-Driven Algorithms Minimize transaction and spread costs Also try to “time the market” right Opportunistic Algorithms Take advantage of favorable market conditions Liquidity driven Pair driven More on this later…

13 It’s a Business Firms like KCG (formerly GETCO) and Citadel offer execution services Deliver “price improvement” and “execution speed”

14 Understanding Execution Can Help Your Algorithm Improve your fill price Find others trying to “iceberg” and capitalize on this

15 Finding Hidden Liquidity Liquidity can be hidden in dark pools or in icebergs. Guerrilla algorithms try to find icebergs using probabilistic models Compare size and price of trades vs. order book quotes Identify patterns in order placement to identify a “source”

16 Readings Barry Johnson – Algorithmic Trading & DMA

17 Objectives Smart Execution Automating a Strategy

18 Objectives Smart Execution Automating a Strategy Smart Execution Automating a Strategy Smart Execution Automating a Strategy Designing, implementing, testing, and running an automated trading strategy.

19 In the Industry

20 Front Running Using small lots to find large, possibly iceberged orders. Send “ping” orders on one exchange to detect a hidden order and front run by changing your order on other exchanges. Latency is important

21 Automated Market Making Place a buy limit order and a sell limit order above and below the spread Capitalize on the spread When automated, a few pennies of profit per transaction can reach billions. Some exchanges offer rebates for market makers Fractions of a penny Improves market liquidity and narrows bid-ask spreads

22 Statistical Arbitrage Statistical Arbitrage capitalizes on opportunities that are not arbitrage in the literal sense, but over a long period of time they will statistically be near-riskless profit. Example – Index Arbitrage: Compare the price of an ETF to the weighted sum of its components Capitalize on price discrepancies, can predict the movement of the ETF if there is a price mismatch Latency sensitive!

23 You can design, test, and run an automated strategy!

24 Finding A Strategy The general ideas are simple and public The inner-workings, the securities to pick, the parameters, and the technology are not Strategies can be found in academic papers, online forums, and blogs

25 Popular Brokers for Automated Trading Interactive Brokers TradeStation NinjaTrader

26 Free Trading Platforms NinjaTrader TradeStation (requires brokerage account) Quantopian Build Your Own!

27 Getting Market Data Free Minute Level Data Yahoo Finance Google Finance Free BATS Tick and Quote Data Netfonds – last 20 days on US Equities https://github.com/FEC-UIUC/Netfonds-Tick-Capture FEC – Captured last 3 months and counting Want free data? This link could be helpful.link Low-cost Live and Historical Data Feeds Kinetick TickData More….

28 Testing A Strategy Back Testing – testing a strategy on historical market data Many trading platforms have built in backtesters NinjaTrader has a good one Quantopian has a good backtester for beginners

29 Testing A Strategy

30 Pitfalls: Overfitting – Performs well on a specific timeframe or security, but bad on the general case. Strategies can also fail to account for how they will impact the market Markets change. Strategy may have worked 4 years ago, but not now Solutions: Forward Testing – testing a strategy on live market data Incorporate slippage – let some orders be filled at an unfavorable price Having a large and recent data set Train your parameters on a partition of your test data, verify accuracy on the remaining portion

31 Momentum Following Idea: A security on an uptrend/downtrend will continue on an uptrend/downtrend. Simple implementation: Take the derivative and second derivative of a moving average. When a threshold first/second derivative is crossed: Buy/sell security in an amount proportional to these two parameters.

32 Mean Reversion Idea: Two or more securities that are co-integrated will revert to their mean ratio when a divergence occurs. Simple implementation: Identify two co-integrated securities (i.e XLE and PFE) Run a linear regression on XLE vs PFE on the last X days If current spread is 2 standard deviations above the regression: Buy XLE, sell PFE If current spread is 2 standard deviations below regression: Sell XLE, Buy PFE If current spread is within 0.5 standard deviations of the regression: Liquidate your position

33 Readings Quantitative Trading: How to Build Your Own Algorithmic Trading Business – Ernie Chan Algorithmic Trading & DMA – Barry Johnson Inside the Black Box – Rishi Narang Pairs Trading: Quantitative Methods and Analysis – Ganapathy Vidyamurthy

34 Quantopian https://www.quantopian.com/posts/mean-reversion-algorithm-for-club- use https://www.quantopian.com/posts/mean-reversion-algorithm-for-club- use A mean reversion strategy between XLE and PFE: Regresses the last X days, computes current spread’s Z-Score, and compares the Z-Score to a threshold to make trading decision. TODO – For the next 15 minutes, improve the sharpe ratio, max drawdown, and/or percent returns by tweaking the parameters at the top or manipulating the trading logic!


Download ppt "Algorithmic Trading Financial Engineering Club FINANCIAL ENGINEERING CLUB."

Similar presentations


Ads by Google