Quant Mashup Bias-Variance Tradeoff in Machine Learning for Trading [Quant Insti]Prerequisites To fully grasp the bias-variance tradeoff and its role in trading, it is essential first to build a strong foundation in mathematics, machine learning, and programming. Start with the fundamental mathematical concepts necessary for algorithmic trading by reading Stock Market Math:(...) How to Download Multiple Stocks Data at Once Using Python Multithreading [Quant Insti]Imagine you have to backtest a strategy on 50 stocks and for that you have to download price data of 50 stocks. But traditionally you have to download ticker by ticker. This sequential download process can be painfully slow, especially when each API call requires waiting for external servers to(...) How Mega Tech Stocks Impact Factor Strategies [Quantpedia]The dominance of mega-tech stocks, particularly the “Magnificent 7,” in both U.S. and global equity indexes has a profound impact on factor portfolios. When constructing value-weighted smart beta strategies, these portfolios often end up heavily concentrated in a few individual stocks. This(...) Bob Pardo - Building Trading Strategies that Work with Walk Forward Analysis - Part 2 of 2 [Algorithmic Advantage]I had a thought this week about what constitutes my "trading edge". You know, the question every trader is expected to be able to answer. It's supposed to constitute some kind of evidence that you can out-perform the market, your peers, or whatever. Something Bob Pardo mentioned made(...) EM sovereign bond allocation with macro risk premium scores [Macro Synergy]Macro risk premium scores are differences between market-implied risk and point-in-time quantified macroeconomic risk. Two principal types of scores can be calculated for credit markets: spread-based risk premium scores and rating-based risk premium scores. This post proposes a small set of these(...) Easy games vs hard games in trading [Robot Wealth]In Trade Like a Quant Bootcamp, we talk about win-win risk premia harvesting. It’s a game where no one’s really competing for the edge. Think about VTI (Vanguard’s Total Stock Market ETF). You expect to make more than implied by the stock market’s cash flows (a risk premium) because holding(...) Crypto Market Arbitrage: Profitability and Risk Management [Relative Value Arbitrage]Cryptocurrencies are becoming mainstream. In this post, I feature some strategies for trading and managing risks in cryptocurrencies. Arbitrage Trading in the Cryptocurrency Market Arbitrage trading takes advantage of price differences in different markets and/or instruments. Reference [1] examined(...) Autoregressive Drift Detection Method (ADDM) in Trading [Quant Insti]Imagine yourself, a great retail trader with an algorithm that flawlessly predicts stock movements for months—until a surprise Fed rate hike sends markets into chaos. Overnight, the model’s accuracy plummets. Why? Concept drift: your model no longer finds patterns in historical data and now(...) Yield Curve Interpolation with Gaussian Processes: A Probabilistic Perspective [Sitmo Machine Learning]Here we present a yield curve interpolation method, one that’s based on conditioning a stochastic model on a set of market yields. The concept is closely related to a Brownian bridge where you generate scenario according to an SDE, but with the extra condition that the start and end of the(...) Historical Market Data Sources [Quant Insti]A good trading or investment strategy is only as good as the data behind it. High-quality data is essential if you are backtesting a quant model, analyzing market trends, or building an algorithmic trading system. Prerequisites: To make the most of this blog, it is essential to have a strong(...) Research Review | 21 MAR 2025 | Models and Forecasts [Capital Spectator]ChatGPT and Deepseek: Can They Predict the Stock Market and Macroeconomy? Jian Chen (Xiamen University), et al. February 2025 We study whether ChatGPT and DeepSeek can extract information from the Wall Street Journal to predict the stock market and the macroeconomy. We find that ChatGPT has(...) Optimizing Portfolios: Simple vs. Sophisticated Allocation Strategies [Relative Value Arbitrage]Portfolio allocation is an important research area. In this issue, we explore not only asset allocation but also the allocation of strategies. Specifically, I discuss tactical asset and trend-following strategy allocation. Tactical Asset Allocation: From Simple to Advanced Strategies Tactical Asset(...) How Global Neutral Rates Impact Currency Carry Strategies? [Quantpedia]Market practitioners often rely on experience-based wisdom to navigate currency markets, and one such widely held belief is that low dispersion in global bond yields signals weak future returns for carry trades (and high dispersion implies high future carry returns). While this intuition makes(...) Adverse Effects of Index Replication [Alpha Architect]Mutual funds and ETFs whose main directive is index replication incur adverse selection costs from responding to changes in the composition of the stock market because indices rebalance in response to composition changes (due to IPOs, delistings, additions, deletions, new seasoned issuance, and(...) The Growth and Inflation Sector Timing Model [CSS Analytics]big forces to worry about: growth and inflation. Each could either be rising or falling, so I saw that by finding four different investment strategies—each one of which would do well in a particular environment (rising growth with rising inflation, rising growth with falling inflation, and so(...) Trading the Spread: Bitcoin ETFs vs. Cryptocurrencies Infrastructure ETFs [Quantpedia]In this study, we explore the application of simple spread trading strategies using Bitcoin ETFs and cryptocurrency infrastructure ETFs—two highly correlated asset classes due to the broader influence of cryptocurrency market movements. Given their strong relationship, this setup provides a(...) On inflation and stock returns [Outcast Beta]Are stocks an inflation hedge? At least in the long run? We find the answer to both questions is no. While fundamental returns—comprising dividend return and earnings growth—do help hedge inflation, valuation changes undermine this hedge. This holds true whether we examine yearly returns,(...) Anti-Dividend Investing: Yield Matters - But Not How You Think! [Alpha Architect]Dividends are the comfort food of investing. Who wouldn’t love feeling like they’re getting a seemingly “free” payout just for holding onto a stock? It’s no wonder so many investors are drawn to the siren call of yield. As with all good things, there’s a little more—perhaps a whole lot(...) The 30% Selloff Signal: What History Tells Us About Market Recoveries [Alvarez Quant Trading]I was talking to my trading buddy and he mentioned that he read that 40% of Russell 3000 stocks are 30% or more off their 52-week high. To us that sounded really bad. But as usual, we asked is it? Or is this normal when we finally cross under the 200-day moving average after a long time being above(...) Building Correlation Matrices with Controlled Eigenvalues: A Simple Algorithm [Sitmo Machine Learning]In some cases, we need to construct a correlation matrix with a predefined set of eigenvalues, which is not trivial since arbitrary symmetric matrices with a given set of eigenvalues may not satisfy correlation constraints (e.g., unit diagonal elements). A practical method to generate such matrices(...) Ehlers’ Ultimate Oscillator [Financial Hacker]In his TASC article series about no-lag indicators, John Ehlers presented last month the Ultimate Oscillator. What’s so ultimate about it? Unlike other oscillators, it is supposed to indicate the current market direction with almost no lag. The Ultimate Oscillator is built from the difference of(...) The Impact of the Inflation on the Performance of the US Dollar [Quantpedia]Inflation is one of the key macroeconomic forces shaping financial markets, influencing asset prices across the board. In our previous analysis, we examined how gold and Treasury prices react to changes in the inflation rate, uncovering patterns that suggested inflation dynamics also impact the US(...) Finding the Nearest Valid Correlation Matrix with Higham’s Algorithm [Sitmo Machine Learning]In quantitative finance, correlation matrices are essential for portfolio optimization, risk management, and asset allocation. However, real-world data often results in correlation matrices that are invalid due to various issues: Merging Non-Overlapping Datasets: If correlations are estimated(...) Macro trading signal optimization: basic statistical learning methods [Macro Synergy]A key task of macro strategy development is condensing candidate factors into a single positioning signal. Statistical learning offers methods for selecting factors, combining them to a return prediction, and classifying the market state. These methods efficiently incorporate diverse information(...) Variance for Intuition, CVaR for Optimization [Anton Vorobets]While everyone understand that investment risk is characterized by large losses or drawdowns, mainstream finance and economics academics still continue to promote mean-variance analysis. Even Harry Markowitz understood that risk should be measured by the downside, but in 1950’s the computational(...) Backtesting the Opening Range Breakout (ORB) Strategy using Polygon.io [Concretum Group]In this article, we will show you how to run, customize, and analyze a backtest for the Opening Range Breakout (ORB) strategy. Instead of explaining every line of code, we’ll focus on how to execute the backtest, adjust key parameters, and interpret the results. By the end, you’ll be able to:(...) Capturing Volatility Risk Premium Using Butterfly Option Strategies [Relative Value Arbitrage]The volatility risk premium is a well-researched topic in the literature. However, less attention has been given to specific techniques for capturing it. In this post, I’ll highlight strategies for harvesting the volatility risk premium. Long-Term Strategies for Harvesting Volatility Risk Premium(...) Volatility Forecasting: HExp Model [Portfolio Optimizer]In this series on volatility forecasting, I previously detailed the Heterogeneous AutoRegressive (HAR) volatility forecasting model that has become the workhorse of the volatility forecasting literature1 since its introduction by Corsi2. I will now describe an extension of that model due to(...) Efficient Rolling Median with the Two-Heaps Algorithm. O(log n) [Sitmo Machine Learning]Calculating the median of data points within a moving window is a common task in fields like finance, real-time analytics and signal processing. The main applications are anomal- and outlier-detection / removal. Fig 1. A slow-moving signal with outlier-spikes (blue) and the rolling median filter(...) Fast Rolling Regression: An O(1) Sliding Window Implementation [Sitmo Machine Learning]In finance and signal processing, detecting trends or smoothing noisy data streams efficiently is crucial. A popular tool for this task is a linear regression applied to a sliding (rolling) window of data points. This approach can serve as a low-pass filter or a trend detector, removing short-term(...) Does gold belong in a risk premia portfolio? [Robot Wealth]With GLD up 40-something percent since early 2024, I’ve been thinking about gold’s place in a risk premia harvesting portfolio. It’s a fascinating rabbit hole and there’s plenty of disagreement. Let’s break this down from two perspectives – the academic one (yawn) and the practical one(...) How Bond ETFs Make Trading Easier and Cheaper [Alpha Architect]Bond Exchange-Traded Funds (ETFs) help people invest in bonds without having to buy them one by one. Instead, they let investors buy a mix of bonds all at once, making it easier and cheaper to trade. This is especially helpful for bonds that are usually harder to buy or sell. Because of bond ETFs,(...) Can Margin Debt Help Predict SPY’s Growth & Bear Markets? [Quantpedia]Navigating the financial markets requires a keen understanding of risk sentiment, and one often-overlooked dataset that provides valuable insights is FINRA’s margin debt statistics. Reported monthly, these figures track the total debit balances in customers’ securities margin accounts—a key(...) Very... slow... mean reversion, and some thoughts on trading at different speeds [Investment Idiocy]Bit of a mixed bag post today. The golden thread connecting them is the idea that markets trend and mean revert at different frequencies. - A review of the discussion around timeframes for momentum and mean reversion in 'Advanced Futures Trading Strategies', in light of this excellent(...) What is Trend Following? A Painful Journey to Smarter Investing [Alpha Architect]When it comes to choosing an investment strategy, most investors—whether they realize it or not—are looking for something that: Beats the benchmark Never loses money Works all the time And here’s the harsh reality: this unicorn of a strategy doesn’t exist. Anyone promising you all three is(...) Batch Linear Regression via Bayesian Estimation [Quant Start]In previous articles we have discussed the theory of state space models and Kalman Filters as well as their application to estimating a dynamic hedging ratio between a pair of cointegrating ETFs. The articles were relatively light on theory and did not explore the much broader field of Bayesian(...) Understanding Mean Reversion to Enhance Portfolio Performance [Relative Value Arbitrage]In a previous newsletter, I discussed momentum strategies. In this edition, I’ll explore mean-reverting strategies. Mean reversion is a natural force observed in various areas of life, including sports performance, portfolio performance, volatility, asset prices, etc. In this issue, I specifically(...) Understanding the Stock–Bond Correlation [Alpha Architect]This study looks at how stocks and bonds move together over time, using data from 1875 to 2023. The authors find that inflation, interest rates, and government stability affect this relationship. When inflation and interest rates go up, stocks and bonds tend to move in the same direction, making(...) Learning to Rank [Quantitativo]“Give me a firm place to stand and a lever, and I can move the Earth.” Archimedes. Archimedes, the brilliant Greek mathematician and engineer, was so fascinated by levers that he claimed he could move the Earth with one. His deep understanding of mechanics made him a legend, from designing war(...) Can you trust the "Fear & Greed Index"? [Unravel Markets]In the last couple of days, X and other crypto social media is flooded with screenshots of the “Fear & Greed Index” printing “Extreme Fear”, usually with a Warren Buffet quote, or something similar. Let’s dig into whether it really has any predictive power at all! The common assumption(...) Confessions of a recovering engineer (or why engineers make bad traders) [Robot Wealth]Here’s something that might shock you: Engineers make the worst traders. I’m speaking from experience here. As an engineer who transitioned to trading, it wasn’t until I stopped thinking like an engineer that I started to make progress. You can read all about this in my case study, by the way.(...) Valuations Reflect U.S. Exceptionalism [Alpha Architect]Conventional wisdom can be defined as ideas that are so ingrained in our belief system that they go unchallenged. Unfortunately, much of the “conventional wisdom” about investing is wrong. One example of erroneous conventional wisdom is that investors seeking higher returns should invest in(...) Sequential Entropy Pooling [Anton Vorobets]Entropy Pooling is a core method of the next generation investment framework, thoroughly presented in the Portfolio Construction and Risk Management book1. As a very oversimplified introduction to Entropy Pooling, you can think about it as a generalization of the Black-Litterman model without all(...) How to evaluate leading indicators [Unravel Markets]I started this Substack, as I found close to zero investment research material that I’d consider rigorous-enough “predictive analytics” — also the reason why I co-founded Unravel. What I rather see a lot is: the price of the asset, and another metric plotted on the same chart, with someone(...) Volatility Risk Premium: The Growing Importance of Overnight and Intraday Dynamics [Relative Value Arbitrage]The breakdown of the volatility risk premium into overnight and intraday sessions is an active and emerging area of research. It holds not only academic interest but also practical implications. ETF issuers are launching new ETFs to capitalize on the overnight risk premium, and the shift toward(...) Using Inflation Data for Systematic Gold and Treasury Investment Strategies [Quantpedia]Inflation significantly impacts the prices of gold and treasury bonds through various mechanisms. Gold is often viewed as a hedge against inflation, while treasury bonds exhibit a more complex relationship influenced by interest rates and investor behavior. This relationship between inflation, gold,(...) Time- and State-Dependent Resampling [Anton Vorobets]Generating realistic future paths for investment market time series is crucial for risk management, good backtesting1, fully general stress-testing2, and CVaR tail risk optimization, see the Portfolio Construction and Risk Management book3. The recent Time- and State-Dependent Resampling article4(...) Rob Carver - The Comprehensive Guide to a Diversified Futures Strategy [Algorithmic Advantage]In this episode, seasoned trader Rob Carver shared his nuanced approach to building and managing a diversified futures portfolio—a methodology that appeals to advanced, technical traders, while we also covered off some of the 'basics' of futures trading, such as rolling, back-adjusting,(...) Exploring Credit Risk: Its Influence on Equity Strategies and Risk Management [Relative Value Arbitrage]Credit risk, also known as default risk, is the likelihood of loss when a borrower or counterparty fails to meet its obligations. A lot of research has been conducted on credit risk, and an emerging line of study explores the connection between the equity and credit markets. In this post, we’ll(...) Dangers of Relying on OHLC Prices – the Case of Overnight Drift in GDX ETF [Quantpedia]Can we truly rely on the opening price in OHLC data for backtesting? While the overnight drift effect is well-documented in a lot of asset classes, we investigated its presence in gold using the GLD ETF and then extended our analysis to the GDX – Gold Miners ETF, where we observed an unusually(...)