Contrary to popular wisdom the difference between a retail quant trader and a professional portfolio manager is not in "having better trade entry and exit rules". Rather it is the difference in how each approaches the concepts of portfolio optimisation and risk management.
Both of these topics are synonymous with heavy math, which can be off-putting for beginner retail systematic traders. Hence, it can be extremely daunting for those without institutional experience to know how to turn a set of trading rules into a robust portfolio and risk management system.
In this talk, Mike will discuss how to take a typical retail quant strategy and place it in a professional quantitative trading framework, with proper position sizing and risk assessment, without resorting to pages of formulas or the need to have a PhD in statistics!
Booking open Available Pune Call Girls Wadgaon Sheri 6297143586 Call Hot Ind...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. Michael Halls-Moore, Founder of QuantStart.com
1. A Framework-Based Approach toA Framework-Based Approach to
Building Quantitative Trading SystemsBuilding Quantitative Trading Systems
QuantCon NYC – 29QuantCon NYC – 29thth
April 2017April 2017
Michael Halls-MooreMichael Halls-Moore
QuantStart.comQuantStart.com
2. Talk OutlineTalk Outline
● About QuantStart
● The US equities market
● Typical retail trader approach
● The need for a quantitative framework
● Portfolio management
● Risk management
● Forecasting
● Good tools
● Who to read
4. About QuantStart.comAbout QuantStart.com
● My Background:
– Computational fluid dynamics (CFD) research in aerospace
– Quant trading infrastructure development at London-based US equities fund
● QuantStart.com:
– Founded in 2012
– Talks about systematic trading, quant development, careers and machine learning
– Mainly Python, R, C++ and open-source backtesting
– Bringing institutional methods to retail traders
6. The US Equities Market #1The US Equities Market #1
● Liquid Low spreads, easy to execute quickly at desired price→
● Exchange-traded Not trading obscure OTC instruments→
● Easy retail access Many retail equities brokerages→
● Can access with smaller account sizes
– Cash purchases
– Individual stocks far cheaper than futures
● Various benchmark indexes – S&P, Dow, Russell
– Mostly interested in S&P500 universe at retail level
7. The US Equities Market #2The US Equities Market #2
● Indexes discussed in the media are misleading
● DJIA has price-weighted methodology
● S&P500 has market-capitalisation weighted methodology
● But...S&P500 is not 'the market':
– By definition it disproportionately favours big firms, i.e. AAPL
● Does not include dividend reinvestment Total return→
● A good benchmark instead would be S&P500 Total Return index
9. Typical Retail Trader ApproachTypical Retail Trader Approach
● Emphasis on “the best indicator”
● Charts, discretionary forecasts, pattern-matching
● Few instruments traded (“stocks that I know well”)
● Excess cash kept in brokerage account, not cash-like instruments
● No risk management: What is vol, skew, kurtosis of returns?
● Survivorship Bias: Trade stocks that have done well (e.g. AAPL)
● Too much trading: Forecast overconfidence, high costs
● No concept of Portfolio Management
10. Why Is This Bad? #1Why Is This Bad? #1
● Discretionary forecasts are too inconsistent
– Tied to emotional state and cognitive biases (see Kahneman et al)
● “Lines on charts” are too ambiguous
– No repeatable methodology
– Far better quantitative methods available
● No risk parity
– Assets with higher vol dominate portfolio returns behaviour
● No rebalancing
– Risk is dynamic, so allocations need adjustment over time
11. Why Is This Bad? #2Why Is This Bad? #2
● Few instruments → No diversification
● Survivorship Bias Backtest→ optimism inflated
● Cash Positions Brokerages→ collapse taking cash with them
● No tail-risk planning
– What rules are followed in 1987, 2001, 2008?
– Often the worst time to tinker with a “system”
● In summary
– No portfolio management, no risk management, no consistency
12. The Need for a Quantitative FrameworkThe Need for a Quantitative Framework
13. The Need for a Quantitative FrameworkThe Need for a Quantitative Framework
● Systematic Framework
– Eliminates discretionary decision making
– But requires substantial confidence and discipline!
● Risk Parity
– Each asset is volatility standardised Equal “risk” in every asset→
● Rebalancing
– Risk is dynamic Periodically rebalance to reflect changing allocation of risk→
● Position Sizing
– Quantitative approach for how much to “bet” per asset
● Diversification
– Enough stocks to ensure luck is less important in portfolio performance
14. Performance MeasurementPerformance Measurement
● Must decompose where our performance and risk comes from
● Important for equities: Alpha, Beta and Sharpe
● Beta: Risk arising from exposure to benchmark (or market)
● Alpha: Measures the excess return on a portfolio
● Sharpe: Mean excess return divided by std of returns
– But...it is a very misleading metric for a number of reasons!
● “Vol is the currency we pay for performance” - Andreas Clenow
● All measures are backward-looking
16. Portfolio Management #1Portfolio Management #1
● Requires a significant shift in thinking!
● Biggest difference between retail and institutional behaviour
● Portfolio management is not about allocation of cash but
about allocation of risk
– What risks am I taking in order to achieve my returns?
● The goal:
– Obtain high risk-adjusted returns
– Achieve good diversification
– Minimise the costs of trading/rebalancing while doing so
17. Portfolio Management #2Portfolio Management #2
● Began formally with Harry Markowitz in 1950s
– His essay and PhD thesis became Modern Portfolio Theory (MPT)
– He, along with Sharpe and Miller, received Nobel Prize in 1990 for this
● Extended into Capital Asset Pricing Model (CAPM)
– Origins of “Alpha” and “Beta” as linear regression coefficients
● Efficient Market Hypothesis (EMH) dominated in 70s/80s
● Factor Analysis Fama & French three-factor model→
● Behavioural Economics Cognitive biases and investor→
psychology grew in importance
18. Portfolio Management #3Portfolio Management #3
● Today there is strong academic evidence for persistent
equity market “anomalies”:
– Value premium Graham & Dodd, Buffett→
– Size premium Small-cap stocks outperforming large-cap stocks→
– Momentum Positive serial correlation of returns→
– And others...
● Our portfolios can take advantage of these
– Generate forecasts based on these anomalies
– Systematically exploit them across a diversified set of stocks
20. Risk Parity #1Risk Parity #1
● Allocation based on trailing std of returns of assets
– Bonds get larger allocation than equities due to lower std
– Increase leverage to get similar returns to equities with lower vol
● First used by Bridgewater Associates in their “All Weather” fund (1996)
– Now all major asset allocators have a risk parity fund
– Each of them have a proprietary methodology
● Is sometimes called “Volatility Standardisation”
● Can have a big impact on risk-adjusted returns over long-term
21. Risk Parity #2Risk Parity #2
● We will define “risk parity” here as:
– Volatility-adjusted allocations of stocks only
– Higher std returns implies lower allocation
– No other asset classes (don't need to worry about bonds!)
● Many ways to calculate it
– Average True Range (ATR)
– Trailing std of returns (250 trading days)
– More technical estimates of volatility (large literature on this)
22. Risk Parity #3Risk Parity #3
● Must also take correlation into account:
– No value in having thirty highly correlated stocks, even if vol-adjusted
– You're taking ONE bet not THIRTY!
● Volatility Measures:
– Often backward-looking and non-stationary
– Says nothing about future volatility
– Must be periodically re-estimated
24. Portfolio Rebalancing #1Portfolio Rebalancing #1
● Dynamically adjust risk allocation based on new information
● Another big difference between retail and institutional quants
● Volatility is dynamic
– Modelled as conditional heteroskedastic (e.g. GARCH family of models)
– Vol often higher in times of distress (e.g. 2008)
● Correlations are dynamic
– Correlations can increase to unity in times of distress (again, 2008!)
25. Portfolio Rebalancing #2Portfolio Rebalancing #2
● To maintain risk parity positions are periodically resized
– Weekly or monthly
– Daily can be too “noisy” and expensive for some asset allocators
● Most trades now become rebalances
– Small adjustments are made to position sizes when it is not too
expensive to carry out
27. Risk ManagementRisk Management
● How much to bet per desired asset? Position sizing→
● Vol, skew and kurtosis:
– What is the historical distribution of portfolio returns?
● Non-stationarity of returns:
– Market regime filtering
– Future is different from the past
● Counterparty Risk
– Brokerage goes under (have seen this personally!)
● Trading infrastructure fails/has bugs
29. Position Sizing #1Position Sizing #1
● How much risk to take per “bet” or per stock?
● Depends upon:
– Desired level of diversification More stocks means less per stock→
– Total account size Small accounts reduce number of available bets→
– Your tolerance for risk What drawdowns can you stomach over a→
particular timeframe?
● For equities in particular:
– Too few stocks is just random luck Apple vs Lehman Brothers→
– Too many stocks will have high beta
30. Position Sizing #2Position Sizing #2
● Can use tools like Kelly criterion
– Optimal size of a series of bets f*→
– Institutional constraints can limit optimal growth rate
– “Fractional Kelly” or “Half Kelly” often used in practice
● Can target a level of desired volatility impact per stock
– E.g. with a portfolio of $250,000 and risk target of 10 basis points daily
vol per stock, we want each stock position to have $250 daily impact
– Dividing this number ($250) by the daily std of the stock (say, $4.67), gives
250/4.67 ~= 53 shares
– Increasing the risk target increases the shares purchased per asset
32. Market Regime FilteringMarket Regime Filtering
● Long-only stock strategies are often well-correlated to the market:
– Become even more so in times of distress
● Basic idea is not to have high stock exposure in bear markets
● Can detect regimes in many ways:
– Moving averages Index above or below its long-term moving average→
– State-space models Hidden Markov Models→
● Why not short stocks?
– Not symmetric due to availability of stock at broker and borrowing costs
● Regime filters can cause many “false positives”:
– Better than the alternative of giving back substantial performance in a prolonged
bear market!
34. Equities DataEquities Data
● Pay for good data
● Free data sources just don't cut it for the required accuracy
● Must be survivorship-bias free Include→ graveyard tickers
● Must have historical index constituents
● Must handle ticker mapping for mergers, spinoffs etc.
● Must have separate lists of dividends and splits
● All values of OHLCV should be split-adjusted, not just close
● Ideally use minutely OHLCV bars to better estimate fill price
35. BacktestingBacktesting
● Use robust backtesting software
● Most tools are “single instrument” Not good enough→
● Should have extensible portfolio/risk management modules
● Free: Quantopian, zipline, QSTrader, PySystemTrade, others...
● Desktop/Paid: RightEdge, Deltix
● Will need to know programming Can't get away from this!→
37. ForecastingForecasting
● I've left it to the end - it's discussed to death elsewhere!
● As important as the other aspects, but not more so
● Look for equity market anomalies:
– Value, size, momentum, PEAD, seasonal, etc.
● Can implement a lot of these with simpler “indicators”
● Or...more complex feature extraction (deep learning)
● Boils down to making a regressive forecast on an asset
– Direction, with associated strength of conviction
– E.g. momentum ranking, difference between two MA indicators
39. TakeawaysTakeaways
● Use a systematic portfolio management framework
● Benchmark against total return index of the stock universe
● Use risk parity for equal risk allocation
● Rebalance the portfolio to account for dynamic risk
● Choose own risk tolerance for position sizing, quantitatively
● Use a market regime filter to avoid prolonged bear markets
● Put cash in cash-like instruments
● Don't waste too much time on “the perfect indicator”
41. Who To Read #1 - BooksWho To Read #1 - Books
● W. Gray and J. Vogel: Quantitative Momentum
● A. Clenow: Stocks on the Move
● R. Carver: Systematic Trading
● G. Antonacci: Dual Momentum Investing
● L. Zacks: Equity Market Anomalies
● R. Grinold and R. Kahn: Active Portfolio Management
● D. Kahneman: Thinking Fast and Slow [for cognitive biases]
● ...some of the above are actually speaking here today!
42. Who To Read #2 - ResearchWho To Read #2 - Research
● AQR Research:
– https://www.aqr.com/library
● BlackRock Research:
– https://www.blackrock.com/corporate/en-br/insights/blackrock-investment-institute
● Bridgewater Associates Research:
– https://www.bridgewater.com/research-library/daily-observations/
● Cantab Capital:
– https://www.cantabcapital.com/we-think/
● Alpha Architect (Wes Gray et al):
– http://www.alphaarchitect.com