Algorithmic Trading: an Overview

31
Algorithmic Trading: an Оverview Presented by Karlis Liepins Riga, 2017

Transcript of Algorithmic Trading: an Overview

Page 1: Algorithmic Trading: an Overview

Algorithmic Trading:an Оverview

Presented by Karlis LiepinsRiga, 2017

Page 2: Algorithmic Trading: an Overview

All the buzz..

Algo-trading

Automated trading systems

High Frequency Trading/Low Latency Trading

Black box

Robots

50-85% of traded volume in US stocks is generated by robots

Flash crash

Robots take advantage of true investors?

Page 3: Algorithmic Trading: an Overview

Motivation

Processing power

Speed of execution (think 0.00001 seconds)

Less human error

Simplify repetitive tasks

Page 4: Algorithmic Trading: an Overview

What are the objectives?

Smart execution/Hedging (min costs)

Automating a strategy (make profit)

Page 5: Algorithmic Trading: an Overview

What are the objectives?

Smart execution/Hedging (min costs)

Automating a strategy (make profit)

Brokers, Asset managers, etc.

Used when placing large orders

Disclosing information from the market

Minimizing the impact on the price

Page 6: Algorithmic Trading: an Overview

Smart execution

Example:

Need to buy 100’000 shares of L’Oreal stock

a) Place all in one order

b) Divide into 100 orders, 1000 shares each

c) Divide into 100 orders, 1000 shares each and place one every 5 minutes

Page 7: Algorithmic Trading: an Overview

What can be done?

TWAP

VWAP

Percentage of Volume (POV)

Minimal Impact (dark pools)

Cost driven

Other

Page 8: Algorithmic Trading: an Overview

What can be done?

TWAP

VWAP

Percentage of Volume (POV)

Minimal Impact (dark pools)

Cost driven

Other

Time Weighted Average Price

Attempt to match price over time

100’000 shares over 5hrs = 5’000 shares every 15 minutes

Possible improvements:

- more flexible schedule

- make it less predictable

Page 9: Algorithmic Trading: an Overview

What can be done?

TWAP

VWAP

Percentage of Volume (POV)

Minimal Impact (dark pools)

Cost driven

Other

Volume Weighted Average Price

Large volume transaction have more impact on benchmark price

Every 15 minutes place an order with a proportional size to the traded volume

Relies on Historical trading volumes

Page 10: Algorithmic Trading: an Overview

VWAP

More activity happening during around the opening and closing

Attempt to get the price where the activity actually happened

Page 11: Algorithmic Trading: an Overview

What can be done?

TWAP

VWAP

Percentage of Volume (POV)

Minimal Impact (dark pools)

Cost driven

Other

Example - trade 10% of each market trade

A stock with original daily turnover of 1’000’000 shares should result in execution of 100’000 shares

More dynamic than TWAP & VWAP

Page 12: Algorithmic Trading: an Overview

What can be done?

TWAP

VWAP

Percentage of Volume (POV)

Minimal Impact (dark pools)

Cost driven

Other

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

Liquidity in Dark Pools is limited, thus usually combined with other strategies

Other options: broker’s internal crossing networks, hidden order types (iceberg)

Page 13: Algorithmic Trading: an Overview

What can be done?

TWAP

VWAP

Percentage of Volume (POV)

Minimal Impact (dark pools)

Cost driven

Other

Trading too aggressively may result in considerable market impact, while trading too passively incurs timing risk

Balancing impact and timing

Very poor liquidity / huge bid-ask spread

Factors:

- order size

- time available for trading

- asset specific (liquidity and volatility)

- investor’s urgency or risk aversion

Page 14: Algorithmic Trading: an Overview

What can be done?

TWAP

VWAP

Percentage of Volume (POV)

Minimal Impact (dark pools)

Cost driven

Other

Wait for specific market conditions

More advanced/opportunistic algorithms

- Momentum detection

Hire someone to do it! Execution Services

Page 15: Algorithmic Trading: an Overview

What are the objectives?

Smart execution (min costs)

Automating a strategy (make profit)

Market making

Statistical arbitrage

Front running

Outsmarting the others

Page 16: Algorithmic Trading: an Overview

Automating a Strategy

Market Making

Statistical Arbitrage

Front Running

Outsmarting the others

Keep Best Bid and Best Ask in the market

Earn few cents per transaction

Some exchanges offer rebates

Improves the market

Provides liquidity

Must be very smart about risk management

Think - casino/online poker

Page 17: Algorithmic Trading: an Overview

Automating a Strategy

Market Making

Statistical Arbitrage

Front Running

Outsmarting the others

Page 18: Algorithmic Trading: an Overview

Automating a Strategy

Market Making

Statistical Arbitrage

Front Running

Outsmarting the others

Over long period of time/many transactions statistically gives near riskless profit

Pair/Spread trading (Pepsi vs Coke, Stock vs Industry, fungible commodities)

Comparing Index(ETF) to basket

Mean reversion

Page 19: Algorithmic Trading: an Overview

General Motors vs Ford Motors

Page 20: Algorithmic Trading: an Overview

Automating a Strategy

Market Making

Statistical Arbitrage

Front Running

Outsmarting the others

Guerilla algorithms to find Icebergs(liquidity):

- Probabilistic models

- Compare actual trades vs order book

- Identify patterns

HFT & price forecasting

Signal/News trading

Abusive strategies: e.g. flooding the system with orders to lower the latency for others

Page 21: Algorithmic Trading: an Overview

Automating a Strategy

Market Making

Statistical Arbitrage

Front Running

Outsmarting the others

Pattern recognition:

- Price/Volume /Order Book

- Finding other algos (reverse engeneering)

Market sentiment (e.g. processes Twitter mood)

Fair price (derivatives)

Be crative!

Page 22: Algorithmic Trading: an Overview

The Cycle of Automating a Strategy

1) Idea

2) Quantify the idea, Prototype an algorithm

3) Backtest

4) Test in safe environment

5) Production version/Babysitting

6) Constant improvement

Page 23: Algorithmic Trading: an Overview

The Cycle of Automating a Strategy

1) Idea

2) Quantify the idea, Prototype an algorithm

3) Backtest

4) Test in safe environment

5) Production version/Babysitting

6) Constant improvement

Gut feeling or a practice

Often comes from competence in other fields (market, sector, technology, processes…)

General ideas are simple and public, it’s often the details and parameters that make the difference

Page 24: Algorithmic Trading: an Overview

The Cycle of Automating a Strategy

1) Idea

2) Quantify the idea, Prototype an algorithm

3) Backtest

4) Test in safe environment

5) Production version/Babysitting

6) Constant improvement

Math : Trivial ~ Hardcore

Building the correct model

Example:

Momentum following

Idea: security on an uptrend/downtrend will continue on an uptrend/downtrend

Implementation: take 1st and 2nd derivative of moving average, trade when specific threshold 1st/2nd is crossed

Page 25: Algorithmic Trading: an Overview

The Cycle of Automating a Strategy

1) Idea

2) Quantify the idea, Prototype an algorithm

3) Backtest

4) Test in safe environment

5) Production version/Babysitting

6) Constant improvement

Getting good data (can be extremely expensive)

Overfitting - can the past results be applied in the future trading

Defining parameters/Testing them

Risk evaluation (Sharpe ratio, Draw down, Expected shortfall, Value at Risk)

Is the idea profitable?

Page 26: Algorithmic Trading: an Overview

The Cycle of Automating a Strategy

1) Idea

2) Quantify the idea, Prototype an algorithm

3) Backtest

4) Test in safe environment

5) Production version/Babysitting

6) Constant improvement

Test on Demo/other assets/extremely small amounts

Finding bugs

Detecting corner cases

What about trading costs?

Is it still profitable?

Page 27: Algorithmic Trading: an Overview

The Cycle of Automating a Strategy

1) Idea

2) Quantify the idea, Prototype an algorithm

3) Backtest

4) Test in safe environment

5) Production version/Babysitting

6) Constant improvement

Close to impossible to simulate the actual market

Quality of execution (slippage)

Speed

Interaction with other algos/impact on market

Is it still profitable?

Identify the problems if not

Page 28: Algorithmic Trading: an Overview

The Cycle of Automating a Strategy

1) Idea

2) Quantify the idea, Prototype an algorithm

3) Backtest

4) Test in safe environment

5) Production version/Babysitting

6) Constant improvement

Markets are constantly changing

New participants, new competitors

Strategies often stop being profitable after a while

Page 29: Algorithmic Trading: an Overview

Dangers of Algo-trading

Robots do not understand if they’re doing something wrong, lots of pressure on the design (security, controls, limits…)

More and more reliability on IT (networks, servers, hardware, data feed, latency)

Very small margin of error

Keeping your idea secret and protected

The field is still rather new and proper regulation is being drafted as we speak

Due to the above, there is a risk of systemic failures

Page 30: Algorithmic Trading: an Overview

Camber Energy example

Page 31: Algorithmic Trading: an Overview

Thank you!