Upload
exante
View
312
Download
5
Embed Size (px)
Citation preview
Algorithmic Trading:an Оverview
Presented by Karlis LiepinsRiga, 2017
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?
Motivation
Processing power
Speed of execution (think 0.00001 seconds)
Less human error
Simplify repetitive tasks
What are the objectives?
Smart execution/Hedging (min costs)
Automating a strategy (make profit)
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
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
What can be done?
TWAP
VWAP
Percentage of Volume (POV)
Minimal Impact (dark pools)
Cost driven
Other
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
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
VWAP
More activity happening during around the opening and closing
Attempt to get the price where the activity actually happened
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
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)
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
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
What are the objectives?
Smart execution (min costs)
Automating a strategy (make profit)
Market making
Statistical arbitrage
Front running
Outsmarting the others
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
Automating a Strategy
Market Making
Statistical Arbitrage
Front Running
Outsmarting the others
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
General Motors vs Ford Motors
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
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!
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
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
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
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?
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?
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
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
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
Camber Energy example
Thank you!