Quant Mashup Risk-constrained optimization [OSM]Our last post parsed portfolio optimization outputs and examined some of the nuances around the efficient frontier. We noted that when you start building portfolios with a large number of assets, brute force simulation can miss the optimal weighting scheme for a given return or risk profile. While(...) Contagion and self-fulfilling dynamics [SR SV]Contagion and self-fulfilling feedback loops are propagation mechanisms at the heart of systemic financial crises. Contagion refers to the deterioration of fundamentals through the financial network, often through a cascade of insolvencies. A critical factor is the similarity of assets held by(...) Copula for Pairs Trading: Sampling and Fitting to Data [Hudson and Thames]This is the second article of the copula-based statistical arbitrage series. You can read the first article: Copula for Pairs Trading: A Detailed, But Practical Introduction. Overview Whether it is for pairs trading or risk management, two natural questions to ask before putting copula for use are:(...) Improving time series animations in matplotlib (from 2D to 3D) [Quant Dare]Animating time series is a very powerful tool to show evolution over time, but matplotlib default animations are boring and they are not well suited for comparison purposes. Along this blog, animations are widely used: from explaining how neural networks train, to showing synthetic time-series(...) Heatmap Plot of Forex Temporal Clustering of Turning Points [Dekalog Blog]Following up on my previous post, below is the chart of the temporal turning points that I have come up with. This particular example happens to be 10 minute candlesticks over the last two days of the GBP_USD forex pair. The details I have given about various turning points over the course of my(...) Do Security Analysts Follow the Academic Evidence? [Alpha Architect]As my co-author Andrew Berkin and I explain in our new book “Your Complete Guide to Factor-Based Investing,” there is considerable evidence of cross-sectional return predictability. Citing more than 100 academic papers, we presented evidence of predictability for both equity and bond factors.(...) When a correlation matrix is not a correlation matrix and what can be done about it [Portfolio Optimizer]Estimating how individual assets are moving together is an important part of many financial applications1 and the most commonly used measure for this is the Pearson correlation. Unfortunately, for a variety of reasons, what sometimes appears to be a correlation matrix is actually not a valid(...) Understanding Variance Explained in PCA - Matrix Approximation [Eran Raviv]Principal component analysis (PCA from here on) is performed via linear algebra functions called eigen decomposition or singular value decomposition. Since you are actually reading this, you may well have used PCA in the past, at school or where you work. There is a strong link between PCA and the(...) The failure of anomaly indicators in finance [Mathematical Investor]Recent public reports have underscored a crisis of replicability in numerous fields of science: In 2012, Amgen researchers reported that they were able to replicate fewer than 10 of 53 cancer studies. In March 2014, physicists announced with fanfare that they had detected evidence of gravitational(...) So you want to be a quant/systematic trader? [Investment Idiocy]One of the upsides of having a (very, very minor) public profile is that you get a lot of people asking you for advice, which is flattering (and if you say otherwise, you need to consider just how first world that particular 'problem' is). The only downside of this is you get asked the(...) Myth-Busting: Low Rates Don't Justify High Valuations [Factor Research]High equity valuations are frequently justified by low interest rates There is no long-term evidence in the US to support this theory P/E ratios in Japan and Europe have remained low, despite zero or negative yields INTRODUCTION One of the more peculiar transactions I worked on as an investment(...) Hot Topic: Does “Gamma” Hedging Actually Affect Stock Prices? [Alpha Architect]More and more evidence seems to suggest that social Media impacts daily momentum and volatility. Some hedge funds that were short GME the past couple of months should have read these blog posts. In a similar vein, there is plenty of twitter chatter on the topic and anecdotal evidence that during the(...) Parsing portfolio optimization [OSM]Our last few posts on risk factor models haven’t discussed how we might use such a model in the portfolio optimization process. Indeed, although we’ve touched on mean-variance optimization, efficient frontiers, and maximum Sharpe ratios in this portfolio series, we haven’t discussed portfolio(...) Probing Price Momentum of Bitcoin during its Bull Runs with a Piecewise Linear Model [Quant At Risk]In 2020 Bitcoin delivered us another spectacular bull run. It was as impressive as the one we witnessed in 2017. The analysis of Bitcoin price time-series during its bull runs can uncover interesting results. By comparing a selected set of characteristics we could find some commonalities in trading.(...) Temporal Clustering Times on Forex Majors Pairs [Dekalog Blog]In the following code box there are the results from the temporal clustering routine of my last few posts on the four forex majors pairs of EUR_USD, GBP_USD, USD_CHF and USD_JPY. This is based on 10 minute bars over the last year or so. Readers should read my last few previous posts for background.(...) The Trend Persistence Indicator [Financial Hacker]Financial markets are not stationary: price curves can swing all the time between trending, mean reverting, or entire randomness. Without a filter for detecting trend regime, any trend following strategy will bite the dust sooner or later. In Stocks & Commodities February 2021, Richard Poster(...) The Complete Guide to Portfolio Optimization in R Part 2 [Milton FMR]Congratulations you made it to part2 of our tutorial. Give yourself a round of applause. If you stumbled upon part2 before reading part1 we advise you to start from the beginning and read part1 first. In Part2 we dive into mean variance portfolio optimization, mean CVar portfolios and backtesting.(...) Do Candlesticks Work? A Quantitative Test Of 23 Candlestick Formations [Quantified Strategies]This article explains candlesticks and why we like to use candlesticks when displaying charts. Moreover, we test quantitatively 23 different candlestick formations. Perhaps surprisingly, some of the formations work pretty well. Some of the formations can highly likely be improved by adding one more(...) The Quality Factor—What Exactly Is It? [Alpha Architect]The existence of a quality premium in stocks that has been persistent over time, pervasive around the globe, and robust to various definitions have been well documented by studies such as “Buffett’s Alpha,” “Global Return Premiums on Earnings Quality, Value, and Size,” and “The Excess(...) Why is data cleaning important and how to do it the right way? [Quant Insti]Data cleaning is the time-consuming but the most important and rewarding part of the data analysis process. The process of data analysis is incomplete without cleaning data. But what happens if we skip this step? Suppose we had certain erroneous data in our price data. The incorrect data formed(...) New Research Tries To Solve For Beta Risk’s “Failure” For Stocks [Capital Spectator]At the core of modern finance is the proposition that beta (market) risk is the dominant factor that drives performance. But numerous empirical tests of the capital asset pricing model (CAPM) over the decades suggest otherwise. There have be various attempts to adjust CAPM to find a closer mapping(...) 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(...)