Quant Mashup Hierarchical Risk Parity: Introducing Graph Theory and Machine Learning in Portfolio Optimizer [Portfolio Optimizer]In this short post, I will introduce the Hierarchical Risk Parity portfolio optimization algorithm, initially described by Marcos Lopez de Prado1, and recently implemented in Portfolio Optimizer. I will not go into the details of this algorithm, though, but simply describe some of its general ideas(...) Why you need more data than you think in your backtest [Raposa Trade]How many years does it take before you can be confident in a trading strategy? Does one great year mean you have a tremendous strategy? Does one bad year mean you should pack it up and try something else? How soon can you tell that a system is flawed and needs changing? These aren’t easy(...) Truth and Liebor [Investment Idiocy]This will be a bit different from my normal posts. It's basically some personal reflections on the LIBOR fixing scandal, prompted by having just read this book written by Stelios Contogoulas: This post isn't really a book review, although I will say that the book is definitely worth(...) How to Trade the MACD: Four Strategies with Backtests [Raposa Trade]The Moving Average Convergence-Divergence (MACD) is a popular and versatile indicator that appears in a number of trading systems. In it’s most basic form, we have the difference between two exponential moving averages (EMA), one fast and the other slow. The MACD is the difference between these(...) Ten things investors should know about nowcasting [SR SV]Nowcasting in financial markets is mainly about forecasting forthcoming data reports, particularly GDP releases. However, nowcasting models are more versatile and can be used for a range of market-relevant information, including inflation, sentiment, weather, and harvest conditions. Nowcasting is(...) Matrix profile: Using Weakly Labeled Time Series to Predict Outcomes [Dekalog Blog]Back in May of this year I posted about how I had intended to use Matrix Profile (MP) to somehow cluster the "initial balance" of Market Profile charts with a view to getting a heads up on immediately following price action. Since then, my thinking has evolved due to my learning about the(...) Handling Big Data [Jonathan Kinlay]One of the major challenges that users face when trying to do data science is how to handle big data. Leaving aside the important topic of database connectivity/functionality and the handling of data too large to fit in memory, my concern here is with the issue of how to handle large data files,(...) A Streamlit Dashboard for the @AlpacaHQ API (h/t @PyQuantNews)The Alpaca brokerage service is very useful for algorithmic traders that comes with an API to retrieve data and execute trades in a paper or live environment. While you can also check the status and returns of your positions through the API, Alpaca has spent some time creating a frontend where users(...) Factor Timing Is Tempting [Alpha Architect]Academic research has found that factor premiums are both time-varying and dependent on the economic cycle. For example, Arnav Sheth, and Tee Lim, authors of the December 2017 study “Fama-French Factors and Business Cycles,” examined the behavior of six Fama-French factors—market beta (MKT),(...) The three kinds of (over) fitting [Investment Idiocy]This post is something that I've banged on about in many presentations at several conferences* (most complete slides are here), and in various interviews, but never actually formally described in a blog post. In fact this post has existed in draft form since 2015 (!). * you know, when you leave(...) Purchasing Power Parity [Quant Dare]Purchasing Power Parity (PPP) is a well-known measure used to compare the currencies of different countries in terms of price levels. So, in this post, we are going to explain PPP and study, through an example, its relation with the currency pairs. PPP is based on the law of one price (LOOP). For(...) VVIX/VIX as a Return Indicator? [CXO Advisory]Is the ratio of implied volatility of implied volatility (CBOE VVIX Index), interpretable as a measure of changes in investor fear level, to CBOE VIX Index itself a useful indicator of future stock market returns? To investigate, we relate monthly VVIX/VIX and monthly change in VVIX/VIX to monthly(...) Mutual Funds: Negative $125B in Value-Add? [Alpha Architect]Elton, Gruber, and Busse (2004) as well as Hortacsu and Syverson (2004) suggest that mutual fund markets are not perfectly competitive and that fees do matter to investors. In contrast, the neoclassical view of mutual funds (see for example Berk and Green, 2004; Pastor, Stambaugh and Taylor, 2019(...) Caveats in Calibrating the OU Process [Hudson and Thames]This is a series where we aim to cover in detail various aspects of the classic Ornstein-Uhlenbeck (OU) model and the Ornstein-Uhlenbeck Jump (OUJ) model, with applications focusing on mean-reverting spread modeling under the context of pairs trading or statistical arbitrage. Given the universality(...) Training Neural Networks: Why, As With Humans, Teaching Methods Matter [Enjine]I achieved my life’s biggest accomplishment in 2004, when I defeated dozens of other contestants to clinch the Canadian Settlers of Catan championship. “Settlers”, as it’s called by its enthusiasts, is a strategy board game where players collect resources, build settlements, trade with and(...) The Best Systematic Trading Strategies in 2021: Part 3 [Quantpedia]Finally, what are the five top-performing quantitative trading strategies in 2021? In part 1 of our article, we analyzed tendencies and trends among the Top 10 quantitative strategies of 2021. Thanks to Quantpedia Pro’s screener, we published several interesting insights about them. In part 2 of(...) Building an Inflation Portfolio Using Asset Classes [Factor Research]We recently explored using stocks to create an inflation-proxy portfolio that resulted in a collection of stocks with strong sector and factor biases. Specifically, the portfolio exhibited overweights in energy and financial stocks, perhaps as expected, as well as a long position in the value and(...) Dijkstra algorithm [Quant Insti]Start learning all about the Dijkstra algorithm for finding the shortest path. We briefly review the Kruskal algorithm, Prim algorithm, Johnson algorithm and Bellman algorithm as well. We'll cover: What is the Dijkstra algorithm? How does the Dijkstra algorithm work? Pseudo code of Dijkstra(...) Countercyclical Trend Following [Allocate Smartly]This is a test of a tactical strategy based on contrarian timing of the business cycle, increasing risk during periods of stress and decreasing risk during periods of calm. The strategy adds trend-following to this countercyclical approach to manage short-term market shocks. Backtested results from(...) International Tests of Factor Anomalies: Most Don’t Survive [Alpha Architect]Since the development of the capital asset pricing model (CAPM) about 50 years ago, academic researchers have documented hundreds of “anomalies” that generate significant positive alpha. There are now so many that economist John Cochrane, in his 2011 presidential address to the American Finance(...) How to Use Exotic Assets to Improve Your Trading Strategy [Quantpedia]As we have mentioned several times, the best course of action for a quant analyst who wants to develop a new trading strategy is to understand a well-known investment anomaly/factor fundamentally and then improve it. Quantpedia is a big fan of transferring ideas derived from academic research from(...) 4 Ways to Trade the Trend Intensity Indicator [Raposa Trade]Determining the strength of a trend can provide a valuable edge to your trading strategy and help you determine when to go long and let it ride, or not. This is what the Trend Intensity Indicator (TII) was designed to do. This indicator is as simple to interpret as more familiar values like the RSI.(...) Linear regression on market data using Python and R [Quant Insti]This is the second installment of my series on regression analysis used in finance. In the first installment, we touched upon the most important technique in financial econometrics: regression analysis, specifically linear regression and two of its most popular flavours: univariate linear(...) Mean Reversion Entry: At Open vs. Intraday Pullback vs Confirmation [Alvarez Quant Trading]For the mean reversion strategies that I have created in the past and are trading now, they typically enter at the next day’s open or wait for a further pullback intraday before entering. My current mean reversion strategy, which enters on a limit down, was doing great until a few months ago when(...) The Value Premium Might be Smaller Than We Originally Thought [Alpha Architect]Remember HML? It was the original formulation for estimating the “value” premium published by Fama & French in 1992. In that seminal article, FF argued based on the results they obtained, that the risk of owning equity is multidimensional. One of those dimensions of risk they used was(...) Correlation Matrix Stress Testing: Shrinkage Toward an Equicorrelation Matrix [Portfolio Optimizer]Financial research has consistently shown that correlations between assets tend to increase during crises and tend to decrease during recoveries1. The recent COVID-19 market crash was no exception, as illustrated on Alvarez Quant Trading blog post Correlations go to One for both the individual(...) The Best Systematic Trading Strategies in 2021: Part 2 [Quantpedia]The year 2021 has been an incredible year for passive equity investors so far. However, in the first part of our article, we talked about quantitative strategies which achieved even better results in 2021 than passive US equity investors. Indeed, there do exist such strategies, at least definitely(...) Building a Long Volatility Strategy without Using Options [Factor Research]Long volatility strategies can be built without using options Securities can be selected on different risk metrics like the VIX or high yield spread Although portfolios differ, the strategies exhibited similar trends INTRODUCTION We started our exploration of long volatility strategies by analyzing(...) Macro trends for trading models [SR SV]Unlike market price trends, macroeconomic trends are hard to track in real-time. Conventional econometric models are immutable and not backtestable for algorithmic trading. That is because they are built with hindsight and do not aim to replicate perceived economic trends of the past (even if their(...) Crypto Trading Depth [Tr8dr]I have a collection of crypto stat/arb strategies I plan to trade as a portfolio of strategies. Each strategy trades a small mean-reversion portfolio of loosely cointegrated coins, based on a bayesian state-based model. The returns in cryptos for this sort of strategy are phenomenal, however,(...) Optimising the rsims package for fast backtesting in R [Robot Wealth]rsims is a new package for fast, quasi event-driven backtesting in R. You can find the source on GitHub, docs here, and an introductory blog post here. Our use case for rsims was accurate but fast simulation of trading strategies. I’ve had a few questions about how I made the backtester as fast as(...) The Impact of Goodwill on Stock Returns [Alpha Architect]A firm’s stock price should reflect the value of both its tangible and intangible capital. While tangible capital has been widely studied, intangible capital has been receiving more attention due to its increasing importance in economic values. According to a December 29, 2020, Forbes article,(...) Testing Turtle Trading: The System that Made Newbie Traders Millions [Raposa Trade]In 1982, a group of inexperienced traders were recruited to be a part of an experiment that would make many of them multi-millionaires. Richard Dennis bet his partner William Eckhardt that anyone could be a successful trader given they had training and a system to follow. It was a re-hash of the(...) Designing Neural Networks [Enjine]Unfamiliar terms have a way of impressing us. I remember the first time I heard about the ‘Monte Carlo’ method. The name conjured up an image of a sophisticated technique, born out of deep discussions by brilliant mathematicians in a Spanish cafe. Turns out, it’s just a by-word for running(...) Financial Media, Price Discovery, and Merger Arbitrage [Alpha Architect]This paper contributes to the literature on understanding the limits of arbitrage and the resulting dynamics of price discovery. Specifically, it studies the context of "merger arbitrage," which is a well-known investment strategy and unless there are limits to arbitrage, this market(...) Free Resources to Learn Machine Learning for Trading [Quant Insti]Machine learning is a need in almost every sector today. Sectors like medicine, transportation, healthcare, advertising and financial technology are tremendously reliant on machine learning. Speaking about the financial technology domain, algorithmic trading practice is extremely efficient with the(...) Better Indicators with Windowing [Financial Hacker]If indicators didn’t help your trading so far, just pimp them by preprocessing their input data. John Ehlers proposed in his TASC September article the windowing technique: multiply the input data with an array of factors. Let’s see how triangle, Hamming, and Hann factor arrays can improve the(...) Chinese Stocks from a Factor Lens [Factor Research]Foreign stock ownership is low in China and the market is dominated by retail investors This provides an opportunity for investors to deploy quant strategies Factor investing has been far more attractive in Chinese than U.S. equities in recent years INTRODUCTION The latest chapter in the complicated(...) Embeddings of Sectors and Industries using Graph Neural Networks [Gautier Marti]You can find the reproducible experiment in this Colab Notebook. In econometrics and financial research, categorical variables, and especially sectors and industries, are usually encoded as dummy variables (also called one-hot encoding in the machine learning community). You can find plenty of such(...) Exploring the rsims package for fast backtesting in R [Robot Wealth]rsims is a new package for fast, realistic (quasi event-driven) backtesting of trading strategies in R. Really?? Does the world really need another backtesting platform…?? It’s hard to argue with that sentiment. Zipline, QuantConnect, Quantstrat, Backtrader, Zorro… there are certainly plenty(...) Community Alpha of QuantConnect - Part 2: Social Trading Factor Strategies [Quantpedia]This blog post is the continuation of series about Quantconnect´s Alpha market strategies. This part is related to the factor strategies notoriously known from the majority of asset classes. Although the results are insightful, they are not straightforward, and further analysis could be made.(...) Research Review | 13 August 2021 | Market and Asset Analytics [Capital Spectator]Decomposing Momentum: Eliminating its Crash Component Pascal Büsing (University of Muenster), et al. July 15, 2021 We propose a purely cross-sectional momentum strategy that avoids crash risk and does not depend on the state of the market. To do so, we simply split up the standard momentum return(...) Relative Sentiment and Market Returns [Alpha Architect]This paper studies the relationship between aggregate investor attention and subsequent market returns over the following week. The authors create two different investor attention indicators—one for aggregate retail attention (ARA) and one for aggregate institutional attention (AIA). ARA is found(...) New Feature: Cluster Analysis [Allocate Smartly]We track a lot of tactical strategies, and it can be difficult to understand how they all fit together in the big picture. The usual correlation matrix (example) is helpful when drilling down on a single strategy, but it’s near impossible to see the forest for the trees among the 1000’s of data(...) Modeling US Stock Market Expected Returns, Part III [Capital Spectator]I recently outlined two models for estimating the US stock market’s return for the decade ahead. Let’s add a third model to the mix with the plan to take the average as a relatively robust forecast. The previous two models (see here and here) used valuation to estimate ex ante performance for(...) Value Investing and the Role of Intangibles [Alpha Architect]Recent research, including the 2020 studies “Explaining the Recent Failure of Value Investing” and “Intangible Capital and the Value Factor: Has Your Value Definition Just Expired?,” have investigated the impact on U.S. value strategies of the increase in the relative importance of(...) Valuing Bitcoin using USD Index [Recession Alert]Of the dozen indicators and metrics we have researched, the fortunes of the US Trade-Weighted U.S Dollar Index (TWDI) has the biggest impact on Bitcoin USD prices. When the TWDI depreciates, this boosts Bitcoin prices strongly. When the TWDI becomes stronger, Bitcoin prices face significant(...) Extended Optimal Arbitrage Strategies [Hudson and Thames]In our previous article, we’ve discussed a couple of trading strategies exploiting arbitrage between similar stocks using stochastic optimal control methods. A major shortcoming of those approaches is that we restricted ourselves to constructing delta-neutral portfolios. Along with this, the ratio(...) Building an Inflation Portfolio Using Stocks [Factor Research]An inflation portfolio can be created by systematically selecting stocks correlated to inflation This would have resulted in a portfolio with strong sector and factor biases However, the correlation to inflation would not have been significantly higher than for stocks overall INTRODUCTION Measuring(...) Should you Trade with the Kelly Criterion? [Raposa Trade]The Kelly Criterion gives an optimal result for betting based on the probability of winning a bet and how much you receive for winning. If you check out Wikipedia or Investopedia, you’ll see formulas like this: f∗=p−1−pb−1f^{*} = p - \frac{1-p}{b-1} f∗=p−b−11−p which gives you(...)