<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Amit Tomar on Medium]]></title>
        <description><![CDATA[Stories by Amit Tomar on Medium]]></description>
        <link>https://medium.com/@amit.943c?source=rss-d5405c2f53a8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*JmqM_i1BXeGziUhK</url>
            <title>Stories by Amit Tomar on Medium</title>
            <link>https://medium.com/@amit.943c?source=rss-d5405c2f53a8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 05:15:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amit.943c/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Hidden Decay of Trading Signals: Why Equity Curves Break Too Late]]></title>
            <link>https://medium.com/@amit.943c/the-hidden-decay-of-trading-signals-why-equity-curves-break-too-late-af79a5373e04?source=rss-d5405c2f53a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/af79a5373e04</guid>
            <category><![CDATA[quantitative-finance]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[factor-investing]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Amit Tomar]]></dc:creator>
            <pubDate>Fri, 01 May 2026 23:54:02 GMT</pubDate>
            <atom:updated>2026-05-01T23:54:02.941Z</atom:updated>
            <content:encoded><![CDATA[<p>The fastest-decaying signal in this study died in 2.4 trading days. The most persistent lasted 70.9 days. That’s a 30x difference in how long signals remain usable, measured on the same universe, over the same period. The implication is simple: if your rebalance frequency is slower than a signal’s decay rate, you are trading expired information. This study measures that decay directly, and shows why persistence and profitability are not the same thing.</p><p>What surprised me wasn’t the range. It was what happened next: the most persistent signal had a backtest Sharpe of -0.03. Its rankings were exceptionally stable. Its alpha was not. The factor with the third-longest half-life, trend (distance from 200-day MA, 48.7 days), was the only one that made money in a way that was both statistically and economically meaningful.</p><p>Persistence is not profitability. That distinction, once you see it in the data, changes how you evaluate every factor strategy.</p><p>This post walks through the experiment, what the results look like, and what I think it means for how people evaluate factor backtests. The code is open-source if you want to run it yourself.</p><h3>What I Built</h3><p>The pipeline goes: data fetch, factor computation, IC analysis, half-life estimation, stability metrics, regime classification, backtest, charts, reports. Each piece is a separate module. All parameters live in a YAML config file.</p><p>The setup:</p><ul><li>51 diversified large-cap US equities across sectors (tech, financials, healthcare, energy, industrials, consumer, communications)</li><li>Daily data from January 2015 to December 2024, roughly 2,500 trading days, sourced from Yahoo Finance</li><li>6 factors: momentum (3-month, 12-month trailing return), trend (distance from 200-day MA), reversal (5-day), realized volatility (63-day, low-vol preference), liquidity (20-day average dollar volume)</li><li>6 forward return horizons: 1, 5, 10, 21, 42, 63 days</li><li>Monthly rebalance, long top-10 / short bottom-10, equal weight</li><li>Transaction costs: 10 bps per trade plus 5 bps slippage</li><li>Signal-date and trade-date separation enforced throughout, no lookahead bias, verified by 30 unit tests</li></ul><p>Half-life estimation uses three independent methods: autocorrelation decay of factor ranks (AR(1) mean-reversion model), IC decay across forward horizons with per-day normalization, and quantile spread decay. The autocorrelation method was the most reliable across all factors (R² &gt; 0.94), so the numbers in this post use that method unless stated otherwise.</p><p>All factors are price-based. No fundamental data, no point-in-time accounting databases. The universe uses today’s constituents applied retroactively, which introduces survivorship bias. I’ll discuss the implications later. The key point for now: relative comparisons across factors are more robust than absolute return numbers.</p><h3>The Dashboard</h3><p>Here’s the four-panel summary that the pipeline generates:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GyuxrpBAxWZKhMBetH94Q.png" /><figcaption>Top-left: rolling IC tracks each factor’s predictive power over time. Top-right: half-life bars rank signal persistence. Bottom-left: cumulative quantile spread captures long-term factor value. Bottom-right: rolling Sharpe shows whether the strategy is actually making money.</figcaption></figure><p>The value of putting these on one page is that you can see when the metrics agree and when they diverge. A factor can have a stable half-life, a rising cumulative spread, and a deteriorating rolling Sharpe all at the same time. That’s where the interesting questions start.</p><h3>The Half-Life Results</h3><p>Before the numbers, a quick note on what each column measures, because the interesting finding is precisely that these metrics disagree.</p><p><strong>Half-life</strong> is how long it takes for today’s cross-sectional factor rankings to lose half their persistence. Measured via rank autocorrelation. This tells you how stable the signal is, not how predictive it is.</p><p><strong>Mean IC</strong> is the Spearman rank correlation between today’s factor score and the next day’s forward return. This tells you how predictive the signal is on average, but nothing about whether that predictiveness is consistent over time.</p><p><strong>Sharpe</strong> is the annualized risk-adjusted return of the long-short strategy after transaction costs. This is the bottom line, but it’s a backward-looking average that can hide when the strategy actually worked and when it stopped.</p><p>These metrics can point in very different directions for the same factor. That’s where the insight lives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CqHOA9nqR21qMZ8LHeQdlQ.png" /></figure><p>Half-life from the autocorrelation method, all R² &gt; 0.94. Mean IC is Spearman rank correlation with 1-day forward returns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sLfOTYtG9QyTdTrbMCkMiw.png" /></figure><p>Momentum 12M’s rankings persist for roughly 3.4 months. 5-day reversal is statistically dead in 2.4 days. The vertical reference lines at 21 and 63 days mark monthly and quarterly rebalance thresholds.</p><p>The most important row in this table is momentum 12M. It has the longest half-life, the third-highest rank persistence (0.883), and a Sharpe of -0.03. Once a stock enters the top momentum decile, it tends to stay there for months. But that stability doesn’t translate into returns. The rankings persist; the alpha embedded in those rankings does not.</p><p>Compare with trend (MA200): shorter half-life (48.7 days), lower persistence (0.822), but the only CAGR above 10% in the sample (+10.6%) and the only IC with a t-stat above 2 that actually produced positive returns (t = 2.30). Its half-life of 48.7 days means the signal retains roughly 74% of its original strength at the next monthly rebalance. That seems to be enough.</p><h3>Two Different Meanings of “Decay”</h3><p>When I first plotted IC as a function of forward return horizon, I expected every curve to slope downward. Longer horizons should dilute the signal, right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eJbkj_ceKyaVg4hO4NQlbw.png" /></figure><p>For some factors, the opposite happened. Momentum 3M’s IC rises from 0.009 at the 1-day horizon to 0.033 at 63 days. Trend shows a similar pattern: 0.014 at 1 day, 0.027 at 63 days.</p><p>This isn’t paradoxical once you separate two questions:</p><p>IC across horizons asks: how well does today’s factor score predict returns over the next N days? For trend-following signals, the answer improves with N because the trend needs time to play out.</p><p>Rank half-life asks: how long do today’s cross-sectional rankings remain stable? This can decline even when IC is rising across horizons, because the ordering of stocks drifts even as the directional prediction improves.</p><p>Momentum 12M shows the classic decay pattern: IC drops from 0.016 at 1 day to 0.003 at 63 days (t-stat falling from 2.55 to 0.45). The signal is strongest at the shortest horizon and fades. But its rank half-life is 70.9 days, the rankings themselves are sticky even as their information content erodes.</p><p>These are complementary diagnostics. Measuring only one gives an incomplete picture.</p><h3>The Rolling IC Chart</h3><p>Static IC averages hide the most useful information: when the signal was working and when it weakened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fEpATC3PgcB4R5z9IyAObw.png" /></figure><p>This is a 252-day rolling IC for each factor. Three things stand out:</p><p>First, momentum IC weakened notably in 2022–2023, coinciding with the growth-to-value rotation during the rate hiking cycle. It partially recovered in 2024 as mega-cap tech reasserted dominance.</p><p>Second, in this sample, IC deterioration appeared to precede equity curve breakdown by several months. You can see momentum’s rolling IC declining in mid-2021, roughly two quarters before the strategy’s equity curve rolled over. This isn’t a proven rule, it’s a pattern in one experiment, but it’s consistent with the idea that predictive power erodes before returns do. If you monitor one diagnostic, this seems like a useful candidate.</p><p>Third, all factors experienced synchronized IC compression during March 2020. Factor diversification weakened exactly during market stress. That’s a known structural feature of equity factors, but it’s worth seeing in your own data rather than just reading about it.</p><h3>The Regime Trap</h3><p>I classified every trading day into regimes using objective indicators: bull/bear (SMA-200 of SPY), high/low volatility (63-day realized), and crisis (SPY drawdown exceeding -20%).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UbWC6gBqhKk0K-e6AbvQqg.png" /></figure><p>The regime results contain what I consider the most thought-provoking finding in the dataset.</p><p>During 56 crisis days, reversal’s IC surged to +0.106, roughly 26x its overall mean of 0.004. That was the strongest IC reading for any factor in any regime.</p><p>But reversal’s rank half-life is 2.4 days. With monthly rebalancing (~21 trading days), approximately 8.75 half-lives elapse between trades. At that point, less than 0.3% of the original signal remains. Monthly rebalancing captures virtually none of the crisis-period predictive power.</p><p>Capturing that alpha would likely require daily or intraday execution, lower transaction costs than I modeled, and more granular data than daily OHLCV. Whether that’s feasible depends on infrastructure this study doesn’t test.</p><p>Meanwhile, momentum IC inverted to -0.059 during the same crisis days. A factor with modest positive IC in normal conditions can flip sign under stress, exactly when portfolio drawdowns concentrate. Any factor evaluation that relies only on unconditional averages risks hiding this kind of regime dependency.</p><h3>The Equity Curves</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XO681Jqie9Mc1etO5FGKRg.png" /></figure><p>These are log-scale equity curves for each factor strategy versus SPY from 2015 to 2024. A few things jump out:</p><p>Trend (MA200) is the only factor that tracked the benchmark while adding value: +10.6% CAGR, Sharpe 0.46, max drawdown -33.0%.</p><p>Volatility collapsed to roughly $0.12 on the dollar (total return -88.2%), with a max drawdown of -88.9% (CAGR -19.9%). This isn’t a broken signal per se. It reflects a decade where high-volatility technology stocks dominated returns. The low-vol thesis was structurally mismatched with the regime.</p><p>Momentum 12M accumulated gains from 2016 to 2021, then gave back most of them in a single year. The rolling IC chart shows the signal weakening months before the returns broke.</p><p>Liquidity presents an interesting puzzle: its 1-day IC is essentially zero (0.001, t-stat = 0.18), yet it returned +7.6% CAGR with a Sharpe of 0.35. Part of the explanation is that liquidity’s IC improves at longer horizons, reaching 0.018 at 63 days (t-stat = 3.72). The monthly-hold strategy captures that longer-horizon predictive power. The other part is that its ultra-low churn (1.1%/day) minimizes transaction cost drag, a meaningful advantage when gross alpha is small.</p><h3>Signal Churn</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ZYCQ9aAlxPvul_AoRsyiA.png" /></figure><p>Churn measures the fraction of the top-decile portfolio that changes each day. It’s a practical, observable metric that requires no forward returns to compute.</p><p>Liquidity churns 1.1% daily, the portfolio barely changes. Reversal churns 34.9%, meaning a third of the top decile turns over every day. In this sample, the higher-churn factors generally produced worse risk-adjusted returns, though with only six factors that’s suggestive rather than conclusive.</p><p>The practical value of churn is as a sanity check. If a signal churns more than a third of its holdings daily, you should be skeptical that a monthly rebalance can capture whatever information it contains.</p><h3>Rolling Sharpe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1-bGCILBP9yKfMyDYqKNZg.png" /></figure><p>This is the strategy-level view of what the rolling IC chart showed at the signal level. The rolling Sharpe makes the instability of factor returns visible in a way that full-period Sharpe cannot.</p><p>Volatility’s rolling Sharpe is negative for essentially the entire period. Reversal oscillates around zero. Trend is the most consistently positive, though even it dips into negative territory during 2022.</p><p>The gap between the rolling IC chart and the rolling Sharpe chart is also informative. A factor can have positive rolling IC but negative rolling Sharpe if costs eat more than the signal delivers, or if the portfolio construction doesn’t translate IC into returns efficiently.</p><h3>What I Think This Means</h3><p>I’ll frame these as observations from one experiment rather than universal rules. Six factors on 51 stocks over one decade is enough to see clear patterns, but not enough to claim generalizability.</p><p><strong>Half-life sets a floor on rebalance frequency.</strong> A signal with a 2.4-day half-life passes through roughly 9 full decay cycles between monthly rebalances. By the time you trade, the information is gone. Checking whether the half-life exceeds the intended rebalance period is a useful first filter for any signal you’re evaluating.</p><p><strong>High persistence doesn’t guarantee returns.</strong> Momentum 12M is the clearest example: 70.9-day half-life, 0.883 rank persistence, Sharpe of -0.03. Persistence tells you the rankings are sticky. It doesn’t tell you the rankings carry predictive content that survives costs and regime changes.</p><p><strong>Rolling IC is a useful monitoring tool.</strong> In this experiment, IC deterioration appeared to precede equity curve breakdown by several months for momentum and trend. Rolling IC is observable without forward returns and provides a lead-time signal that aggregate metrics hide.</p><p><strong>Regime-conditional IC can diverge sharply from the average.</strong> Reversal’s overall IC of 0.004 masks a crisis IC of 0.106 and a normal-period IC near zero. Any evaluation that relies only on unconditional averages risks hiding regime dependency that drives drawdowns.</p><p><strong>Churn is an underused diagnostic.</strong> It’s observable in real-time, requires no forward returns, and provides a rough filter on signal viability. In this sample, the factors with the lowest churn tended to have the best net Sharpe, largely because they traded less.</p><h3>Limitations</h3><p>The universe consists of today’s large-cap stocks applied retroactively. Companies that were delisted, acquired, or dropped from indices during 2015–2024 are absent. This inflates absolute IC and backtest returns, particularly for factors correlated with survival like momentum and liquidity. The relative ordering of half-lives across factors is less affected, but I can’t quantify the bias precisely.</p><p>51 stocks is a small universe. A full S&amp;P 500 or global equity run could produce different half-life estimates, especially for factors sensitive to market-cap coverage or sector composition.</p><p>All factors are price-based. No fundamental data, no earnings, no balance sheet metrics. Fundamental factors like value, quality, or earnings momentum may have very different decay characteristics. This study says nothing about them.</p><p>The transaction cost model is flat: 15 bps total per rebalance, no market impact, no variable spreads, no capacity constraints. For a 51-stock universe of liquid large-caps in small size, this is reasonable. It wouldn’t be realistic at institutional scale.</p><p>Monthly rebalancing structurally disadvantages fast-decaying signals. Reversal and momentum 3M might look different at daily or weekly frequency. The experiment tests these factors at a frequency that may not suit them, which is itself a finding, but worth being explicit about.</p><p>Yahoo Finance OHLCV data. No intraday data, no order book, no alternative data. If you ran this tomorrow, the adjusted prices might differ slightly due to retroactive adjustments. The pipeline caches data as parquet files for reproducibility.</p><p>Six factors, one market, one decade. I’m not claiming these decay rates generalize to other asset classes, time periods, or geographies.</p><h3>What I’d Do Next</h3><p><strong>Daily rebalance variant.</strong> The monthly frequency may be too slow for reversal and momentum 3M. Running the same analysis at daily frequency would show whether these signals are viable at a faster cadence or just noise at any frequency.</p><p><strong>Full S&amp;P 500 universe.</strong> 51 stocks is enough to see patterns, but the small universe limits confidence in the absolute numbers. A broader universe would also stress-test whether the churn and persistence results hold.</p><p><strong>Walk-forward half-life.</strong> The current half-life estimates are full-period. A rolling or expanding-window estimate would show whether half-lives themselves are stable or drift over time. If the decay rate is itself decaying, that’s a different problem.</p><p><strong>Fundamental factors.</strong> Value, quality, earnings momentum. These have different data requirements (point-in-time fundamentals) but are widely used in practice. Their decay characteristics would be worth comparing.</p><p><strong>Formal regime-timing model.</strong> The regime analysis here is descriptive. Building a model that conditions factor exposure on detected regime, and testing whether it improves out-of-sample, would be a natural next step.</p><h3>Wrapping Up</h3><p>The central finding is that factor signals decay at measurably different rates, and that the decay rate interacts with rebalance frequency, transaction costs, and market regime in ways that aggregate backtest statistics obscure.</p><p>Half-life doesn’t tell you whether a signal will make money. But it tells you whether your infrastructure has a chance of capturing the information before it expires. A signal with a 2-day half-life and a monthly rebalance is a structural mismatch, regardless of what the historical Sharpe says.</p><p>The most underused diagnostic in factor research might be the simple question: how long does today’s ranking stay informative?</p><p>The code is open-source and designed to be extended. You can change the universe, the factors, the rebalance frequency, and the cost model, and re-run the whole pipeline with one command.</p><p><em>Source code, charts, and research reports available on </em><a href="https://github.com/amit943c/factor-decay-lab"><em>GitHub</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af79a5373e04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Ran 1,000 Noisy Backtests to See How Bad Selection Bias Actually Gets]]></title>
            <link>https://medium.com/@amit.943c/i-ran-1-000-noisy-backtests-to-see-how-bad-selection-bias-actually-gets-9856dd5e635f?source=rss-d5405c2f53a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9856dd5e635f</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[quantitative-finance]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Amit Tomar]]></dc:creator>
            <pubDate>Sat, 25 Apr 2026 21:16:37 GMT</pubDate>
            <atom:updated>2026-04-25T21:16:37.949Z</atom:updated>
            <content:encoded><![CDATA[<p>I built a system that generates 1,000 candidate trading strategies, all of them built on noise, weak signals, or permuted data, and backtests every single one under the same disciplined framework. The point wasn’t to find a good strategy. It was to see what “good” looks like when it comes from randomness, and how easy it is to fool yourself by picking the best result from a large search.</p><p>The best strategy out of 1,000 came back with a Sharpe of 0.86 and a CAGR of 14.6%. Those are numbers that would get a second look at most shops. But the median information ratio versus SPY was -0.37, and every top in-sample performer degraded by more than half out of sample. The numbers are real. The alpha isn’t.</p><p>This post walks through the experiment, what I tested, what the results look like, and what I think it means for how people evaluate backtests. The code is open-source if you want to run it yourself.</p><h3>What I Built</h3><p>The pipeline goes: data fetch, signal generation, portfolio construction, backtest, analytics, charts. Each piece is a separate module. All the parameters, universe, date range, rebalance frequency, number of strategies, transaction costs, live in a YAML config file.</p><p>The setup for the main run:</p><ul><li>1,000 candidate strategies generated from four signal types: pure random (normal, uniform, rank), noisy factors (momentum + noise, mean-reversion + noise), permuted signals (shuffled ranks, shuffled assignments), and weak synthetic (tiny embedded signal buried in noise)</li><li>101 large-cap US equities from the S&amp;P 500 universe that passed data-quality filters</li><li>Daily data from 2010 to 2023, sourced from Yahoo Finance via yfinance</li><li>Weekly rebalance, top-30 equal-weight portfolios</li><li>Transaction costs at 10 bps per trade plus 5 bps slippage</li><li>In-sample period: 2010–2019. Out-of-sample: 2020–2023</li></ul><p>Every signal is fully traceable, seed, type, parameters, and timestamp are recorded. The whole run takes about nine minutes on a laptop and produces charts, CSV tables, and markdown reports automatically.</p><p>The key design choice: none of these signals are supposed to work. They’re noise, or signals with so little embedded information that they’re effectively noise. The experiment isn’t about finding edge, it’s about measuring what happens when you search for edge in a large pool of candidates and inevitably find something that looks like it.</p><h3>The Distribution</h3><p>Here’s the histogram of annualized Sharpe ratios across all 1,000 strategies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ycSbEKzIPQyv_FPQUkOWgA.png" /></figure><p>The median Sharpe was 0.671. The standard deviation was 0.057. The best came in at 0.862 and the worst at 0.498.</p><p>That median is not zero, and that confused me at first until I thought about it more carefully. These are long-only portfolios holding large-cap US equities over a period where the market returned roughly 13% annualized. Even if you pick stocks at random and equal-weight them, you capture market beta. The Sharpe of ~0.67 is mostly the market. The median information ratio versus SPY was -0.367, negative, which confirms that the absolute Sharpe is market exposure, not strategy skill.</p><p>73 out of 1,000 strategies, 7.3%, cleared a Sharpe of 0.75. Zero exceeded 1.0. That 0.75 to 0.86 band is what I’d call the danger zone: good enough to look plausible in a pitch deck, not extreme enough that someone would immediately call it suspicious.</p><p>Here’s the CAGR distribution for context:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jFn2nXTuS7BTUNVwYs9nUA.png" /></figure><p>Median CAGR of 10.8%, best at 14.6%. Again, most of this is the market. The CAGR histogram tells the same story as the Sharpe histogram, a tight distribution of noise-driven returns clustered around the market return.</p><p>And the drawdown distribution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fqWl4HWNWSaTy4_5Iz7mZA.png" /></figure><p>Median max drawdown of -37.4%. These portfolios all went through the COVID crash and the 2022 selloff with no hedging. The drawdowns are tightly clustered because every strategy holds 30 stocks from the same universe, diversification within the portfolio means they all look roughly similar in a broad selloff.</p><h3>The Best-of-N Problem</h3><p>This is the core result and the reason I built the project.</p><p>When you test N strategies and pick the winner, the expected Sharpe of the winner goes up mechanically with N. Not because you found something better, because you sampled more from the same distribution and the maximum of a larger sample is naturally higher. This is basic order statistics, but it’s surprisingly unintuitive when you’re the one staring at a promising equity curve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gQ8aLQOrqMzKbPQf9VGzzw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6uKUyakuTee76KxSt9FIgw.png" /></figure><p>These numbers come from seeded Monte Carlo resampling, 2,000 draws per N-level from the actual distribution of 1,000 strategy Sharpe ratios.</p><p>Test 10 ideas and the best one has a Sharpe around 0.75. Test 100 and it’s 0.81. Test 1,000 and you’re looking at 0.86. The underlying strategies didn’t get better. You just searched harder.</p><p>The shaded band in the chart shows the 5th-to-95th percentile range. Even at N=10, the lower bound is already 0.70, a respectable-looking number that came from pure noise.</p><p>I think this is the single most important chart in the project. If you take one thing away from this post, it should be that the number of strategies tested is a hidden variable that mechanically inflates whatever metric you’re selecting on.</p><h3>False Discovery Probabilities</h3><p>I also computed the probability that at least one strategy in a batch of N exceeds various Sharpe thresholds. This is done via Monte Carlo, draw N strategies at random from the 1,000, check if the max exceeds the threshold, repeat 2,000 times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DO9EkP6R3j5fi6Ug-pIGNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jGW2miBCKGbOrSSm1Hpdeg.png" /></figure><p>The &gt;0.75 row is the interesting one. Test 10 noisy strategies and you have a coin flip of finding one above 0.75. Test 50 and it’s 98.4%. Test 100 and it’s a certainty.</p><p>The &gt;1.0 row being all zeros tells you about the shape of the distribution, the noise distribution doesn’t have a fat enough right tail to produce Sharpe ratios above 1.0 in this setup. That’s actually a useful calibration point: if someone shows you a Sharpe above 1.0 from a long-only large-cap strategy over this period, it probably didn’t come from the noise distribution. Below 1.0 is harder to distinguish.</p><p>A note on terminology: I’m calling this “false discovery probability” in the informal sense, the probability that random search produces a result above a bar. This is not the same as a formal False Discovery Rate from White’s Reality Check or the Romano-Wolf step-down method, which are proper multiple-testing procedures with theoretical guarantees. What I’m computing is simpler and more intuitive, but it’s a less rigorous object.</p><h3>In-Sample vs. Out-of-Sample</h3><p>I split the data at December 2019 and ran every strategy separately on the in-sample period (2010–2019) and the out-of-sample period (2020–2023). Then I took the top 20 strategies ranked by in-sample Sharpe and looked at what happened to them out of sample.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_gLM-SyF1PohPY8rl4eZ-w.png" /></figure><p>Every single point is below the diagonal. Every one. The top 20 in-sample strategies averaged a Sharpe of 1.004 in-sample and 0.478 out-of-sample, a degradation of 0.526, or 52.4%.</p><p>The worst case was signal 576 (a noisy mean-reversion variant): 1.05 in-sample, 0.40 out-of-sample. That’s a 62% drop. The “best” OOS performer among the top-20 IS strategies was signal 989 (a weak synthetic signal): 1.02 IS, 0.66 OOS. Still a 35% degradation, and still below the full-period median.</p><p>Here are the equity curves side by side:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WlSbM0OY31x-ZbbPt5nlPA.png" /></figure><p>The left panel shows the in-sample period: smooth, upward-sloping curves that look like exactly what you’d want to see in a backtest. The right panel shows those same strategies out of sample: noisy, flat, divergent. The IS legends show Sharpe ratios of 1.02–1.05. The OOS legends show 0.40–0.66.</p><p>This is textbook overfitting to noise. The strategies that looked best in-sample were the ones that happened to be most aligned with the specific sequence of returns during that period. That alignment didn’t persist.</p><h3>Transaction Costs</h3><p>I ran every strategy with and without costs. The cost model is 10 bps per trade plus 5 bps slippage, applied to turnover at each rebalance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ol0ayWOdNT3nP1eTz154qg.png" /></figure><p>The left panel shows gross Sharpe vs. net Sharpe. Every point is below the diagonal, costs always hurt. The average Sharpe drag from costs was 0.303. That’s substantial: it’s roughly half the median net Sharpe.</p><p>The right panel shows average turnover vs. net CAGR. Turnover clusters between 65% and 71%, these are weekly-rebalanced portfolios with 30 positions, so you’d expect high turnover. The CAGR scatter shows that higher turnover doesn’t correlate with higher returns, which makes sense: these are noise strategies, so more frequent trading just generates more friction.</p><p>Average CAGR drag from costs: 6.05 percentage points. In a strategy with a median net CAGR of 10.8%, that means costs consumed roughly a third of gross returns.</p><h3>The Equity Curves</h3><p>Here are the top 5 strategies by full-period Sharpe, the median strategy, and SPY:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bNczmg9jHJLVdm7CIwk36A.png" /></figure><p>A few things stand out:</p><p>The top strategies and SPY move together. This isn’t surprising, they’re all long-only large-cap US equities, but it’s a good visual reminder that most of the return is market beta. The spread between strategies is the noise component.</p><p>The median strategy (dashed gray, Sharpe 0.67) tracks SPY closely but underperforms. That’s consistent with the negative median information ratio. Random stock-picking with transaction costs tends to slightly lag the benchmark.</p><p>The top-1 strategy (Sharpe 0.86) outperforms SPY noticeably, especially post-2020. But given that this is the best of 1,000 noise strategies, that outperformance is what you’d expect from order statistics. It’s the luckiest realization, not the most skilled one.</p><h3>What Worked</h3><p><strong>The best-of-N framing makes the abstract concrete.</strong> Selection bias is something people have heard of, but the table showing how the expected best Sharpe scales from 0.75 to 0.86 as you test more strategies lands differently than a paragraph about multiple testing. Numbers change minds in a way that theory doesn’t.</p><p><strong>The negative information ratio is a useful reality check.</strong> Absolute Sharpe in a long-only framework is dominated by beta. The fact that the median IR versus SPY is negative makes the point clearly: random selection doesn’t beat the market, even when the Sharpe looks respectable.</p><p><strong>Seeded reproducibility.</strong> Every number in this post can be regenerated by running one command. The Monte Carlo analyses use fixed seeds (123 for best-of-N, 456 for the heatmap), so the tables are deterministic.</p><h3>What Didn’t Work</h3><p><strong>The false discovery heatmap has too many zero rows.</strong> Because the noise distribution doesn’t produce Sharpe ratios above 1.0, the bottom four rows of the heatmap are all zeros. That’s accurate but not very informative. A better version would use finer thresholds in the 0.5–1.0 range where the actual variation is.</p><p><strong>Weekly rebalancing generates a lot of turnover.</strong> Average turnover of ~70% means most of the portfolio turns over every week. That’s realistic for the setup, but it means costs are high and it makes the cost drag harder to separate from the signal. Monthly rebalancing would give a cleaner experiment at the expense of fewer rebalances in the OOS period.</p><p><strong>The universe has survivorship bias.</strong> I’m using current S&amp;P 500 constituents, not historical membership. Stocks that were removed from the index between 2010 and 2023, often after a period of poor performance, aren’t in the sample. This biases all absolute return numbers upward by an amount I can’t easily quantify.</p><p><strong>The IS/OOS split is a single cut.</strong> December 2019 is a reasonable choice (right before COVID), but it means the OOS period includes one of the most volatile regimes in recent history. A different split date would give different degradation numbers. Walk-forward validation with multiple splits would be more robust.</p><h3>Key Takeaways</h3><ul><li>With 1,000 noise strategies, 73 clear a Sharpe of 0.75. That’s 7.3% of nothing producing something that looks like something. In a research process with hundreds of ideas, this is the base rate you’re working against.</li><li>The expected maximum Sharpe scales predictably with the number of strategies tested. This is just math, but it’s the kind of math that people forget when they’re excited about a backtest.</li><li>In-sample performance of the top strategies degraded by 52% out of sample. Every one of the top 20 degraded. This is the strongest evidence in the project that the in-sample winners are noise, not signal.</li><li>Transaction costs ate about 0.3 Sharpe points and 6 percentage points of CAGR. For noise strategies there’s no reason to expect costs to be offset by persistent returns, and they aren’t.</li><li>Absolute Sharpe in a long-only framework is mostly market beta. The median IR versus SPY is negative. If you’re evaluating a long-only backtest, ask for the information ratio, not just the Sharpe.</li></ul><h3>Limitations</h3><p><strong>Everything is in-sample in the meta sense.</strong> The IS/OOS split within the experiment is clean, but the choice of signal types, the universe, the cost model, and the rebalance frequency were all decisions I made by looking at how the system behaved. In a strict sense, the experiment design itself is fitted to the data.</p><p><strong>Yahoo Finance data isn’t frozen.</strong> yfinance pulls adjusted prices that can change retroactively. If you run this in six months, the exact numbers might differ slightly. For reproducibility, the pipeline caches data as parquet files.</p><p><strong>Long-only, large-cap only.</strong> The noise distribution would look different for market-neutral strategies, small-cap universes, or strategies with leverage. The magnitudes here are specific to this setup.</p><p><strong>Simple cost model.</strong> 15 bps total is reasonable for liquid large-caps in small size. It doesn’t account for market impact, capacity constraints, or the fact that transaction costs are higher during volatile periods, which is exactly when these strategies trade the most.</p><p><strong>The false discovery framing is informal.</strong> I’m computing empirical probabilities via Monte Carlo, not implementing formal multiple-testing corrections like White’s Reality Check or the BHY procedure. The heatmap is useful for intuition but shouldn’t be cited as a rigorous statistical test.</p><h3>What I’d Do Next</h3><p><strong>Walk-forward IS/OOS.</strong> Instead of a single split at 2019, use expanding or rolling windows. This would give confidence intervals on the degradation estimate rather than a single point.</p><p><strong>Finer heatmap thresholds.</strong> The 0.5/0.75/1.0 grid wastes most of its cells on zeros. Thresholds at 0.6/0.65/0.7/0.75/0.8/0.85 would show more useful variation.</p><p><strong>Market-neutral variant.</strong> Dollar-neutral long-short portfolios would remove the beta component and give a cleaner view of whether the noise strategies produce any excess return at all. My prior is that the distribution would center near zero with wider tails.</p><p><strong>Formal multiple-testing correction.</strong> Implementing White’s Reality Check or the StepM procedure would let me compare the empirical probabilities to a theoretical baseline and give the false discovery numbers more weight.</p><p><strong>Sector breakdown.</strong> I haven’t looked at whether the top strategies are concentrated in particular sectors or whether the noise is sector-neutral. Given that equal-weight top-30 portfolios will naturally overweight whatever sectors have the most stocks in the ranking, there’s probably a sector tilt embedded in the results.</p><h3>Wrapping Up</h3><p>The 0.86 Sharpe and 14.6% CAGR of the best strategy came from running 1,000 noise backtests and picking the winner. The numbers are correct given the assumptions, but what they demonstrate is the mechanics of selection bias, not the presence of skill.</p><p>The more useful output from this project wasn’t any individual strategy’s performance but the aggregate analysis around it: the best-of-N scaling table, the false discovery heatmap, the IS/OOS degradation scatter, and the cost impact chart. Those tell you something about the structure of the problem, which a single equity curve doesn’t.</p><p>The code is open-source and designed to be extended. You can change the number of strategies, the universe, the rebalance frequency, the cost model, or the signal types and re-run the whole pipeline with one command.</p><p><em>Source code, backtesting engine, all charts, and research reports available on </em><a href="https://github.com/amit943c/BacktestIllusionLab"><em>GitHub</em></a><em>.</em></p><p><strong>References</strong></p><ul><li>Harvey, Liu, and Zhu (2016). <em>…and the Cross-Section of Expected Returns.</em> Review of Financial Studies.</li><li>Bailey, Borwein, Lopez de Prado, and Zhu (2014). <em>Pseudo-Mathematics and Financial Charlatanism.</em> AMS Notices.</li><li>Lopez de Prado (2018). <em>Advances in Financial Machine Learning.</em> Wiley.</li><li>White (2000). <em>A Reality Check for Data Snooping.</em> Econometrica.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9856dd5e635f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-Factor Stock Ranking and Backtesting in Python — A Practical, Open-Source Framework]]></title>
            <link>https://medium.com/@amit.943c/multi-factor-stock-ranking-and-backtesting-in-python-a-practical-open-source-framework-7fe0f7d79029?source=rss-d5405c2f53a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fe0f7d79029</guid>
            <category><![CDATA[factor-investing]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[quantitative-finance]]></category>
            <dc:creator><![CDATA[Amit Tomar]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 23:49:36 GMT</pubDate>
            <atom:updated>2026-04-17T23:49:36.707Z</atom:updated>
            <content:encoded><![CDATA[<p>I built a system that ranks about 100 large-cap U.S. stocks every month using a composite factor score, picks the top 10, equal-weights them, and holds until the next rebalance. It runs on five years of daily data (2020–2025) from Yahoo Finance, benchmarked against SPY.</p><p>The backtest came back with a 301% total return and a 1.08 Sharpe. Good numbers on paper. But I spent a fair amount of time after that trying to figure out how much of the result I could actually trust, and the answer was less than I initially thought. A lot of the performance came from the market environment rather than clever factor selection, and several of the assumptions in the backtest are more generous than what you’d get in practice.</p><p>This post walks through the system — how it works, what the results look like, and where I think it’s strong and weak. The code is open-source if you want to run it yourself or build on it.</p><h3>What I Built</h3><p>The pipeline goes: data fetch, factor computation, composite scoring, portfolio construction, backtest, analytics. Each piece is a separate module. All the parameters — factor weights, rebalance frequency, transaction costs, universe — live in a YAML config file, so you can change anything without editing code.</p><p>It picks the top 10 stocks by composite rank, equal-weights them at 10% each, and rebalances monthly. Between rebalances it just lets the weights drift with daily returns. The output is 16 charts, two markdown reports, and a set of research diagnostics (factor IC, quantile returns, sensitivity sweeps, etc.).</p><p>I put time into keeping things modular because I wanted to be able to swap out a factor or change the rebalance frequency and just re-run the pipeline. That turned out to be important — I went through a lot of iterations on which factors to include.</p><h3>Factor Design</h3><p>Seven factor groups are implemented, but only three are turned on by default: momentum, trend, and liquidity.</p><p><strong>Momentum — 3-month return:</strong> 35% weight, higher is better <strong>Momentum — 6-month return:</strong> 20% weight, higher is better <strong>Momentum — 1-month return:</strong> 15% weight, higher is better <strong>Trend — Distance from 50-day MA:</strong> 15% weight, higher is better <strong>Trend — Distance from 200-day MA:</strong> 10% weight, higher is better <strong>Liquidity — Average dollar volume:</strong> 5% weight, higher is better</p><p>So 70% of the score is momentum and 25% is trend, which is basically a close relative of momentum. The liquidity piece at 5% is really just there to keep low-volume stocks out.</p><p>The other four groups — mean reversion (RSI-14), volatility (60-day realized vol), fundamentals (PE, EBITDA margin), and sentiment — are in the code but disabled. Here’s why:</p><p><strong>Mean reversion</strong> directly fights momentum. RSI-14 as a “lower is better” signal penalizes stocks for going up, while momentum rewards them for it. In a trending market, this just creates conflicting signals and hurts the composite score. I tried it on and the rankings got noisier without any improvement in returns.</p><p><strong>Volatility</strong> had a similar problem. Penalizing high-vol stocks sounds reasonable, but in this sample period the stocks with the strongest momentum were also the most volatile ones — semis, growth tech, biotech. Filtering them out removed exactly the stocks driving performance.</p><p><strong>Fundamentals</strong> I kept off because the data isn’t reliable enough. Yahoo Finance gives you a current snapshot of PE ratios and margins, not the values as they were reported at the time. That’s a lookahead bias problem you can’t really fix without paying for point-in-time data from something like Compustat or Sharadar.</p><p><strong>Sentiment</strong> is a placeholder — it literally generates random numbers. It’s there so the interface exists when someone wants to plug in a real signal, but it doesn’t do anything useful right now.</p><p>One thing worth noting: momentum and trend are pretty correlated. Stocks with strong 3-month returns tend to be well above their 50-day MA — it’s almost the same information expressed differently. So the effective factor diversification here is lower than the number of factors suggests. Trend mainly helps as a confirmation filter: it keeps out stocks that had a short-term spike but are still in a downtrend.</p><h3>Scoring and Ranking</h3><p>For each factor on each date, raw values get winsorized at the 1st/99th percentile, then cross-sectionally z-scored. “Lower is better” factors get their z-score flipped. Everything gets combined into a weighted sum, and stocks are ranked by that composite score.</p><p>The winsorization is important. Without it, one stock with an extreme 6-month return can distort the z-score distribution for the whole universe. At the 1st/99th level you’re clipping about 1 stock on each tail in a 100-name universe, which is enough to stabilize things without throwing away real signal.</p><p>One design issue: the weights get renormalized by the sum of active weights, so the 5% liquidity weight ends up having the same proportional influence regardless of total weight. I think liquidity should probably be a hard filter (exclude anything below a threshold) rather than a scoring input, but I haven’t changed it yet.</p><h3>Portfolio Construction and Cost Model</h3><p>On the last trading day of each month, the system re-ranks everything using data available up to that date, picks the top 10, and sets equal weights at 10% each. Between rebalances, positions just drift with price moves.</p><p>Costs are 10 bps for transaction costs and 5 bps for slippage, applied proportionally to turnover at each rebalance. So on a month with 50% turnover, you’re paying about 7.5 bps.</p><p>A few things about these assumptions that matter:</p><p>The model trades at the same close price it uses to compute signals. In practice you’d have at least a one-day delay — compute signals after the close, trade the next morning. For momentum strategies this gap works against you, since you’re buying stocks that just went up and the next open tends to be higher than the prior close. The 15 bps cost model doesn’t capture this.</p><p>Equal weighting 10 stocks at 10% each is fine for a small portfolio. At any real size, putting 10% into a single name creates market impact that the flat cost assumption can’t model.</p><p>I tested weekly vs. monthly rebalancing. Weekly didn’t help after costs — you get faster signal incorporation but roughly double the turnover, and the extra friction ate the benefit.</p><h3>Results</h3><p>Here’s what the default config produced over January 2020 to December 2025:</p><p><strong>Total Return:</strong> +301.3% <strong>CAGR:</strong> 26.6% <strong>Annualized Volatility:</strong> 24.7% <strong>Sharpe Ratio:</strong> 1.08 <strong>Sortino Ratio:</strong> 1.04 <strong>Max Drawdown:</strong> -27.4% <strong>Calmar Ratio:</strong> 0.97 <strong>Daily Win Rate:</strong> 55.8% <strong>Average Monthly Turnover:</strong> 47.8%</p><h3>Equity Curve</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t7wBZEBFrA9YGDpPI4woVw.png" /><figcaption>Portfolio vs SPY, Jan 2020–Dec 2025 (net of costs)</figcaption></figure><p>The model caught the post-COVID recovery well — April 2020 was +15.7%. It rode the 2020–2021 bull market, got hit during the 2022 selloff (drawdown of -20.6% bottoming in September 2022), ground through 2023, and then participated in the 2024–2025 rally. It beat SPY by a wide margin but was noticeably more volatile.</p><h3>Drawdowns</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cFuBKHqdv93NTh7Vh8fq5A.png" /><figcaption>Drawdown from peak over the full sample</figcaption></figure><p>Three main drawdowns:</p><p><strong>COVID (Feb–Jun 2020):</strong> -27.4%, 105 days, recovered in 74 days <strong>2022 bear (Dec 2021–Mar 2023):</strong> -20.6%, 446 days, recovered in 172 days <strong>2024–2025 correction:</strong> -20.3%, 434 days, recovered in 163 days</p><p>COVID was the worst but snapped back quickly. The 2022 drawdown was smaller in magnitude but took over a year to play out. That’s a common momentum problem — when leadership rotates (growth to value in 2022), the model’s backward-looking signals are slow to adjust.</p><h3>Rolling Sharpe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YcGCMOydvbX4pydzG6VErg.png" /><figcaption>6-month rolling Sharpe ratio</figcaption></figure><p>This chart is more useful than the headline Sharpe number. You can see periods where the rolling Sharpe is above 2.0 and others where it’s negative for months at a time. The strategy’s risk-adjusted performance depends heavily on the market regime.</p><h3>Monthly Returns</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FrDLH_Odrj2cfM8V3NOGJg.png" /><figcaption>Monthly returns by year</figcaption></figure><p>The best months were during recovery periods (April 2020 at +15.7%, November 2020 at +15.0%). The worst was January 2022 at -14.4%. Generally, the winning months were bigger than the losing months in absolute terms, which is a decent property for a long-only momentum strategy.</p><h3>Factor Correlations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgpVYO8Atw2w3_eTM0ntnA.png" /><figcaption>Pearson correlation across all factor signals</figcaption></figure><p>This confirmed what I expected — momentum and trend signals are highly correlated. 3-month return and distance-from-MA50 are basically measuring the same thing from different angles. The score is less diversified than it looks.</p><h3>Turnover</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*skJP_B1wk2nCtPEzT1kkJQ.png" /><figcaption>One-way turnover at each monthly rebalance</figcaption></figure><p>47.8% average monthly turnover means about half the portfolio changes each month. The spikes line up with regime shifts — when market leadership changes, the rankings shuffle and the model swaps out most of its holdings at once.</p><h3>Holdings</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n43HDg_XBJ_U5_lLtJDeaA.png" /><figcaption>Top-ranked stocks at the final rebalance (Dec 2025)</figcaption></figure><p>The last rebalance (December 2025) held MU, LRCX, GOOGL, LLY, REGN, MRK, AMD, CAT, KLAC, and USB. Four of ten are semiconductor stocks. That’s not really stock selection at that point — it’s a sector bet that fell out of the momentum signal. When semis are the strongest sector, the model loads up on semis.</p><h3>What Worked</h3><p><strong>Intermediate-term momentum was the main driver.</strong> The 3-month and 6-month return signals carried most of the performance. The factor IC for dist_ma50 came back at 0.85, which is very high — probably too high, honestly. It likely reflects the fact that in a trending market, stocks above their MA tend to keep going up, which is close to a tautology. But within this sample, the 3-month momentum signal at 35% weight gave the best cross-sectional separation.</p><p><strong>Turning off contradictory factors helped more than adding new ones.</strong> Removing mean reversion and volatility improved results more than any weight tuning I did. In a strong trend environment, signals that fight the trend just add noise.</p><p><strong>The liquidity filter at 5% kept the model out of trouble.</strong> In a large-cap universe the differentiation isn’t huge, but it occasionally excluded names where the cost assumptions would have been unrealistic.</p><h3>What Didn’t Work</h3><p><strong>Stocks near the ranking cutoff kept flipping in and out.</strong> The difference in composite score between rank 8 and rank 12 was often negligible, but the model treats the top-10 boundary as binary. This generated turnover that wasn’t justified by the signal strength. A holding buffer or minimum hold period would help.</p><p><strong>The sentiment factor is useless as-is.</strong> It generates random noise. It’s there as infrastructure for a real signal but it doesn’t contribute anything. If someone accidentally gave it positive weight, it would actively hurt.</p><p><strong>Costs add up more than the headline numbers show.</strong> At 15 bps per unit of turnover and ~48% average turnover, that’s roughly 86 bps per year lost to friction. In a bull market that’s manageable. In a flat or choppy market, it’s the kind of drag that turns a marginal strategy negative.</p><p><strong>No sector constraints means the portfolio gets concentrated.</strong> 4 out of 10 names in semiconductors at the last rebalance. That’s a momentum artifact — the model picks whatever sector is hottest. There’s no mechanism to control for this, and when that sector corrects, the portfolio takes a disproportionate hit.</p><p><strong>Survivorship bias is in the data.</strong> The 100-stock universe uses current S&amp;P 500 members, so every stock in the backtest survived to today. Stocks that got dropped from the index between 2020 and 2025 — often after momentum deteriorated — aren’t in the sample at all. That flatters the results.</p><h3>Key Takeaways</h3><ul><li>With 70% in momentum and 25% in trend, this is really a momentum model with a trend overlay, not a diversified multi-factor model. The Sharpe ratio reflects that.</li><li>The difference between rank 10 and rank 15 is usually noise, but the portfolio treats it as a hard cutoff. This creates unnecessary turnover.</li><li>Weekly rebalancing didn’t help after costs. The signal improvement wasn’t enough to offset the extra trading.</li><li>Transaction costs hit hardest during regime changes, which is exactly when the model is already struggling. Turnover spikes when rankings are unstable, and rankings are unstable when the market is rotating.</li><li>A 0.85 IC on a trend signal is suspicious. It’s probably telling you that trending stocks keep trending, which is true but not very deep. I’d want to see that hold up out-of-sample before putting much weight on it.</li><li>Choosing to disable mean reversion and volatility was based on this sample period. In a different market — say range-bound with high dispersion — those might be the signals that work. That decision is its own form of overfitting.</li></ul><h3>Limitations</h3><p><strong>Everything here is in-sample.</strong> There’s no walk-forward validation. I didn’t use an optimizer for factor weights, but the choice of which factors to enable was still informed by looking at the full dataset.</p><p><strong>Trades execute at the close price used for signal computation.</strong> A one-day delay would be more realistic and would cost you, especially with momentum signals where next-day opens tend to gap against you.</p><p><strong>The cost model is flat.</strong> 15 bps per unit of turnover is reasonable for liquid large-caps in small size. It doesn’t hold for larger portfolios.</p><p><strong>Fundamental data isn’t point-in-time.</strong> The fundamental factor is disabled, but it’s there and someone could turn it on without realizing the data has lookahead issues.</p><p><strong>Long-only, no hedging.</strong> In a selloff, you’re fully exposed. The -27.4% COVID drawdown is what that looks like.</p><h3>What I’d Do Next</h3><p><strong>Walk-forward testing.</strong> Split the data into expanding windows, re-estimate weights on the training portion, evaluate on the out-of-sample portion. This is the most important improvement.</p><p><strong>IC decay analysis.</strong> Measure how quickly the signal’s predictive power drops off at 1-day, 1-week, and 1-month horizons. That would give a better answer to the rebalancing frequency question than the current sensitivity sweep.</p><p><strong>Sector neutralization.</strong> There’s already a FactorNeutralizer in the codebase that demeans scores within sectors, but it’s not connected to the main pipeline. Turning it on would reduce the sector concentration problem.</p><p><strong>Real sentiment data.</strong> Replace the random noise with FinBERT on financial news or earnings call transcripts. That would be a genuinely different signal from the price-based factors.</p><p><strong>No-trade buffer.</strong> Instead of hard rebalancing on a schedule, only trade when the expected score improvement exceeds the cost. This would directly address the ranking instability issue.</p><p><strong>Volatility-based sizing.</strong> Equal weighting ignores the fact that some holdings are 3x as volatile as others. Inverse-vol or min-variance weighting would improve risk-adjusted returns without needing better signals.</p><h3>Wrapping Up</h3><p>The 301% return and 1.08 Sharpe came from running a concentrated momentum strategy during a period that was mostly favorable for momentum. The numbers are correct given the assumptions, but the assumptions are generous — no trade delay, flat costs, survivorship-biased universe, in-sample factor selection.</p><p>The more useful output from this project wasn’t the equity curve but the diagnostic tooling around it: factor IC, quantile returns, turnover decomposition, regime-conditional performance. Those tell you something about whether the signal is real and where it breaks down, which the equity curve alone doesn’t.</p><p>The code is open-source and designed to be extended. If you want to plug in your own factors, change the rebalance frequency, or run the Streamlit dashboard to poke around the results interactively, the repo is set up for that.</p><p><em>Source code, backtesting engine, research diagnostics, and interactive dashboard available on </em><a href="https://github.com/amit943c/MultiFactorStockRS"><em>GitHub</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fe0f7d79029" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>