This is a summary of links featured on Quantocracy on Monday, 11/18/2024. To see our most recent links, visit the Quant Mashup. Read on readers!
-
Day 21: Drawing Board [OSM]On Day 20 we completed our analysis of the 12-by-12 strategy using circular block sampling on the 3 and 7 blocks. We found the strategy did not outperform buy-and-hold on average and its frequency of outperformance was modest in the 28-31% range insufficient to warrant actually executing the strategy. What to do? Back to the drawing board to test a new strategy? Or to the water board to
-
Arbitrage In DEFI (p2) [Tr8dr]As mentioned in my prior post Arbitrage in DEFI (p1), have been building and improving a MEV strategy in DEFI to perform both atomic and non-atomic arbitrage, backrunning, liquidations, etc. In this article we continue to focus on algorithms to detect and optimise arbitrage paths through the pool graph. Let us consider a simple graph of possible flows between 6 pools: Bute-force approach (for
-
Making Use of Information Embedded in VIX Futures Term Structures [Relative Value Arbitrage]Building on the first paper, Reference [2] investigates machine learning techniques for trading VIX futures. It proposed using Constant Maturity Futures (CMF) to generate trading signals for VIX futures. It applied machine learning models to create these signals. Findings The experiment results show that term structure features, such as t and roll, are highly effective in predicting the
-
Day 20: Strategy Sample [OSM]On Day 19, we introduced circular block sampling and used it to test the likelihood the 200-day SMA strategy would outperform buy-and-hold over a five year period. We found that the 200-day outperformed buy-and-hold a little over 25% of the time across 1,000 simulations. The frequency of the 200-days Sharpe Ratio exceeding buy-and-hold was about 30%. Today, we apply the same analysis to the
-
Rethinking Asset Growth in Asset Pricing Models [Alpha Architect]Measures of asset growth add considerable explanatory power to asset pricing models, but wait, theres a twist. The formulation for measuring asset growth in risk models, such as the 5-Factor Fama-French (FF5F) or the Hou-Xue-Zhang (HXZ), do not necessarily align with traditional measures of firm investment even though they seem to be a good statistical fit. Accordingly, there is one central
-
SPY, SSO and TLT Strategy [Alvarez Quant Trading]A reader sent a strategy to test which is a basic monthly rotation strategy between stocks and bonds. What caught my attention was the use of SSO, the 2x of S&P 500. The main idea being to use SSO when in a low volatility bull market. Looking over the rules, I could tell this strategy was created before the recent bear market in bonds. Initial Rules At the close on the last trading day of the
-
Day 19: Circular Sample [OSM]On Day 18 we started to discuss simulating returns to quantify the probability of success for a strategy out-of-sample. The reason for this was we were unsure whether or how much to merit the 12-by-12s performance relative to the 200-Day SMA. We discussed various simulation techniques, but we settled on historical sampling that accounts for autocorrelation of returns. We then showed the
-
How To Profitably Trade Bitcoin s Overnight Sessions? [Quantpedia]As interest in cryptocurrencies continues to surge, driven by each new price rally, crypto assets have solidified their position as one of the main asset classes in global markets. Unlike traditional assets, which primarily trade during standard working hours, cryptocurrencies trade 24/7, presenting a unique landscape of liquidity and volatility. This continuous trading environment has prompted us
-
Arbitrage In DEFI (p1) [Tr8dr]I have been building and improving a MEV strategy in DEFI to perform both atomic and non-atomic arbitrage, backrunning, liquidations, etc. In this post will focus on one of the hard algorithmic problems, namely, determining the optimal size and path of arbitrage through swap pools and other protocols. On Ethereum, for example, there are ~700K ERC20 tokens and a few hundred thousand AMM pools
-
Day 18: Autocorrelation Again! [OSM]On Day 17 , we compared the 12-by-12 and 200-day SMA strategies in terms of magnitude and duration of drawdowns, finding in favor of the 200-day. We also noted that most of the contributors to the differences in performance were due to two periods at the beginning and end of the period we were examining. That suggests regime driven performance, which begs the question, how much can we rely on our
-
Day 17: Drawdowns [OSM]On Day 16, we showed the adjusted 12-by-12 strategy with full performance metrics against buy-and-hold, the 60-40 SPY-IEF ETF portfolio, and the 200-day SMA strategy. In all cases, it tended to perform better than the benchmarks. However, against the 200-day SMA that performance came primarily at the end of the period. This begs the question of what to make of the performance differences between
-
Day 16: Comps [OSM]On Day 15 we adjusted our model to use more recent data to forecast the 12-week look forward return. As before, we used that forecast to generate a trading signal that tells us to go long the SPY if the forecast is positive, and exit (or short for the long-short strategy) if otherwise. We saw this tweak generated about 10% points of cumulative outperformance and a 20% point higher Sharpe Ratio.
-
Statistical Arbitrage [Quantitativo]"The holy grail of investing is to have 15 or more good, uncorrelated return streams. Ray Dalio. I find Ray Dalio's story truly inspiring. From founding Bridgewater Associates in his two-bedroom apartment and growing it into the largest hedge fund in the world to publicly sharing the principles that guided himwhat he did right and wrong throughout the yearsDalio has always
-
Trading books: Let’s get real about what you actually need [Robot Wealth]People often ask me for book recommendations. But heres a better question: Whats going to help you make money today? Reading a book probably isnt the answer. Im not saying books arent useful. They absolutely are. But youre not preparing for a PhD defence youre trying to turn money into more money through trading. And that means focusing on solving real problems with the
-
Rethinking Pairs Trading: Can Traditional Methods Still Deliver Returns? [Relative Value Arbitrage]Pairs trading is a market-neutral strategy that involves trading two correlated stocks or assets. The idea is to identify pairs that historically move together, and then take a long position in one and a short position in the other when they diverge, with the expectation that they will eventually revert to their mean relationship. The popularity of pairs trading has risen over the years.
-
Markets Becoming More Efficient: The Disappearing Index Effect [Alpha Architect]Among the earliest challenges to the efficient markets hypothesis was the observation that stock prices react to investor demand unrelated to fundamentals. One example is the abnormal returns to additions and deletions to the S&P 500 Index. Robin Greenwood and Marco Sammon, authors of the September 2024 study The Disappearing Index Effect, examined the price impact of changes to the
-
Research Review | 7 November 2024 | Market Analytics [Capital Spectator]Climate Risk and Predictability of Global Stock Market Volatility Mingtao Zhou and Yong Ma (Hunan University) March 2024 Our study investigates the informative role of climate risk in improving the predictability of global stock market volatility. By extracting the composite component from the four individual climate risk proxies of Faccini et al. (2023), we show that aggregate climate risk is a
-
Day 15: Backtest II [OSM]On Day 14 we showed how the trading model we built was snooping and provided one way to correct it. Essentially, we ensure the time in which we actually have the target variable data aligns with when the trading signals are produced. We then used the value of the next time step to input into the model to generate a forecast. If the forecast was positive, wed go long the SPY ETF, if negative
-
A time-varying-parameter vector autoregression model with stochastic volatility [Quant Insti]The basic Vector Autoregression (VAR) model is heavily used in macro-econometrics for explanatory purposes and forecasting purposes in trading. In recent years, a VAR model with time-varying parameters has been used to understand the interrelationships between macroeconomic variables. Since Primiceri (2005), econometricians have been applying these models using macroeconomic variables such as:
-
Day 14: Snooping [OSM]Guess what? The model we built in our last post actually suffers from snooping. We did this deliberately to show how easy it is to get mixed up when translating forecasting models into trading signals. Lets explain. Our momentum model uses a 12-week cumulative return lookback to forecast the next 12-week cumulative return. That may have produced a pretty good explanatory model compared to the
-
Day 13: Backtest I [OSM]Unlucky 13! Or contrarian indicator? Theres really nothing so heartwarming as magical thinking. Whatever the case, on Day 12 we iterated through the 320 different model and train step iterations to settle on 10 potential candidates. Today, we look at the best performing candidate and discuss the process to see if the forecasts produce a viable trading strategy. As we noted before, we could have
-
Lognormal Distribution: Neither Thin- nor Fat-Tailed [Quant at Risk]In probability and statistics, distributions are often classified as either thin-tailed or fat-tailed, a distinction that reflects the likelihood of extreme deviations from the mean. The lognormal distribution, however, defies this binary classification. It possesses characteristics that make it neither fully thin-tailed, as in the case of the Gaussian, nor entirely fat-tailed, like
-
Day 12: Iteration [OSM]In Day 11, we presented an initial iteration of train/forecast steps to see if one combination performs better than another. Our metric of choice was root mean-squared error (RMSE)1 which is frequently used to compare model performance in machine learning circles. The advantage of RMSE is that it is in the same units as the forecast variable. The drawback is that it is tough to interpret on its
-
Day 11: Autocorrelation [OSM]On Day 10, we analyzed the performance of the 12-by-12 model by examining the predicted values and residuals. Our initial takeaway suggested the model did seem not overly biased or misspecified in the -10% to 10% region. But when it gets outside that range, watch out! We suspected that there was some autocorrelation in the residuals, which we want to discuss today. There are different statistical
-
Using Trading Volume to Optimize Portfolio Construction and Implementation [Alpha Architect]While portfolio optimization typically focuses on risk and return prediction, implementation costs critically matter. Unfortunately, predicting trading costs is challenging because the largest component for a large investor is price impact, which depends on the size of the trade, the amount traded by other traders in that security, and the identity of the trader, thus, impeding a generic solution.
-
Day 10: Residuals [OSM]On Day 9 we conducted a walk-forward analysis on the 12-by-12 week lookback-look forward combination. We then presented the canonical the actual vs. predicted value graph with a 45o line overlay to show what a perfect forecast would look like. Heres the graph again. As noted previously, we limited the scale of the axes to make it easier to interpret. This omits some outliers, which well
-
Day 9: Forecast [OSM]Yesterday we finished up our analysis of the regression models we built using different combinations of lookback and look forward momentum values. Today, we see if we can generate good forecasts using that data. If youre wondering why we still havent tested Fibonacci retracements with Bollinger Band breakouts filtered by Chaikin Volatility, the reason is that were first trying to
-
Understanding the Invisible Tail of a Power Law [Quant at Risk]Understanding the invisible tail of a power law distribution is crucial for accurate extreme value analysis, especially in fields where rare, extreme events have a large impact. In finance, natural disaster modeling, and engineering, rare events, or outliers, are disproportionately impactful. The theory behind the invisible tail demonstrates that traditional methods for estimating risk or
-
Day 8: Baseline effects [OSM]Yesterday, we discussed the size effects, their statistical significance (e.g., p-values), and some other summary statistics for the various momentum combinations namely, 3, 6, 9, and 12 week lookback and look forward returns. We found that size effects were small, but a few were significant, and that in the case of the 12-by-12 combination about 75% of the results clustered in the -10% to 10%
-
Day 7: Size effects [OSM]Welcome to the last day of the first week of 30 days of backtesting! We hope youre enjoying the ride. If you have any questions or concerns, you can reach us at the contact details listed at the bottom of this post. On Day 6 we defined momentum rather roughly and ran a bunch of tests to identify the linear relationship between different lookback and look forward periods. However, we didnt go
-
Covariance Matrix Forecasting: Iterated Exponentially Weighted Moving Average Model [Portfolio Optimizer]In the previous post of this series on covariance matrix forecasting, I reviewed both the simple and the exponentially weighted moving average covariance matrix forecasting models, which are straightforward extensions of their respective univariate volatility forecasting models to a multivariate setting. With these reference models established, we can now delve into more sophisticated approaches
-
Day 6: Momentum [OSM]Yesterday we examined the eponymous Fama-French factors to see if we could find something that will help us develop an investment strategy to backtest. It turned out the best performing factor was the market risk premium, which is essentially the return to the market in excess of the risk-free rate. In other words, the best factor is buy-and-hold! I guess that means weve finished 24 days early.
-
Can Artificial Intelligence outsmart seasoned equity analysts? [Alpha Architect]If the task is to identify a firms true profitability, can AI outsmart seasoned analysts? Given the increasingly bloated nature of financial reports, decoding the twists and turns associated with events like obscure one-time gains and out-of-nowhere expenses to extract core earnings has become challenging even for accountants. This research will unravel how AI can successfully attack the
-
How to Build Mean Reversion Strategies in Currencies [Quantpedia]Our article explores a simple mean reversion trading strategy applied to FX futures, focusing on identifying undervalued and overvalued currencies to generate returns. Using FX futures rather than spot rates allows for the inclusion of interest rate differentials, simplifying the analysis. The strategy employs two position-sizing methodslinear and exponentialboth rebalanced monthly based on
-
Lognormal Stochastic Volatility Youtube Seminar and Slides [Artur Sepp]I would like to share the youtube video of my online seminar at Minnesota Center for Financial and Actuarial Mathematics and presentation slides. I discuss the motivation behind introducing the log-norml stochastic volatility (SV) model in our IJATF paper with Parviz Rakhmonov. I briefly highlight the advantages of this model over exisiting SV models. Then I focus on new features of the model. For
-
New YouTube Series Launched: Building Your AWS Trading Data Pipeline! [Black Arbs]I just published Part 1 of my new YouTube series, and I'm excited to share it with you all! After my recent post about automating trading strategies with AWS Cloud, many of you asked for a deeper dive into the technical implementation. Well, here it is! What's in Part 1? In this first video, we're tackling the foundation: configuring your AWS data pipeline and writing the Python
-
Day 5: Trifactor [OSM]The day has finally arrived! Time to start backtesting! Weve always wanted to test how Fibonacci retracements with Bollinger Band breakouts filtered by Chaikin Volatility would perform while implementing rolling stop-loss updates based on the ATR scaled by the 7-day minus 5-day implied volatility rank.1 Maybe were getting ahead of ourselves. Expeditions are fun and its always thrilling to
-
Day 4: First analysis [OSM]Were four days in and youre probably wondering when are we actually going to start backtesting?! The answer is that while it is natural to want to rush to the fun part the hope and elation of generating outsized returns and Sharpe Ratios greater than 2 the reality is getting the foundation right should serve us well in the future. Or so thats what we always hear from those longer
-
Day 3: Metrics [OSM]Yesterday we investigated the effect of using the 200-day simple moving average (200SMA) as a proxy for a rules-based investing method. The idea was to approximate what a reasonably rational actor/agent might do in addition to the buy-and-hold approach. When folks talk about research, backtesting, and forecast comparisons, they usually use a naive model against which one compares performance. In
-
Day 2: Hello World [OSM]On Day 1, we decided on a few benchmarks to use for our backtest. That is, a 60-40 and 50-50 weighting of the SPY and IEF ETFs. What we want to add in now is the Hello World version of trading strategies the 200-DAY MOVING AVERAGE! Why are we adding this to our analysis? As we pointed out yesterday, the typical benchmark against which to compare a trading strategy is buy-and-hold. But, just as
-
Day 1: Benchmarks [OSM]Yesterday we set out our plan to backtest a strategy using the SPY ETF, which tracks the S&P 500. Before we commence, we obviously need to establish a baseline. What metrics will we use to assess the strategy? How will we define success? What benchmarks will we use? Typically, for a single asset strategy the comparison is buy-and-hold performance. That is, if youre using Fibonacci
-
Reinforcement Learning in Finance: Resources and Expert Advice from Paul Bilokon [Quant Insti]Reinforcement learning (RL) is one of the most exciting areas of Machine Learning, especially when applied to trading. RL is so appealing because it allows you to optimise strategies and enhance decision-making in ways that traditional methods cant. One of its biggest advantages? You dont have to spend a lot of time manually training the model. Instead, RL learns and makes trading decisions
-
Accurately Forecasting Multi-period Stock Market Returns [Six Figure Investing]I recently posted a paper, Transforming Stock Market Forecasts with Variable Expected Returns, on the SSRN online repository. This paper resolves an issue that has been bugging me for years. The link is: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=495384 This paper is not about making money, but rather about a fundamental theoretical error regarding stock market forecasts that has
-
Mind the gap [Quantitativo]"What we know is a drop; what we don't know is an ocean. Isaac Newton. Many of Isaac Newton's early theories and ideas were met with skepticism or outright failure. Newton spent years working on problems related to motion, optics, and gravity, often facing dead ends and revisions. In fact, throughout most of his career, Newton was very loathe to publish due to his high
-
Artificial Intelligence, Textual Analysis and Hedge Fund Performance [Alpha Architect]Artificial Intelligence (AI) offers the intriguing potential to revolutionize investment decision-making by providing important advantages such as: Enhanced Data Analysis: AI can process and analyze vast amounts of data from various sources, including financial news, market trends, and company fundamentals, at a speed and scale far surpassing human capabilities. This enables investors to identify
-
Pre-Holiday Effect in Commodities [Quantpedia]Our research will explore the intriguing phenomenon of the Pre-Holiday effect in commodities, particularly crude oil and gasoline. Historical data reveals a short-term price drift prior to major U.S. holidays, suggesting a trend in these markets. We hypothesize that this anomaly may be driven by increased demand for oil and its derivatives, such as gasoline, as people prepare for travel, often by
-
The Return of Simple and Exponentially Weighted Moving Average Models [Portfolio Optimizer]In the initial post of the series on volatility forecasting, I described the simple and the exponentially weighted moving average forecasting models, that are both easy to understand and relatively performant in practice. Beyond (univariate) volatility forecasting, these two models are also widely used in (multivariate) covariance matrix forecasting123, for the very same reasons. In this blog
-
The Sahm Rule as a Recession Indicator [Alpha Architect]A weaker-than-expected July jobs report, with the unemployment rate increasing to 4.3%, officially triggered the Sahm Rule, causing investors to worry that the Federal Reserve may be behind the curve in cutting interest rates to prevent a recession. (The August report showed an increase in payroll employment of 142,000, with the unemployment rate at 4.2%). Named after Claudia Sahm, a
-
How to Improve ETF Sector Momentum [Quantpedia]In this article, we explore the historical performance of sector momentum strategies and examine how their alpha has diminished over time. By analyzing the underlying causes behind this decline, we identify key factors contributing to the underperformance. Most importantly, we introduce an enhanced approach to sector momentum, demonstrating how this solution significantly improves the performance
-
How I Automated My Trading Strategy Using AWS Cloud for Free (Part 1) [Black Arbs]This year I launched a strategy subscription service for a long-only ETF strategy developed in house. I learned a lot through this process but I made several mistakes that pushed me to learn new skills and improve the product offering. In this series I will discuss my initial mistakes, and how correcting them led me to automate the system using AWS cloud and how you can too. Mistake #1 First