SlideShare a Scribd company logo
DIY Quant strategies:
Is it possible to roll your own?

Jess Stauth, PhD
VP Quant Strategy
Bay Area Algorithmic Trading Meetup
Hacker Dojo * February 6, 2014
What makes a good equity quant strategy?
 Intuition. If you can‟t explain why it works, it doesn‟t
work.
 Reproducibility. If you can‟t backtest it, it doesn‟t work
(note the inverse does not necessarily hold).
 Access to data. If you can‟t get the signal (or get it in
time) you can‟t trade it. ($$$)
 Capacity/Execution You can‟t push a camel through the
eye of a needle. (1/$$$)
5 Basic Quant Strategies
1. Mean Reversion – What goes up… (special case: Pairs Trade)

2. Momentum – The trend is your friend.
3. Valuation – Buy low, sell high.
4. Sentiment – Buy the rumor, sell the news.
5. Seasonality – Sell in May and go away.
Out of scope for today‟s talk:
 Acronym soup (e.g. ML, OLMAR, PCA, ICA, OLS, etc.)
 Portfolio construction, risk optimization, etc.
 Asset clases
Pairs Trading
 Intuition: Find two assets linked to a single underlying „value‟
and exploit transient mispricing between them.
 Reproducibility: The phenomenon is well documented1,2.
 Data: For basic strategies all you need is pricing.
 Capacity: Can be quite small depending on the instruments.
Common pitfalls:
 Ignore the intuition requirement at your own peril! Cointegration works great, until it doesn‟t.
 Market neutral or „hedged‟ strategy, so you are forgoing any upward drift in the longer term.

1. Pairs Trading, Vidyamurthy 2004
2. Quantitative Trading, Chan 2009
Pairs Trading
Simplistic Intuition (cont‟d): If you assume the spread between stock 1 and stock 2 is
„stationary‟ and „normally distributed‟, then statistically you should be able to make money
by „buying‟ or „selling‟ the spread when it takes on extreme tail values.
Zx = (Price Stock1 – Price Stock2)/ Price Stock1
Pairs Trading: EWA/EWC Pair

6/06 – 6/12
Huapu Pan (NYC Algo Trading meetup member) Posted 12/19/13
“Ernie Chan‟s EWA/EWC Pair Trading”
https://www.quantopian.com/posts/ernie-chans-ewa-slash-ewc-pair-trading
Momentum Trading
 Intuition: Comes in many flavors (stock level, sector level, asset
class level) but comes back to the behavioral bias of „herding‟.
 Reproducibility: The phenomenon is well documented1.
 Data: For basic strategies all you need is pricing.
 Capacity: Can be quite small depending on the instruments.
Common pitfalls:
 The trend is your friend, until it isn‟t. Reversals can be devastating, especially when using
leverage.
1. Jegadeesh and Titman, Returns to Buying Winners and Selling Losers: Implications for Stock
Market Efficiency. Journal of Finance March 1993
2. Faber, A Quantitative Approach to Tactical Asset Allocation. Journal of Wealth Management 2013
Momentum Trading
Simple rules based approach
 Rank 1 > N stocks (sectors) by : [r20 – r200]
 Buy top K stocks (sectors) where absolute
momentum (20 vs. 200 day MA) > some
threshold.
 Else, hold cash.
Momentum Trading – Meb Faber RS Strategy

Backtest range: 11/04 – 2/13
John Chia Posted Feb 2013
“Mebane Faber Relative Strength Strategy with MA Rule”
https://www.quantopian.com/posts/mebane-faber-relative-strength-strategy-with-ma-rule
Valuation
 Intuition: In a nutshell, bargain shopping. Use fundamental ratio
analysis to identify stocks trading at a discount (or premium) and
buy (or sell) them accordingly.
 Reproducibility: The phenomenon is well documented.
 Data: Requires good coverage (breadth and depth) of
normalized corporate fundamental data.
 Capacity: Small cap stocks can be riskier, and higher friction to
trade.
Common pitfalls:
 Some cheap stocks are cheap for a reason. “Catch a falling knife” adage.
Valuation
Simple example: use price to earnings ratio as a proxy for „value‟
where low P/E looks „cheap‟ and high P/E looks „expensive‟.
 Rank universe 1-100 (or sector universe) on P/E
 Long only: buy the bottom (lowest P/E) decile
 Market neutral: buy the bottom decile, sell the top decile
In practice, a quant model would typically blend a number of
backward looking ratios an forward looking estimates along with
making sector specific adjustments and other bells, whistles.
Valuation: Screen on corporate fundamentals

Backtest range 11/25/2009 – 10/10/2013
Sam Lunt (11/4/2013) “Using Fetcher with Quandl”
https://www.quantopian.com/posts/using-the-fetcher-with-quandl
Sentiment: Short sellers
 Intuition: Follow the (short) money. Short sellers are the „smart
money‟, their trades are $ for $ higher conviction (to balance
risk).
 Reproducibility: The phenomenon is well documented.
 Data: Bi-monthly (delayed) short interest can be scraped from
NASDAQ. Borrow rates, real-time daily short interest data
aggregated from brokers is available for $$$.

 Capacity: Can be quite small depending on the instruments.
Common pitfalls:
 Beware the Short Squeeze! Crowded short trades can lead to a squeeze as short sellers rush to close
positions.
Sentiment: Short sellers
 Rank stocks 1 > N on Days To Cover ratio*
 Buy top 10%, short bottom 10%
 Rebalance periodically
*Days to cover =

Shares Held Short
Avg Daily Trade Share volume

The number of days of „average‟ trading it would take to
unwind the existing short positions.
Sentiment: Short sellers – Rank on Days to Cover

Backtest range: 3/15/12 – 3/15/13
Fawce (April 2013)
“Ranking and Trading on Days to Cover”
https://www.quantopian.com/posts/ranking-and-trading-on-days-to-cover
Seasonality
 Intuition: Sometimes (calendar driven fund flows
e.g. month end).
 Reproducibility: There‟s healthy debate on this
one.

 Data: end of day pricing and a calendar.
 Capacity: Depends on the instruments.

Common pitfalls:
 Overfitting / data mining is rampant in this type of analysis.
Seasonality
Simplest example is a simple 100% stock/bond annual
rotation model.
 Buy and hold equities (SPY) October thru April
 Buy and hold bonds (BSV) May thru Sept.
Seasonality: Sell in May

Backtest range: 10/1/09 – 12/31/12
Jess(May 2013)
“Sell in May and go away”
https://www.quantopian.com/posts/time-to-sell-in-may-and-go-away
Which of these strategies are most popular among
the „retail‟ or individual quants using Quantopian?
 Mean Reversion
 Momentum
 Valuation

 Sentiment
 Seasonality
 Other
25 Top Shared Algorithms of All Time
Combo Rank
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Post Title

Replies

Google Search Terms predict market movements
OLMAR implementation
Easy Volatility Investing by Tony Cooper @ Double-Digit Numerics
Global Minimum Variance Portfolio
discuss the sample algorithm
ML - Stochastic Gradient Descent Using Hinge Loss Function
Mebane Faber Relative Strength Strategy with MA Rule
OLMAR w/ NASDAQ 100 & dollar-volume
Bollinger Bands With Trading
Brent/WTI Spread Fetcher Example
Ernie Chan's Pairs Trade
Ranking and Trading on Days to Cover
Using the CNN Fear & Greed Index as a trading signal
Determining price direction using exponential and log-normal distributions
Time to sell in may and go away?
Simple Mean Reversion Strategy
Neural Network that tests for mean-reversion or momentum trending
Using weather as a trading signal
Momentum Trade
Trading Strategy: Mean-reversion
Global market rotation strategy
trading earnings surprises with Estimize data
Turtle Trading Strategy
SPY & SH algorithm - please review
New Feature: Fetcher!

TOTALS:

Views

Clones

64
64
57
28
12
10
22
31
18
17
15
4
18
9
27
6
4
6
5
13
53
34
11
21
27

31913
26039
15117
10222
18348
20400
11104
7760
8363
10821
10387
24906
9212
9539
8192
11794
10062
11940
8800
8228
7621
7496
7815
7443
7507

809
697
839
700
2882
972
617
697
560
327
328
379
318
606
261
270
402
199
455
213
94
129
299
194
108

576

311,029

13,355
25 Top Shared Algorithms of All Time
Combo Rank
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Post Title
Google Search Terms predict market movements
OLMAR implementation
Easy Volatility Investing by Tony Cooper @ Double-Digit Numerics
Global Minimum Variance Portfolio
discuss the sample algorithm
ML - Stochastic Gradient Descent Using Hinge Loss Function
Mebane Faber Relative Strength Strategy with MA Rule
OLMAR w/ NASDAQ 100 & dollar-volume
Bollinger Bands With Trading
Brent/WTI Spread Fetcher Example
Ernie Chan's Pairs Trade
Ranking and Trading on Days to Cover
Using the CNN Fear & Greed Index as a trading signal
Determining price direction using exponential and log-normal distributions
Time to sell in may and go away?
Simple Mean Reversion Strategy
Neural Network that tests for mean-reversion or momentum trending
Using weather as a trading signal
Momentum Trade
Trading Strategy: Mean-reversion
Global market rotation strategy
trading earnings surprises with Estimize data
Turtle Trading Strategy
SPY & SH algorithm - please review
New Feature: Fetcher!

Replies

Views

Clones

64
64
57
28
12
10
22
31
18
17
15
4
18
9
27
6
4
6
5
13
53
34
11
21
27

31913
26039
15117
10222
18348
20400
11104
7760
8363
10821
10387
24906
9212
9539
8192
11794
10062
11940
8800
8228
7621
7496
7815
7443
7507

809
697
839
700
2882
972
617
697
560
327
328
379
318
606
261
270
402
199
455
213
94
129
299
194
108
25 Top Shared Algorithms of All Time
Categorized
Volatility
5%

Technical
3%

Seasonality
3%

Portfolio Risk
6%

Momentum
18%

Mean
Reversion
37%

Area ~ page views
Sentiment
28%

What‟s missing from this picture??
Thank You.
Questions?

More Related Content

What's hot

"Portfolio Optimisation When You Don’t Know the Future (or the Past)" by Rob...
"Portfolio Optimisation When You Don’t Know the Future (or the Past)" by Rob..."Portfolio Optimisation When You Don’t Know the Future (or the Past)" by Rob...
"Portfolio Optimisation When You Don’t Know the Future (or the Past)" by Rob...
Quantopian
 
"From Trading Strategy to Becoming an Industry Professional – How to Break in...
"From Trading Strategy to Becoming an Industry Professional – How to Break in..."From Trading Strategy to Becoming an Industry Professional – How to Break in...
"From Trading Strategy to Becoming an Industry Professional – How to Break in...
Quantopian
 
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
Quantopian
 
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ..."A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
Quantopian
 
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D..."From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
Quantopian
 
QuantConnect - Introduction to Pairs Trading
QuantConnect - Introduction to Pairs TradingQuantConnect - Introduction to Pairs Trading
QuantConnect - Introduction to Pairs Trading
QuantConnect
 
Volatility Trading - Hedge Fund Strategies
Volatility Trading - Hedge Fund StrategiesVolatility Trading - Hedge Fund Strategies
Volatility Trading - Hedge Fund Strategies
Hedge Fund South Africa
 
Intro to Quant Trading Strategies (Lecture 1 of 10)
Intro to Quant Trading Strategies (Lecture 1 of 10)Intro to Quant Trading Strategies (Lecture 1 of 10)
Intro to Quant Trading Strategies (Lecture 1 of 10)
Adrian Aley
 
The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...
The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...
The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...
Quantopian
 
"Maximize Alpha with Systematic Factor Testing" by Cheng Peng, Software Engin...
"Maximize Alpha with Systematic Factor Testing" by Cheng Peng, Software Engin..."Maximize Alpha with Systematic Factor Testing" by Cheng Peng, Software Engin...
"Maximize Alpha with Systematic Factor Testing" by Cheng Peng, Software Engin...
Quantopian
 
What we learned from running a quant crypto hedge fund
What we learned from running a quant crypto hedge fundWhat we learned from running a quant crypto hedge fund
What we learned from running a quant crypto hedge fund
Yingdan (Mora) Liang
 
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...
Quantopian
 
"Don't Lose Your Shirt Trading Mean-Reversion" by Edith Mandel, Principal at ...
"Don't Lose Your Shirt Trading Mean-Reversion" by Edith Mandel, Principal at ..."Don't Lose Your Shirt Trading Mean-Reversion" by Edith Mandel, Principal at ...
"Don't Lose Your Shirt Trading Mean-Reversion" by Edith Mandel, Principal at ...
Quantopian
 
Backtesting And Live Trading With Interactive Brokers Using Python With Dr. H...
Backtesting And Live Trading With Interactive Brokers Using Python With Dr. H...Backtesting And Live Trading With Interactive Brokers Using Python With Dr. H...
Backtesting And Live Trading With Interactive Brokers Using Python With Dr. H...
QuantInsti
 
Classification of quantitative trading strategies webinar ppt
Classification of quantitative trading strategies webinar pptClassification of quantitative trading strategies webinar ppt
Classification of quantitative trading strategies webinar ppt
QuantInsti
 
"The 6 Stages of a Quant Equity Workflow" by Dr. Jessica Stauth, Vice Preside...
"The 6 Stages of a Quant Equity Workflow" by Dr. Jessica Stauth, Vice Preside..."The 6 Stages of a Quant Equity Workflow" by Dr. Jessica Stauth, Vice Preside...
"The 6 Stages of a Quant Equity Workflow" by Dr. Jessica Stauth, Vice Preside...
Quantopian
 
Combining the Best Stock Selection Factors by Patrick O'Shaughnessy at QuantC...
Combining the Best Stock Selection Factors by Patrick O'Shaughnessy at QuantC...Combining the Best Stock Selection Factors by Patrick O'Shaughnessy at QuantC...
Combining the Best Stock Selection Factors by Patrick O'Shaughnessy at QuantC...
Quantopian
 
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...
Quantopian
 
Order book dynamics in high frequency trading
Order book dynamics in high frequency tradingOrder book dynamics in high frequency trading
Order book dynamics in high frequency trading
QuantInsti
 
Peculiarities of Volatilities by Ernest Chan at QuantCon 2016
Peculiarities of Volatilities by Ernest Chan at QuantCon 2016Peculiarities of Volatilities by Ernest Chan at QuantCon 2016
Peculiarities of Volatilities by Ernest Chan at QuantCon 2016
Quantopian
 

What's hot (20)

"Portfolio Optimisation When You Don’t Know the Future (or the Past)" by Rob...
"Portfolio Optimisation When You Don’t Know the Future (or the Past)" by Rob..."Portfolio Optimisation When You Don’t Know the Future (or the Past)" by Rob...
"Portfolio Optimisation When You Don’t Know the Future (or the Past)" by Rob...
 
"From Trading Strategy to Becoming an Industry Professional – How to Break in...
"From Trading Strategy to Becoming an Industry Professional – How to Break in..."From Trading Strategy to Becoming an Industry Professional – How to Break in...
"From Trading Strategy to Becoming an Industry Professional – How to Break in...
 
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
 
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ..."A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
 
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D..."From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
 
QuantConnect - Introduction to Pairs Trading
QuantConnect - Introduction to Pairs TradingQuantConnect - Introduction to Pairs Trading
QuantConnect - Introduction to Pairs Trading
 
Volatility Trading - Hedge Fund Strategies
Volatility Trading - Hedge Fund StrategiesVolatility Trading - Hedge Fund Strategies
Volatility Trading - Hedge Fund Strategies
 
Intro to Quant Trading Strategies (Lecture 1 of 10)
Intro to Quant Trading Strategies (Lecture 1 of 10)Intro to Quant Trading Strategies (Lecture 1 of 10)
Intro to Quant Trading Strategies (Lecture 1 of 10)
 
The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...
The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...
The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...
 
"Maximize Alpha with Systematic Factor Testing" by Cheng Peng, Software Engin...
"Maximize Alpha with Systematic Factor Testing" by Cheng Peng, Software Engin..."Maximize Alpha with Systematic Factor Testing" by Cheng Peng, Software Engin...
"Maximize Alpha with Systematic Factor Testing" by Cheng Peng, Software Engin...
 
What we learned from running a quant crypto hedge fund
What we learned from running a quant crypto hedge fundWhat we learned from running a quant crypto hedge fund
What we learned from running a quant crypto hedge fund
 
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...
 
"Don't Lose Your Shirt Trading Mean-Reversion" by Edith Mandel, Principal at ...
"Don't Lose Your Shirt Trading Mean-Reversion" by Edith Mandel, Principal at ..."Don't Lose Your Shirt Trading Mean-Reversion" by Edith Mandel, Principal at ...
"Don't Lose Your Shirt Trading Mean-Reversion" by Edith Mandel, Principal at ...
 
Backtesting And Live Trading With Interactive Brokers Using Python With Dr. H...
Backtesting And Live Trading With Interactive Brokers Using Python With Dr. H...Backtesting And Live Trading With Interactive Brokers Using Python With Dr. H...
Backtesting And Live Trading With Interactive Brokers Using Python With Dr. H...
 
Classification of quantitative trading strategies webinar ppt
Classification of quantitative trading strategies webinar pptClassification of quantitative trading strategies webinar ppt
Classification of quantitative trading strategies webinar ppt
 
"The 6 Stages of a Quant Equity Workflow" by Dr. Jessica Stauth, Vice Preside...
"The 6 Stages of a Quant Equity Workflow" by Dr. Jessica Stauth, Vice Preside..."The 6 Stages of a Quant Equity Workflow" by Dr. Jessica Stauth, Vice Preside...
"The 6 Stages of a Quant Equity Workflow" by Dr. Jessica Stauth, Vice Preside...
 
Combining the Best Stock Selection Factors by Patrick O'Shaughnessy at QuantC...
Combining the Best Stock Selection Factors by Patrick O'Shaughnessy at QuantC...Combining the Best Stock Selection Factors by Patrick O'Shaughnessy at QuantC...
Combining the Best Stock Selection Factors by Patrick O'Shaughnessy at QuantC...
 
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...
 
Order book dynamics in high frequency trading
Order book dynamics in high frequency tradingOrder book dynamics in high frequency trading
Order book dynamics in high frequency trading
 
Peculiarities of Volatilities by Ernest Chan at QuantCon 2016
Peculiarities of Volatilities by Ernest Chan at QuantCon 2016Peculiarities of Volatilities by Ernest Chan at QuantCon 2016
Peculiarities of Volatilities by Ernest Chan at QuantCon 2016
 

Similar to DIY Quant Strategies on Quantopian

Top Down Investing
Top Down InvestingTop Down Investing
Top Down Investing
Ken Long
 
Advance IQ Capital Quantitative Models
Advance IQ Capital Quantitative ModelsAdvance IQ Capital Quantitative Models
Advance IQ Capital Quantitative Models
Andrew Leon Palashewsky, CMT
 
Advance iq capital quantitative models
Advance iq capital quantitative modelsAdvance iq capital quantitative models
Advance iq capital quantitative models
Andrew214
 
How AI learnt large-scale Pair-Trading on S&P 500? (Updated)
How AI learnt large-scale Pair-Trading on S&P 500? (Updated)How AI learnt large-scale Pair-Trading on S&P 500? (Updated)
How AI learnt large-scale Pair-Trading on S&P 500? (Updated)
Kamer Ali Yuksel
 
Financial Markets & Trading - Introduction
Financial Markets & Trading - IntroductionFinancial Markets & Trading - Introduction
Financial Markets & Trading - Introduction
Aditya Dasgupta
 
Fin 3750 Portfolio Case Study
Fin 3750 Portfolio Case StudyFin 3750 Portfolio Case Study
Fin 3750 Portfolio Case Study
Jacob Roese
 
Does trend following work on stocks?
Does trend following work on stocks?Does trend following work on stocks?
Does trend following work on stocks?
LongboardAM
 
2017 09 17 Meetup Slides
2017 09 17 Meetup Slides2017 09 17 Meetup Slides
Technical analysis, market efficiency, and behavioral finance
Technical analysis, market efficiency, and behavioral financeTechnical analysis, market efficiency, and behavioral finance
Technical analysis, market efficiency, and behavioral finance
Babasab Patil
 
Secrets Of Successful Traders
Secrets Of  Successful  TradersSecrets Of  Successful  Traders
Secrets Of Successful Traders
Robert R
 
Inefficient Innovation: A Trading Strategy
Inefficient Innovation: A Trading StrategyInefficient Innovation: A Trading Strategy
Inefficient Innovation: A Trading Strategy
Marco Bennett
 
JMS Partners Equity Strategy
JMS Partners Equity StrategyJMS Partners Equity Strategy
JMS Partners Equity Strategy
Matthew Stephenson, CFA
 
Chapter 11_The Stock Market
Chapter 11_The Stock MarketChapter 11_The Stock Market
Chapter 11_The Stock MarketRusman Mukhlis
 
Hedge Fund Strategy Due Diligence
Hedge Fund Strategy Due DiligenceHedge Fund Strategy Due Diligence
Hedge Fund Strategy Due Diligence
GeorgeWang927586
 
A Look Back at 11 Stock Trading Setups
A Look Back at 11 Stock Trading SetupsA Look Back at 11 Stock Trading Setups
A Look Back at 11 Stock Trading Setups
InvestingWithOptions
 
Managed Futures
Managed FuturesManaged Futures
Managed Futuresbzinchenko
 
Book 10 top_chart_patterns
Book 10 top_chart_patternsBook 10 top_chart_patterns
Book 10 top_chart_patterns
MJK INC
 
I111680 - Leandro Primo Dagostini - Final Dissertation
I111680 - Leandro Primo Dagostini - Final DissertationI111680 - Leandro Primo Dagostini - Final Dissertation
I111680 - Leandro Primo Dagostini - Final DissertationLeandro Primo D'Agostini
 

Similar to DIY Quant Strategies on Quantopian (20)

Top Down Investing
Top Down InvestingTop Down Investing
Top Down Investing
 
JSE My Share Day
JSE My Share DayJSE My Share Day
JSE My Share Day
 
Advance IQ Capital Quantitative Models
Advance IQ Capital Quantitative ModelsAdvance IQ Capital Quantitative Models
Advance IQ Capital Quantitative Models
 
Advance iq capital quantitative models
Advance iq capital quantitative modelsAdvance iq capital quantitative models
Advance iq capital quantitative models
 
How AI learnt large-scale Pair-Trading on S&P 500? (Updated)
How AI learnt large-scale Pair-Trading on S&P 500? (Updated)How AI learnt large-scale Pair-Trading on S&P 500? (Updated)
How AI learnt large-scale Pair-Trading on S&P 500? (Updated)
 
Financial Markets & Trading - Introduction
Financial Markets & Trading - IntroductionFinancial Markets & Trading - Introduction
Financial Markets & Trading - Introduction
 
Fin 3750 Portfolio Case Study
Fin 3750 Portfolio Case StudyFin 3750 Portfolio Case Study
Fin 3750 Portfolio Case Study
 
Does trend following work on stocks?
Does trend following work on stocks?Does trend following work on stocks?
Does trend following work on stocks?
 
2017 09 17 Meetup Slides
2017 09 17 Meetup Slides2017 09 17 Meetup Slides
2017 09 17 Meetup Slides
 
Technical analysis, market efficiency, and behavioral finance
Technical analysis, market efficiency, and behavioral financeTechnical analysis, market efficiency, and behavioral finance
Technical analysis, market efficiency, and behavioral finance
 
Secrets Of Successful Traders
Secrets Of  Successful  TradersSecrets Of  Successful  Traders
Secrets Of Successful Traders
 
Inefficient Innovation: A Trading Strategy
Inefficient Innovation: A Trading StrategyInefficient Innovation: A Trading Strategy
Inefficient Innovation: A Trading Strategy
 
JMS Partners Equity Strategy
JMS Partners Equity StrategyJMS Partners Equity Strategy
JMS Partners Equity Strategy
 
Chapter 11_The Stock Market
Chapter 11_The Stock MarketChapter 11_The Stock Market
Chapter 11_The Stock Market
 
project mass
project massproject mass
project mass
 
Hedge Fund Strategy Due Diligence
Hedge Fund Strategy Due DiligenceHedge Fund Strategy Due Diligence
Hedge Fund Strategy Due Diligence
 
A Look Back at 11 Stock Trading Setups
A Look Back at 11 Stock Trading SetupsA Look Back at 11 Stock Trading Setups
A Look Back at 11 Stock Trading Setups
 
Managed Futures
Managed FuturesManaged Futures
Managed Futures
 
Book 10 top_chart_patterns
Book 10 top_chart_patternsBook 10 top_chart_patterns
Book 10 top_chart_patterns
 
I111680 - Leandro Primo Dagostini - Final Dissertation
I111680 - Leandro Primo Dagostini - Final DissertationI111680 - Leandro Primo Dagostini - Final Dissertation
I111680 - Leandro Primo Dagostini - Final Dissertation
 

Recently uploaded

managementaccountingunitiv-230422140105-dd17d80b.ppt
managementaccountingunitiv-230422140105-dd17d80b.pptmanagementaccountingunitiv-230422140105-dd17d80b.ppt
managementaccountingunitiv-230422140105-dd17d80b.ppt
SuseelaPalanimuthu
 
Introduction to Indian Financial System ()
Introduction to Indian Financial System ()Introduction to Indian Financial System ()
Introduction to Indian Financial System ()
Avanish Goel
 
how can I sell/buy bulk pi coins securely
how can I sell/buy bulk pi coins securelyhow can I sell/buy bulk pi coins securely
how can I sell/buy bulk pi coins securely
DOT TECH
 
how can i use my minded pi coins I need some funds.
how can i use my minded pi coins I need some funds.how can i use my minded pi coins I need some funds.
how can i use my minded pi coins I need some funds.
DOT TECH
 
Chương 6. Ancol - phenol - ether (1).pdf
Chương 6. Ancol - phenol - ether (1).pdfChương 6. Ancol - phenol - ether (1).pdf
Chương 6. Ancol - phenol - ether (1).pdf
va2132004
 
Empowering the Unbanked: The Vital Role of NBFCs in Promoting Financial Inclu...
Empowering the Unbanked: The Vital Role of NBFCs in Promoting Financial Inclu...Empowering the Unbanked: The Vital Role of NBFCs in Promoting Financial Inclu...
Empowering the Unbanked: The Vital Role of NBFCs in Promoting Financial Inclu...
Vighnesh Shashtri
 
GeM ppt in railway for presentation on gem
GeM ppt in railway  for presentation on gemGeM ppt in railway  for presentation on gem
GeM ppt in railway for presentation on gem
CwierAsn
 
Summary of financial results for 1Q2024
Summary of financial  results for 1Q2024Summary of financial  results for 1Q2024
Summary of financial results for 1Q2024
InterCars
 
PF-Wagner's Theory of Public Expenditure.pptx
PF-Wagner's Theory of Public Expenditure.pptxPF-Wagner's Theory of Public Expenditure.pptx
PF-Wagner's Theory of Public Expenditure.pptx
GunjanSharma28848
 
what is a pi whale and how to access one.
what is a pi whale and how to access one.what is a pi whale and how to access one.
what is a pi whale and how to access one.
DOT TECH
 
一比一原版BCU毕业证伯明翰城市大学毕业证成绩单如何办理
一比一原版BCU毕业证伯明翰城市大学毕业证成绩单如何办理一比一原版BCU毕业证伯明翰城市大学毕业证成绩单如何办理
一比一原版BCU毕业证伯明翰城市大学毕业证成绩单如何办理
ydubwyt
 
USDA Loans in California: A Comprehensive Overview.pptx
USDA Loans in California: A Comprehensive Overview.pptxUSDA Loans in California: A Comprehensive Overview.pptx
USDA Loans in California: A Comprehensive Overview.pptx
marketing367770
 
how to sell pi coins on Binance exchange
how to sell pi coins on Binance exchangehow to sell pi coins on Binance exchange
how to sell pi coins on Binance exchange
DOT TECH
 
234Presentation on Indian Debt Market.ppt
234Presentation on Indian Debt Market.ppt234Presentation on Indian Debt Market.ppt
234Presentation on Indian Debt Market.ppt
PravinPatil144525
 
Financial Assets: Debit vs Equity Securities.pptx
Financial Assets: Debit vs Equity Securities.pptxFinancial Assets: Debit vs Equity Securities.pptx
Financial Assets: Debit vs Equity Securities.pptx
Writo-Finance
 
BYD SWOT Analysis and In-Depth Insights 2024.pptx
BYD SWOT Analysis and In-Depth Insights 2024.pptxBYD SWOT Analysis and In-Depth Insights 2024.pptx
BYD SWOT Analysis and In-Depth Insights 2024.pptx
mikemetalprod
 
655264371-checkpoint-science-past-papers-april-2023.pdf
655264371-checkpoint-science-past-papers-april-2023.pdf655264371-checkpoint-science-past-papers-april-2023.pdf
655264371-checkpoint-science-past-papers-april-2023.pdf
morearsh02
 
how can I sell pi coins after successfully completing KYC
how can I sell pi coins after successfully completing KYChow can I sell pi coins after successfully completing KYC
how can I sell pi coins after successfully completing KYC
DOT TECH
 
What price will pi network be listed on exchanges
What price will pi network be listed on exchangesWhat price will pi network be listed on exchanges
What price will pi network be listed on exchanges
DOT TECH
 
Isios-2024-Professional-Independent-Trustee-Survey.pdf
Isios-2024-Professional-Independent-Trustee-Survey.pdfIsios-2024-Professional-Independent-Trustee-Survey.pdf
Isios-2024-Professional-Independent-Trustee-Survey.pdf
Henry Tapper
 

Recently uploaded (20)

managementaccountingunitiv-230422140105-dd17d80b.ppt
managementaccountingunitiv-230422140105-dd17d80b.pptmanagementaccountingunitiv-230422140105-dd17d80b.ppt
managementaccountingunitiv-230422140105-dd17d80b.ppt
 
Introduction to Indian Financial System ()
Introduction to Indian Financial System ()Introduction to Indian Financial System ()
Introduction to Indian Financial System ()
 
how can I sell/buy bulk pi coins securely
how can I sell/buy bulk pi coins securelyhow can I sell/buy bulk pi coins securely
how can I sell/buy bulk pi coins securely
 
how can i use my minded pi coins I need some funds.
how can i use my minded pi coins I need some funds.how can i use my minded pi coins I need some funds.
how can i use my minded pi coins I need some funds.
 
Chương 6. Ancol - phenol - ether (1).pdf
Chương 6. Ancol - phenol - ether (1).pdfChương 6. Ancol - phenol - ether (1).pdf
Chương 6. Ancol - phenol - ether (1).pdf
 
Empowering the Unbanked: The Vital Role of NBFCs in Promoting Financial Inclu...
Empowering the Unbanked: The Vital Role of NBFCs in Promoting Financial Inclu...Empowering the Unbanked: The Vital Role of NBFCs in Promoting Financial Inclu...
Empowering the Unbanked: The Vital Role of NBFCs in Promoting Financial Inclu...
 
GeM ppt in railway for presentation on gem
GeM ppt in railway  for presentation on gemGeM ppt in railway  for presentation on gem
GeM ppt in railway for presentation on gem
 
Summary of financial results for 1Q2024
Summary of financial  results for 1Q2024Summary of financial  results for 1Q2024
Summary of financial results for 1Q2024
 
PF-Wagner's Theory of Public Expenditure.pptx
PF-Wagner's Theory of Public Expenditure.pptxPF-Wagner's Theory of Public Expenditure.pptx
PF-Wagner's Theory of Public Expenditure.pptx
 
what is a pi whale and how to access one.
what is a pi whale and how to access one.what is a pi whale and how to access one.
what is a pi whale and how to access one.
 
一比一原版BCU毕业证伯明翰城市大学毕业证成绩单如何办理
一比一原版BCU毕业证伯明翰城市大学毕业证成绩单如何办理一比一原版BCU毕业证伯明翰城市大学毕业证成绩单如何办理
一比一原版BCU毕业证伯明翰城市大学毕业证成绩单如何办理
 
USDA Loans in California: A Comprehensive Overview.pptx
USDA Loans in California: A Comprehensive Overview.pptxUSDA Loans in California: A Comprehensive Overview.pptx
USDA Loans in California: A Comprehensive Overview.pptx
 
how to sell pi coins on Binance exchange
how to sell pi coins on Binance exchangehow to sell pi coins on Binance exchange
how to sell pi coins on Binance exchange
 
234Presentation on Indian Debt Market.ppt
234Presentation on Indian Debt Market.ppt234Presentation on Indian Debt Market.ppt
234Presentation on Indian Debt Market.ppt
 
Financial Assets: Debit vs Equity Securities.pptx
Financial Assets: Debit vs Equity Securities.pptxFinancial Assets: Debit vs Equity Securities.pptx
Financial Assets: Debit vs Equity Securities.pptx
 
BYD SWOT Analysis and In-Depth Insights 2024.pptx
BYD SWOT Analysis and In-Depth Insights 2024.pptxBYD SWOT Analysis and In-Depth Insights 2024.pptx
BYD SWOT Analysis and In-Depth Insights 2024.pptx
 
655264371-checkpoint-science-past-papers-april-2023.pdf
655264371-checkpoint-science-past-papers-april-2023.pdf655264371-checkpoint-science-past-papers-april-2023.pdf
655264371-checkpoint-science-past-papers-april-2023.pdf
 
how can I sell pi coins after successfully completing KYC
how can I sell pi coins after successfully completing KYChow can I sell pi coins after successfully completing KYC
how can I sell pi coins after successfully completing KYC
 
What price will pi network be listed on exchanges
What price will pi network be listed on exchangesWhat price will pi network be listed on exchanges
What price will pi network be listed on exchanges
 
Isios-2024-Professional-Independent-Trustee-Survey.pdf
Isios-2024-Professional-Independent-Trustee-Survey.pdfIsios-2024-Professional-Independent-Trustee-Survey.pdf
Isios-2024-Professional-Independent-Trustee-Survey.pdf
 

DIY Quant Strategies on Quantopian

  • 1.
  • 2. DIY Quant strategies: Is it possible to roll your own? Jess Stauth, PhD VP Quant Strategy Bay Area Algorithmic Trading Meetup Hacker Dojo * February 6, 2014
  • 3. What makes a good equity quant strategy?  Intuition. If you can‟t explain why it works, it doesn‟t work.  Reproducibility. If you can‟t backtest it, it doesn‟t work (note the inverse does not necessarily hold).  Access to data. If you can‟t get the signal (or get it in time) you can‟t trade it. ($$$)  Capacity/Execution You can‟t push a camel through the eye of a needle. (1/$$$)
  • 4. 5 Basic Quant Strategies 1. Mean Reversion – What goes up… (special case: Pairs Trade) 2. Momentum – The trend is your friend. 3. Valuation – Buy low, sell high. 4. Sentiment – Buy the rumor, sell the news. 5. Seasonality – Sell in May and go away. Out of scope for today‟s talk:  Acronym soup (e.g. ML, OLMAR, PCA, ICA, OLS, etc.)  Portfolio construction, risk optimization, etc.  Asset clases
  • 5. Pairs Trading  Intuition: Find two assets linked to a single underlying „value‟ and exploit transient mispricing between them.  Reproducibility: The phenomenon is well documented1,2.  Data: For basic strategies all you need is pricing.  Capacity: Can be quite small depending on the instruments. Common pitfalls:  Ignore the intuition requirement at your own peril! Cointegration works great, until it doesn‟t.  Market neutral or „hedged‟ strategy, so you are forgoing any upward drift in the longer term. 1. Pairs Trading, Vidyamurthy 2004 2. Quantitative Trading, Chan 2009
  • 6. Pairs Trading Simplistic Intuition (cont‟d): If you assume the spread between stock 1 and stock 2 is „stationary‟ and „normally distributed‟, then statistically you should be able to make money by „buying‟ or „selling‟ the spread when it takes on extreme tail values. Zx = (Price Stock1 – Price Stock2)/ Price Stock1
  • 7. Pairs Trading: EWA/EWC Pair 6/06 – 6/12 Huapu Pan (NYC Algo Trading meetup member) Posted 12/19/13 “Ernie Chan‟s EWA/EWC Pair Trading” https://www.quantopian.com/posts/ernie-chans-ewa-slash-ewc-pair-trading
  • 8. Momentum Trading  Intuition: Comes in many flavors (stock level, sector level, asset class level) but comes back to the behavioral bias of „herding‟.  Reproducibility: The phenomenon is well documented1.  Data: For basic strategies all you need is pricing.  Capacity: Can be quite small depending on the instruments. Common pitfalls:  The trend is your friend, until it isn‟t. Reversals can be devastating, especially when using leverage. 1. Jegadeesh and Titman, Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. Journal of Finance March 1993 2. Faber, A Quantitative Approach to Tactical Asset Allocation. Journal of Wealth Management 2013
  • 9. Momentum Trading Simple rules based approach  Rank 1 > N stocks (sectors) by : [r20 – r200]  Buy top K stocks (sectors) where absolute momentum (20 vs. 200 day MA) > some threshold.  Else, hold cash.
  • 10. Momentum Trading – Meb Faber RS Strategy Backtest range: 11/04 – 2/13 John Chia Posted Feb 2013 “Mebane Faber Relative Strength Strategy with MA Rule” https://www.quantopian.com/posts/mebane-faber-relative-strength-strategy-with-ma-rule
  • 11. Valuation  Intuition: In a nutshell, bargain shopping. Use fundamental ratio analysis to identify stocks trading at a discount (or premium) and buy (or sell) them accordingly.  Reproducibility: The phenomenon is well documented.  Data: Requires good coverage (breadth and depth) of normalized corporate fundamental data.  Capacity: Small cap stocks can be riskier, and higher friction to trade. Common pitfalls:  Some cheap stocks are cheap for a reason. “Catch a falling knife” adage.
  • 12. Valuation Simple example: use price to earnings ratio as a proxy for „value‟ where low P/E looks „cheap‟ and high P/E looks „expensive‟.  Rank universe 1-100 (or sector universe) on P/E  Long only: buy the bottom (lowest P/E) decile  Market neutral: buy the bottom decile, sell the top decile In practice, a quant model would typically blend a number of backward looking ratios an forward looking estimates along with making sector specific adjustments and other bells, whistles.
  • 13. Valuation: Screen on corporate fundamentals Backtest range 11/25/2009 – 10/10/2013 Sam Lunt (11/4/2013) “Using Fetcher with Quandl” https://www.quantopian.com/posts/using-the-fetcher-with-quandl
  • 14. Sentiment: Short sellers  Intuition: Follow the (short) money. Short sellers are the „smart money‟, their trades are $ for $ higher conviction (to balance risk).  Reproducibility: The phenomenon is well documented.  Data: Bi-monthly (delayed) short interest can be scraped from NASDAQ. Borrow rates, real-time daily short interest data aggregated from brokers is available for $$$.  Capacity: Can be quite small depending on the instruments. Common pitfalls:  Beware the Short Squeeze! Crowded short trades can lead to a squeeze as short sellers rush to close positions.
  • 15. Sentiment: Short sellers  Rank stocks 1 > N on Days To Cover ratio*  Buy top 10%, short bottom 10%  Rebalance periodically *Days to cover = Shares Held Short Avg Daily Trade Share volume The number of days of „average‟ trading it would take to unwind the existing short positions.
  • 16. Sentiment: Short sellers – Rank on Days to Cover Backtest range: 3/15/12 – 3/15/13 Fawce (April 2013) “Ranking and Trading on Days to Cover” https://www.quantopian.com/posts/ranking-and-trading-on-days-to-cover
  • 17. Seasonality  Intuition: Sometimes (calendar driven fund flows e.g. month end).  Reproducibility: There‟s healthy debate on this one.  Data: end of day pricing and a calendar.  Capacity: Depends on the instruments. Common pitfalls:  Overfitting / data mining is rampant in this type of analysis.
  • 18. Seasonality Simplest example is a simple 100% stock/bond annual rotation model.  Buy and hold equities (SPY) October thru April  Buy and hold bonds (BSV) May thru Sept.
  • 19. Seasonality: Sell in May Backtest range: 10/1/09 – 12/31/12 Jess(May 2013) “Sell in May and go away” https://www.quantopian.com/posts/time-to-sell-in-may-and-go-away
  • 20. Which of these strategies are most popular among the „retail‟ or individual quants using Quantopian?  Mean Reversion  Momentum  Valuation  Sentiment  Seasonality  Other
  • 21. 25 Top Shared Algorithms of All Time Combo Rank 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Post Title Replies Google Search Terms predict market movements OLMAR implementation Easy Volatility Investing by Tony Cooper @ Double-Digit Numerics Global Minimum Variance Portfolio discuss the sample algorithm ML - Stochastic Gradient Descent Using Hinge Loss Function Mebane Faber Relative Strength Strategy with MA Rule OLMAR w/ NASDAQ 100 & dollar-volume Bollinger Bands With Trading Brent/WTI Spread Fetcher Example Ernie Chan's Pairs Trade Ranking and Trading on Days to Cover Using the CNN Fear & Greed Index as a trading signal Determining price direction using exponential and log-normal distributions Time to sell in may and go away? Simple Mean Reversion Strategy Neural Network that tests for mean-reversion or momentum trending Using weather as a trading signal Momentum Trade Trading Strategy: Mean-reversion Global market rotation strategy trading earnings surprises with Estimize data Turtle Trading Strategy SPY & SH algorithm - please review New Feature: Fetcher! TOTALS: Views Clones 64 64 57 28 12 10 22 31 18 17 15 4 18 9 27 6 4 6 5 13 53 34 11 21 27 31913 26039 15117 10222 18348 20400 11104 7760 8363 10821 10387 24906 9212 9539 8192 11794 10062 11940 8800 8228 7621 7496 7815 7443 7507 809 697 839 700 2882 972 617 697 560 327 328 379 318 606 261 270 402 199 455 213 94 129 299 194 108 576 311,029 13,355
  • 22. 25 Top Shared Algorithms of All Time Combo Rank 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Post Title Google Search Terms predict market movements OLMAR implementation Easy Volatility Investing by Tony Cooper @ Double-Digit Numerics Global Minimum Variance Portfolio discuss the sample algorithm ML - Stochastic Gradient Descent Using Hinge Loss Function Mebane Faber Relative Strength Strategy with MA Rule OLMAR w/ NASDAQ 100 & dollar-volume Bollinger Bands With Trading Brent/WTI Spread Fetcher Example Ernie Chan's Pairs Trade Ranking and Trading on Days to Cover Using the CNN Fear & Greed Index as a trading signal Determining price direction using exponential and log-normal distributions Time to sell in may and go away? Simple Mean Reversion Strategy Neural Network that tests for mean-reversion or momentum trending Using weather as a trading signal Momentum Trade Trading Strategy: Mean-reversion Global market rotation strategy trading earnings surprises with Estimize data Turtle Trading Strategy SPY & SH algorithm - please review New Feature: Fetcher! Replies Views Clones 64 64 57 28 12 10 22 31 18 17 15 4 18 9 27 6 4 6 5 13 53 34 11 21 27 31913 26039 15117 10222 18348 20400 11104 7760 8363 10821 10387 24906 9212 9539 8192 11794 10062 11940 8800 8228 7621 7496 7815 7443 7507 809 697 839 700 2882 972 617 697 560 327 328 379 318 606 261 270 402 199 455 213 94 129 299 194 108
  • 23. 25 Top Shared Algorithms of All Time Categorized Volatility 5% Technical 3% Seasonality 3% Portfolio Risk 6% Momentum 18% Mean Reversion 37% Area ~ page views Sentiment 28% What‟s missing from this picture??

Editor's Notes

  1. *Not a Mutually Exclusive CollectivelyExhaustive list.
  2. avg 30 day return = 0.93%
  3. select po.title, po.replies_count, po.views_count, al.clone_countfrom posts as po left join backtests as ba on ba.id=po.backtest_idjoin algorithms as al on ba.algorithm_id=al.idorder by views_countdesclimit 31