Quant Mashup The Correct Vectorized Backtest Methodology for Pairs Trading [Hudson and Thames]Whilst backtesting architectures is a topic on its own, this article dives into how to correctly backtest a pairs trading investment strategy using a vectorized (quick methodology) rather than the more robust event-driven architecture. This is a technique that is very common amongst analysts and is(...) A Review of Ben Graham’s Famous Value Investing Strategy: "Net-Nets" [Alpha Architect]Benjamin Graham, often considered a strong candidate for the “the father of quantitative value investing“, developed an investment strategy that involved purchasing securities for less than their “current-asset value”, “a rough index of the liquidating value”. We uncovered ten research(...) Fundamental and Sentiment analysis with different data sources [Quant Insti]Technical analysis of price and volume history won’t cut it alone nowadays. When we want to perform value investing and/or measure a security’s intrinsic value, we need to make a fundamental analysis of the security. To perform fundamental analysis we need data, lots of data. We want fundamental(...) Machine Learning for Trading Pairs Selection [Hudson and Thames]In this post, we will investigate and showcase a machine learning selection framework that will aid traders in finding mean-reverting opportunities. This framework is based on the book: “A Machine Learning based Pairs Trading Investment Strategy” by Sarmento and Horta. A time series is known to(...) Recent Weaknesses of Factor Investing [CXO Advisory]How have value, quality, low-volatility and momentum equity factors, and combinations of these factors, performed in recent years. In their October 2020 paper entitled “Equity Factor Investing: Historical Perspective of Recent Performance”, Benoit Bellone, Thomas Heckel, François Soupé and(...) Market Timing via the VRP? [Factor Research]Stock market returns were highly positive when the variance risk premium (VRP) was negative Returns were slightly negative across markets when the VRP was positive This relationship can not be exploited for market timing INTRODUCTION The US stock market in 1999 and 2020 had probably more(...) Macro uncertainty as predictor of market volatility [SR SV]Market volatility measures the size of variations of asset returns. Macroeconomic uncertainty measures the size of unpredictable disturbances in economic activity. Large moves in macroeconomic uncertainty are less frequent and more persistent than shifts in market volatility. However, macroeconomic(...) The Complete Guide to Portfolio Optimization in R Part 1 [Milton FMR]The purpose of portfolio optimization is to minimize risk while maximizing the returns of a portfolio of assets. Knowing how much capital needs to be allocated to a particular asset can make or break an investors portfolio. In this article we will use R and the rmetrics fPortfolio package which(...) The Amazing Efficacy of Cluster-based Feature Selection [EP Chan]One major impediment to widespread adoption of machine learning (ML) in investment management is their black-box nature: how would you explain to an investor why the machine makes a certain prediction? What's the intuition behind a certain ML trading strategy? How would you explain a major(...) Is the Market Getting more Efficient? [Alpha Architect]In 1998, Charles Ellis wrote “Winning the Loser’s Game,” in which he presented evidence that while it is possible to generate alpha and win the game of active management, the odds of doing so were so poor that it’s not prudent for investors to try. At the time, roughly 20 percent of actively(...) How to Analyze Volume Profiles With Python (h/t @PyQuantNews) [Minh Nguyen]When trading in markets such as equities or currencies it is important to identify value areas to inform our trading decisions. One way to do this is by looking at the volume profile. In this post, we explore quantitative methods for examining the distribution of volume over a period of time. More(...) Trend-Following Filters – Part 2/2 [Alpha Architect]Part 1 of this analysis, which is available here, examines filters modeled on second-order processes from a digital signal processing (DSP) perspective to illustrate their properties and limitations. To briefly recap, a time series based on a second-order process consists of a mean a and a linear(...) Copula for Pairs Trading: A Detailed, But Practical Introduction [Hudson and Thames]Suppose that you encountered a promising pair of stocks that move closely together, the spread zig-zagged around 0 like some fine needle stitching that sure looks like a nice candidate for mean-reversion bets. What’s more, you find out that the two stocks’ prices for the past 2 years are all(...) An Introduction to Cointegration for Pairs Trading [Hudson and Thames]Cointegration, a concept that helped Clive W.J. Granger win the Nobel Prize in Economics in 2003 (see Footnote 1), is a cornerstone of pairs and multi-asset trading strategies. Anecdotally, forty years have passed since Granger coined the term “cointegration” in his seminal paper “Some(...) Avoiding Gap Trades [Alvarez Quant Trading]Should you avoid trades that have recently gapped? What if you are trading a mean reversion strategy and a stock has recently had a large gap? Is that a good trade to take? Avoid? Does it depend on the direction of the gap? I did research on this about 15 years ago. Let’s see what the current(...) Keller's Resilient Asset Allocation [Allocate Smartly]This is a test of the latest tactical strategy from Dr. Wouter Keller: Resilient Asset Allocation (RAA). RAA is intended to be a low turnover strategy, only shifting from a balanced risk portfolio to a defensive portfolio during the most potentially bearish of times. Backtested results from 1970(...) Extracting Interest Rate Bounds from Option Prices [Sitmo]In this post we describe a nice algorithm for computing implied interest rates upper- and lower-bounds from European option quotes. These bounds tell you what the highest and lowest effective interest rates are that you can get by depositing or borrowing risk-free money through combinations of(...) Oh, Quality, Where Art Thou? [Factor Research]Quality and quality income ETFs have underperformed the S&P 500 since 2005 The most recent underperformance is explained by an underweight to technology stocks However, more importantly, quality ETFs have not reduced drawdowns during stock market crashes INTRODUCTION Investing is never easy, but(...) Statistics of Point&Figure Charts [Philipp Kahler]Point&Figure charts have been around for more than a 100 years and they are still quite popular, especially with commodities and forex traders. This article will do some statistical analysis of the most basic Point&Figure signal. Point&Figure Charts – price movements only Unless bar(...) Historical Returns for Newly Elected Presidents [Quantifiable Edges]Back in the 1/20/2009 blog I looked at inauguration day returns. I wondered at the time whether a new president brought about new hope and optimism for the market. I have decided to update that study today. I limited the instances to only those inaugurations where a new president was entering(...) More factors, more variance...explained [OSM]Risk factor models are at the core of quantitative investing. We’ve been exploring their application within our portfolio series to see if we could create such a model to quantify risk better than using a simplistic volatility measure. That is, given our four portfolios (Satisfactory, Naive, Max(...) How To Create A Fully Automated AI Based Trading System With Python (h/t @PyQuantNews)A couple of weeks ago I was casually chatting with a friend, masks on, social distance, the usual stuff. He was telling me how he was trying to, and I quote, detox from the broker app he was using. I asked him about the meaning of the word detox in this particular context, worrying that he might go(...) How to Get Historical Market Data Through Python Apis [Quant Insti]As a quant trader, you are always on the lookout to create and optimise your trading strategies. Backtesting forms a very important part of this process. And for backtesting, access to historical data is a necessity. But it’s a very daunting task to find decent historical price data for(...) Research Review | 15 January 2021| Forecasting [Capital Spectator]Long-Term Stock Forecasting Magnus Pedersen (Hvass Laboratories) December 17, 2020 When plotting the relation between valuation ratios and long-term returns on individual stocks or entire stock-indices, we often see a particular pattern in the plot, where higher valuation ratios are strongly(...) Bayesian Portfolio Optimisation: Introducing the Black-Litterman Model [Hudson and Thames]The Black-Litterman (BL) model is one of the many successfully used portfolio allocation models out there. Developed by Fischer Black and Robert Litterman at Goldman Sachs, it combines Capital Asset Pricing Theory (CAPM) with Bayesian statistics and Markowitz’s modern portfolio theory(...) The Definitive Study on Long-Term Factor Investing Returns [Alpha Architect]Interest in factor investing was hot several years back but seems to have died on the back of poor relative performance and a move to hotter products in thematics and ESG. But, for better or worse, we haven’t moved on. We are boring and we trust the process. We still believe that markets do a(...) How Does ETF Liquidity Affect ETF Returns, Volatility, and Tracking Error? [Alpha Architect]Although the ETF market has grown exponentially over the recent 20 years, ETFs that are less popular are not always liquid. A majority of the dollars flowing into ETFs are concentrated in 3 products, accounting for 46.7% of total ETF trading volume (see Figure 3 below). If the next 8 ETFs are(...) Musings about Factor Exposure Analysis [Factor Research]There are few alternatives to regression analysis when explaining investment performance Too few as well as too many independent variables can be problematic The results are often not intuitive, but also encourage asking further questions that may prove insightful INTRODUCTION The older I become,(...) Recovering Accurate Implied Dividend and Interest Rate Term-Structures from Option Prices [Sitmo]In this post we discuss the algorithms we use to accurately recover implied dividend and interest rates from option markets. Implied dividends and interest rates show up in a wide variety of applications: to link future-, call-, and put-prices together in a consistent market view de-noise market(...) Classifying market states [SR SV]Typically, we cannot predict a meaningful portion of daily or higher-frequency market returns. A more realistic approach is classifying the state of the market for a particular day or hour. A powerful tool for this purpose is artificial neural networks. This is a popular machine learning method that(...) Value and Momentum and Investment Anomalies [Alpha Architect]The predictive abilities of value and momentum strategies are among the strongest and most pervasive empirical findings in the asset pricing literature. (here is a deep dive) For example, the study “Value and Momentum Everywhere” by Clifford Asness, Tobias Moskowitz and Lasse Pedersen, published(...) Exporting Zorro Data to CSV [Robot Wealth]Earlier versions of Zorro used to ship with a script for converting market data in Zorro binary format to CSV. That script seems to have disappeared with the recent versions of Zorro, so I thought I’d post it here. When you run this script by selecting it and pressing [Test] on the Zorro(...) Using maximum drawdowns to set capital sizing - not as bad as I first thought [Investment Idiocy]Risk. Love it or hate it, well as a trader you have to deal with it even though none of us really like it. No, we'd all prefer to be one of those mythical traders you hear about on youtube or instagram who consistently make $1000 a day, and never lose any money. Sadly I am not in that unicorn(...) Simple versus Advanced Systematic Trading Strategies - Which is Better? [Quant Start]An age-old question in the quant community asks whether systematic traders should stick with simple quant strategies or expend the effort to implement more advanced approaches. It is often the perception that retail algo traders solely utilise simpler strategies while quantitative hedge funds carry(...) Hurst Exponent - finding the right market for your trading strategy [Philipp Kahler]The Hurst exponent is a measure for the behaviour of the market. It shows if the market behaves in a random, trending or mean-reversion manner. This can be used to select the right trading strategy for your market. Hurst Exponent hurst spx hurst exponent spx The hurst exponent describes the self(...) Factor Olympics 2020 [Factor Research]Momentum has been the clear winner across markets in 2020 Value has been the laggard like in recent years Low Volatility ended a 10-year fantastic run INTRODUCTION We present the performance of five well-known factors on an annual basis for the last 10 years. We only present factors where academic(...) Equity Fundamentals: Part 3 [Kyle Downey]I have been thinking a lot about different models for backtesting and strategy development. While I would like to think it's possible to develop one universal backtester, I believe that different time horizons require materially different programming interfaces. In particular, tick-by-tick(...) Stock Market Valuation and Volatility with R [Light Finance]Building on the work of Robert Shiller, in recent posts I investigated the use of the CAPE ratio to predict future stock market performance and examine for the structural change in market valuation over time. This work revealed that stock market returns depend significantly on valuation and are(...) Does It Make Sense to Use 1-Hour 1% VaR and ES for Bitcoin? [Quant at Risk]Another day, another record. Today, at 17:35 GST+1, Bitcoin crossed U$33,000 in trading at Coinbase Pro exchange and did not fall sharply down. It took about 4.5 hours to accelerate from a psychological level of U$30k with more greed among investors rather than fear of bursting Bitcoin (second)(...) Macro variance [OSM]In our last post, we looked at using a risk factor model to identify potential sources of variance for our 30,000 portfolio simulations. We introduced the process with a view ultimately to construct a model that could help to quantify, and thus mitigate, sources of risk beyond a simplistic(...) The 2021 Annual Finance Research Geek Fest: Top 5 Most Interesting Papers [Alpha Architect]The American Finance Association Annual Meetings are here. 1 The conference is virtual this year but that doesn’t mean the organization hasn’t done a good job collecting the brightest minds in academia to discuss hundreds of new finance research papers — a gold mine for new and exciting ideas!(...) Most popular posts - 2020 [Eran Raviv]Littered with Corona, this year was not easy. But looking around me, I feel grateful. The following quote by Socrates comes to mind: “If all our misfortunes were laid in one common heap whence everyone must take an equal portion, most people would be content to take their own and depart.” On(...) Trend-Following Filters: Part 1/2 [Alpha Architect]Many traders use strategies based on trends that occur in stock, bond, currency, commodity, and other financial asset price time series in order to “buy low” and “sell high”. A trend is considered to be the overall direction of prices over a period of time. If prices have generally increased(...) P-Hacking Via Academic Finance Research Conferences [Alpha Architect]This research is an update to “Documentation of the File Drawer Problem in Academic Finance Journals” published by the same authors in the Journal of Investment Management in 2018. A summary of that article can be found here. The “file drawer problem” refers to the idea that journal editors(...) Research Compendium 2020 [Factor Research]In 2020 we published more than 50 research notes on mostly factor investing and smart beta ETFs, but also on topics like ESG, tail risk hedge funds, long volatility strategies, and private equity. The Research Compendium 2020 contains all of our research published this year. We would like to thank(...) Equity Fundamentals: Part 2 [Kyle Downey]In Part 1 we looked at using TimescaleDB and SQLAlchemy to build a relational database model of the Sharadar equity dataset with a Python object model sitting on top. The initial cut of this project ran on my desktop and broke up each of the dataset loads into a simple script that I could run in(...) What traders should know about seasonal adjustment [SR SV]The purpose of seasonal adjustment is to remove seasonal and calendar effects from economic time series. It is a common procedure but also a complex one, with side effects. Seasonal adjustment has two essential stages. The first accounts for deterministic effects by means of regression and selects a(...) New Equities Strategy (p2) [Tr8dr]In the prior post I showed results for a new equities strategy which uses a combination of signals to create and risk manage a high-momentum portfolio. Further investigation revealed that I had neglected on a couple of fronts: failed to account for dividends (which are substantial) some data issues(...) How Should Trend-Followers Adjust to the Modern Environment?: Enter Adaptive Momentum [CSS Analytics]The premise of using either time-series momentum or “trend-following” using moving averages is the same only the math differs very slightly (see Which Trend Is Your Friend? by AQR): using some fixed lookback you can time market cycles and capture more upside than downside and therefore improve(...) Petra on Programming: Short-Term Candle Patterns [Financial Hacker]Japanese traders invented candle patterns in the 17th century. Some traders believe that those patterns are still valid. But alas, no one yet got rich with them. Still, trading book authors are all the time inventing new patterns, in hope to find one that is really superior to randomly entering(...)