<?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 Nishaanth Sivakumar on Medium]]></title>
        <description><![CDATA[Stories by Nishaanth Sivakumar on Medium]]></description>
        <link>https://medium.com/@nishaanth.sivakumar?source=rss-40050eb1e09b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*yuc4-AdyQWbKobUe</url>
            <title>Stories by Nishaanth Sivakumar on Medium</title>
            <link>https://medium.com/@nishaanth.sivakumar?source=rss-40050eb1e09b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 08:44:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nishaanth.sivakumar/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 Momentum Factor Has Worked for Thirty Years. Mine Lost 95%.]]></title>
            <link>https://medium.com/@nishaanth.sivakumar/the-momentum-factor-has-worked-for-thirty-years-mine-lost-95-3b10133f7fc9?source=rss-40050eb1e09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b10133f7fc9</guid>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[quantitative-finance]]></category>
            <dc:creator><![CDATA[Nishaanth Sivakumar]]></dc:creator>
            <pubDate>Sun, 16 Aug 2026 06:34:25 GMT</pubDate>
            <atom:updated>2026-08-16T06:34:25.890Z</atom:updated>
            <content:encoded><![CDATA[<h4>The most documented anomaly in finance, tested on 137 large caps across 25 years. It ran backwards — and the reason had nothing to do with momentum. Week 10 of 10.</h4><p>This is week ten of ten. I’ve been building one quantitative trading strategy a week — implementing it in Python, backtesting it on real data, and publishing the result whether it worked or not. Nine of those weeks are already up. Two of them made money on a risk-adjusted basis. This one did not, and the way it failed is more interesting than the failure.</p><h4>Why I saved this one for last</h4><p>Cross-sectional momentum is the closest thing academic finance has to a settled result.</p><p>The rule is simple. Every month, rank a universe of stocks by how they performed over the previous twelve months, skipping the most recent one. Buy the top decile. Short the bottom decile. Hold for a month. Repeat. Jegadeesh and Titman published it in 1993 and it has been replicated across decades, asset classes and continents since.</p><p>For nine weeks I’d been testing strategies I half-expected to fail. Moving average crossovers. RSI mean reversion. Day-of-week effects. A random forest. I went into each one knowing the honest prior was “probably nothing.” Momentum was different. This was the one where the literature was on my side, and I’d deliberately left it until last so the series could end on a strategy with a real chance.</p><p>My setup was deliberately simple: 137 large-cap US stocks, monthly rebalance, equal weight within each leg, roughly 13 names on each side, ten basis points on every dollar traded, tested from March 2000 to December 2024. No parameter tuning. Textbook defaults, fixed before I ran anything, which has been the rule all series.</p><h4>The result</h4><p>Momentum returned <strong>−11.70% a year</strong>. SPY returned <strong>+7.97%</strong>. The equity curve loses 95% of its value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l7W1kSy4A6QhAFHIfOGfcQ.png" /></figure><p>The maximum drawdown is −94.95%, which in practice means the strategy would have been shut down somewhere around 2003 and nobody would have been around to see the rest.</p><p>Transaction costs are not the story — gross of costs it still loses 10.35% a year, so trading friction accounts for about 1.3 points of the 11.7. Turnover was modest at 1.25 times the book per month, which makes sense: a twelve-month ranking barely changes from one month to the next.</p><p>Then I plotted the deciles and stopped.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uy_bllKr0-BZWy2BthfRkg.png" /></figure><p>That’s the mean next-month return for each momentum decile, from the worst past performers on the left to the best on the right. It descends almost perfectly. The stocks with the <em>weakest</em> twelve-month momentum returned 1.60% the following month. The strongest returned 1.00%. The Spearman correlation between decile rank and forward return is −0.94.</p><p>That is not a weak result. That is the textbook result, rotated 180 degrees.</p><p>My first assumption was that I’d inverted a sign. I went back and rewrote the ranking logic from scratch in a separate file, without looking at the original, and ran it against the same cached prices. Same answer: winners minus losers, −0.57% per month.</p><p>So the code was right. Which left the harder question.</p><h4>The number that stopped me publishing it as a finding</h4><p>Monthly spread: −0.57%. Standard error on 298 months: <strong>t = −1.26.</strong></p><p>That’s not significant. It isn’t close. If I drop 2009, the spread falls to −0.25% and the t-statistic to −0.58. If I look only at 2010 through 2024, the spread is <em>positive</em> — +0.10% a month, t = +0.24.</p><p>So I have a headline number that looks dramatic and a test statistic that says I’ve found nothing. Both are true, and the difference between them is exactly the sort of thing that gets glossed over in write-ups like this one. A −95% equity curve is a level statement. It says what happened to a dollar. It doesn’t say the underlying edge is real, and in this case the underlying edge — in either direction — isn’t distinguishable from zero.</p><p>The decile chart is genuinely striking, and it is also a picture of a slope with no error bars on it. Monotonicity is a satisfying number to report because it has no standard error attached. That’s precisely why it shouldn’t be trusted on its own.</p><h4>Where the money actually went</h4><p>Splitting the two legs apart makes the mechanism obvious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LpsT10lAr-LjJwqxb9hk5Q.png" /></figure><p>The long leg — buying past winners — compounded at 10.98% a year. Perfectly respectable. Slightly worse than just equal-weighting the whole universe, but nothing pathological.</p><p>The short leg lost 21.58% a year and is responsible for the entire result.</p><p>Two months do most of the damage. In November 2002 the basket of losers I was short returned <strong>+39.8%</strong>. In April 2009 it returned <strong>+33.6%</strong>. Those are the two worst months in the backtest by a wide margin.</p><p>Here’s what was in the April 2009 basket, with what each name did that month:</p><blockquote>American Express +88%. Prudential +52%. Aflac +49%. AIG +38%. Bank of America +31%. General Electric +25%.</blockquote><p>And November 2002:</p><blockquote>American Tower +176%. Corning +137%.</blockquote><p>Part of this is a real, documented phenomenon. Daniel and Moskowitz called them momentum crashes: after a severe bear market, the loser portfolio is stuffed with high-beta names that have been beaten down, and when the market turns they rip upward far faster than anything else. Being short that basket in March and April of 2009 was as painful as quantitative investing gets. That part isn’t a data artifact. It’s the actual risk profile of the strategy, and it’s why momentum has such vicious negative skew.</p><p>But the rest of it is my own data.</p><h4>The number I don’t trust in my own results</h4><p>The script also runs a control: fifty backtests that pick names at random each month instead of by momentum, with the same leg sizes. Momentum came out below all fifty, at the 0th percentile, z = −5.35.</p><p>That is the most dramatic statistic in the whole run, and I don’t think it means much.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35el3vdKv7CtFNhGKNDQaA.png" /></figure><p>Two problems. Random selection tears up the whole portfolio every month — 3.6 times the book, against 1.25 for momentum — and it holds thirteen uncorrelated names on each side, which produces 10.3% annualised volatility against momentum’s 27.1%. Higher volatility drags compound growth down independently of average returns: roughly 3.7 points a year for momentum, half a point for random. So around a third of the gap between them is arithmetic, not selection.</p><p>The second problem is subtler. All fifty seeds run on the same twenty-five years of prices. The spread between them measures how much the <em>choice of names</em> matters, holding history fixed. It says nothing about how much the history itself might have gone differently. A z-score built from that spread looks like a t-statistic and isn’t one. Mine reads −5.35; the actual t-statistic on the same strategy is −1.26.</p><p>I built that control myself, and it produced the most quotable number in the week. It’s still wrong to lean on it.</p><h4>Ten weeks</h4><p>Two of ten strategies beat their benchmark on a risk-adjusted basis — dual momentum in week four and the volatility risk premium in week six. Everything else lost, produced a null, or won on one dimension while losing on another.</p><p>I don’t think that ratio is a failure. Roughly, it’s what you’d expect from ten textbook strategies tested honestly, with costs, on out-of-sample data, without tuning anything after the fact. The interesting part was never the hit rate. It was that each loss failed differently, and the failures got progressively harder to diagnose.</p><p>Week one lost to whipsaw. Week seven lost because a model that beat a coin flip still couldn’t beat “buy and hold.” Week eight lost because a good variance forecast was bolted to a useless mean forecast, and I only knew that because I’d scored the two separately. Week nine found genuinely better pairs than random selection and then handed the entire benefit back through stop-outs. Week ten didn’t lose for any strategy reason I can defend — it lost because the data I could get for free can’t answer the question I was asking.</p><p>That last one is the least satisfying place to end a series, and probably the most honest. Nine weeks of writing about strategies that don’t work, and the tenth taught me that the harder skill isn’t finding the flaw in a strategy. It’s recognising when your data was never capable of testing it, and saying so instead of publishing the striking chart.</p><p>Code, results and full write-ups for all ten weeks are on <a href="https://github.com/NishaanthSivakumar/Quant-Strategies/tree/main">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b10133f7fc9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Found a Real Statistical Edge. It Made No Difference.]]></title>
            <link>https://medium.com/@nishaanth.sivakumar/i-found-a-real-statistical-edge-it-made-no-difference-90e174cdef06?source=rss-40050eb1e09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/90e174cdef06</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[quantitative-finance]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[Nishaanth Sivakumar]]></dc:creator>
            <pubDate>Mon, 10 Aug 2026 14:50:26 GMT</pubDate>
            <atom:updated>2026-08-10T14:50:26.767Z</atom:updated>
            <content:encoded><![CDATA[<h4>Week 9 of 10: cointegration, pairs trading, and the gap between a signal working and a strategy working</h4><p>For eight weeks I have been asking models to predict things. Week 7 asked a Random Forest to predict tomorrow’s direction and it came in below the base rate. Week 8 asked ARIMA to do the same and it came in below zero. Both weeks the answer was some version of: daily equity returns are close to a martingale, stop trying.</p><p>So this week I stopped trying. Pairs trading doesn’t forecast anything. It bets that a <em>relationship</em> holds — that two assets which have moved together will keep moving together, and that when the gap between them widens unusually, it will close.</p><p>The strategy lost 17.31% over fourteen years while SPY returned 681%.</p><p>That headline is not the interesting part. The interesting part is that the cointegration filter — the thing this strategy is actually about — demonstrably worked. It found spreads that reverted more often than randomly chosen ones, by a margin large enough to be statistically real. And it made no difference whatsoever to the money.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-EM6jqHUm4cmGkNU10cK5A.png" /></figure><p>That chart is the whole week. The fifty grey paths are the strategy run with pairs picked at random from the same universe. The blue line is pairs picked by cointegration p-value. It runs straight through the middle of the noise for fourteen years.</p><h4>The setup</h4><p>Twenty US-listed ETFs, chosen in advance for plausible economic linkage: energy and oil services, precious metals and miners, country funds, US sector funds. Every 63 trading days, the strategy looks back over the previous 252 days and tests all 190 possible pairs for cointegration using the Engle-Granger procedure. It keeps the five with the lowest p-values below 0.05, estimates a hedge ratio by regression, and records the spread’s mean and standard deviation.</p><p>Then it trades the next 63 days out of sample. When the spread moves two standard deviations from its mean, it shorts the expensive leg and buys the cheap one. It exits at half a standard deviation, stops out at four, and liquidates everything at the end of the block because the hedge ratios get re-estimated.</p><p>Every threshold is a textbook default. Nothing was tuned. Costs are 10 basis points on turnover, same as the rest of the series.</p><p>The market-neutrality worked exactly as advertised: beta to SPY of 0.020, correlation of 0.099. Whatever went wrong, it wasn’t hidden market exposure.</p><h4>The screening problem</h4><p>Here is something worth sitting with before looking at any returns.</p><p>The strategy tests 190 pairs per block and keeps those with p-values below 0.05. Under a null hypothesis where <em>nothing in the universe is cointegrated at all</em>, roughly 9.5 pairs clear that bar by chance. The book fills every single block whether or not a single real relationship exists.</p><p>So I compared the p-values the strategy actually selected against what pure noise would produce. If you draw 190 random p-values from a uniform distribution, the <em>k</em>-th smallest has an expected value of <em>k</em>/191.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*qnFyzuG0wgRcUnw-A5vDgQ.png" /></figure><p>Slightly better than noise. Not much.</p><p>And the spreads do not survive out of sample. Testing each selected spread for stationarity on a 252-day forward window, only 5.36% reject a unit root — which is the test’s own nominal size, indistinguishable from never rejecting at all. The mean out-of-sample p-value is 0.47.</p><p>I want to be careful here, because there is a trap. My first instinct was to test stationarity on the 63-day trading block itself, which is what you actually traded. But I simulated a genuinely stationary spread with an 11-day half-life and found the ADF test rejects only about 10% of the time at 63 observations, versus 61% at 252. A test that cannot detect the thing it is testing for is not evidence of absence. That’s why the reported figure uses the longer window, and why the block-level number is published but explicitly flagged as uninterpretable.</p><h4>Where it gets interesting</h4><p>Given all of that, you would expect cointegration selection to be worthless. It isn’t.</p><p>I ran the random-pair control fifty times rather than once, because a single seed can land anywhere and reporting one draw invites reading a sampling artifact as a result. That gave me a distribution to compare against — not just for returns, but for every trade statistic the backtest produces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*H9vDI80_ijhPex4luRW8Vg.png" /></figure><p>Read the first row carefully. Spreads chosen by cointegration converge back to their mean 30.7% of the time. Randomly chosen spreads converge 23.9% of the time. The gap is more than two standard deviations, and the strategy beats 47 of the 50 random draws on this measure. The filter is finding something real.</p><p>Now read the rest of the table. Those same spreads also stop out more than <em>every single</em> random draw — because a tight, fast-reverting spread breaches four standard deviations faster too. And they generate 27% more trades at 26% more turnover.</p><p>The bottom row is where it lands: average trade return of −0.16% against random’s −0.10%, a z-score of −0.20. Statistically indistinguishable. The edge went in at the top and came out the bottom as nothing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vH4QSws1WHIO_2aOd9snOw.png" /></figure><h4>Why it can’t pay</h4><p>The arithmetic was against this before a single trade was placed, and it has nothing to do with cointegration.</p><p>Entry at 2.0 standard deviations, exit at 0.5, stop at 4.0. A winning trade captures 1.5 standard deviations. A losing trade costs 2.0. Break-even therefore requires converging <strong>57.1%</strong> of the time.</p><p>The strategy converged 30.7% of the time. Random converged 23.9%. Both are so far below the bar that improving one to the other changes nothing that matters.</p><p>The mechanism behind the low convergence rate is the most useful number in the run. Spreads that mean-revert with a 6.5-day half-life during the formation window revert with a <strong>31.9-day</strong> half-life out of sample. That is not a small deterioration. With a maximum 63-day holding period, a 32-day half-life means most positions structurally cannot get back to 0.5 standard deviations before the block ends. Nearly 60% of selected spreads were also simply <em>wider</em> out of sample than in formation.</p><p>So: 38.5% stop out, 30.7% expire at block end, 30.7% converge. Expectancy of −0.16% per trade, 257 times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nme8dYrLQn3CDa5IiwxRoA.png" /></figure><p>That chart is one representative block. The spread enters above three standard deviations, drifts down over six weeks, touches zero, and climbs back to two without the position ever reaching an exit. It is a picture of a relationship that is loosely attracted to its mean and in no hurry about it.</p><h4>What I take from this</h4><p>Nine weeks in, the same shape keeps appearing.</p><p>Week 4 won on risk reduction, not return. Week 6 won on risk-adjusted terms while eating a 45.9% drawdown. Week 8 had a volatility forecast that beat its benchmark wired to a mean forecast that destroyed it. Week 9 has a pair selection method that beats random by two standard deviations, feeding a trading rule that needs a 57% hit rate and delivers 31%.</p><p>The pattern is that a working component is not a working strategy, and the aggregate number tells you almost nothing about which is which. Every week I have learned something, it has come from decomposing the result rather than reading it.</p><p>There is a version of this week where I move the stop from 4.0 to 6.0, watch the break-even rate drop to 40%, and publish something that looks much better. I would learn nothing from it, and neither would you. The thresholds stayed where they were.</p><p><em>One week left. Week 10 closes the series with cross-sectional momentum — ranking a universe on trailing returns and going long the winners, short the losers. It is the most heavily documented anomaly in academic finance and the only strategy in this series with a genuine prior in its favour. Code and results, as always, either way.</em></p><p><em>All code, data, and results can be found in my </em><a href="https://github.com/NishaanthSivakumar/Quant-Strategies/tree/main"><em>Github</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90e174cdef06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Model Was Right. The Strategy Still Lost 900 Percentage Points.]]></title>
            <link>https://medium.com/@nishaanth.sivakumar/the-model-was-right-the-strategy-still-lost-900-percentage-points-b9d5c4fb85af?source=rss-40050eb1e09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9d5c4fb85af</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[quantitative-finance]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[time-series-forecasting]]></category>
            <dc:creator><![CDATA[Nishaanth Sivakumar]]></dc:creator>
            <pubDate>Wed, 05 Aug 2026 03:56:51 GMT</pubDate>
            <atom:updated>2026-08-05T03:56:51.920Z</atom:updated>
            <content:encoded><![CDATA[<h4>Week 8 of 10: ARIMA and GARCH, or what happens when only half your model works</h4><p>Last week I threw a Random Forest at twenty years of SPY data and it lost to a strategy that consists of doing nothing. The write-up more or less ended with a shrug: machine learning is not magic on daily index data.</p><p>So this week I went back to the classical toolkit — ARIMA for the mean, GARCH for the variance. Older, simpler, better understood.</p><p>The result is the most interesting failure of the series so far. The strategy returned 109% against buy-and-hold’s 1,053%. It lost on Sharpe, on CAGR, on Calmar, on win rate. By any headline measure it was a rout.</p><p>And yet one half of the model worked exactly as the textbooks say it should. The problem is that it was the half that doesn’t decide when to trade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8mpcMM7ebuqhNbs4VjddQ.png" /></figure><h4>Splitting the question in two</h4><p>Here’s the thing about a return series: it has two moments worth forecasting, and the literature is unusually blunt about which one is forecastable.</p><p>The <strong>conditional mean</strong> — where will the price go tomorrow? Daily equity returns are close to a martingale. Decades of research say you cannot predict this. Week 7 was another data point in that graveyard.</p><p>The <strong>conditional variance</strong> — how much will it move tomorrow? This is a completely different question, and the answer is yes, quite well. Volatility clusters. Calm days follow calm days, violent days follow violent days. Engle won a Nobel Prize for formalising it and GARCH(1,1) remains a genuinely strong one-step-ahead variance forecaster forty years later.</p><p>So I built the week to test both separately. ARIMA(1,0,1) handles the mean. GARCH(1,1) fits to that ARIMA’s residuals and handles the variance. Then three trading modes:</p><ul><li><strong>mean</strong> — direction only. Long if the forecast is positive, cash otherwise.</li><li><strong>volatility target</strong> — size only. Always long, but weight = target vol / forecast vol.</li><li><strong>combo</strong> — both. Vol-target sizing, gated by the ARIMA’s direction call.</li></ul><p>Combo was the default. That decision turned out to be the entire story.</p><p>The mechanics are walk-forward: every 21 days, refit on the trailing 1,000 days, then <strong>freeze</strong> the parameters and filter them forward across the block. The model never re-estimates using the days it’s trading. Out-of-sample window: 2008–12–22 to 2026–07–30, 4,427 days, 211 refits, all converged.</p><h4>The mean model: worse than nothing</h4><p>I scored forecast quality separately from P&amp;L before looking at a single return figure. This is a discipline I’d recommend to anyone building these — it stops you from confusing a lucky strategy with a good model, and a good model with a profitable one.</p><p>The ARIMA’s out-of-sample R² against a zero-forecast came in at <strong>-0.00991</strong>.</p><p>Negative R² means something specific and brutal: a constant forecast of exactly zero would have been more accurate than the model. Twenty years of fitted autoregressive and moving-average terms, and the honest answer was to predict nothing at all.</p><p>Directional accuracy was 52.67%. Against a coin flip that’s a win. Against the number that actually matters — the 55.40% base rate of up days, i.e. what you’d get by always guessing “up” — it’s a loss. Second week running, same humiliation.</p><p>There’s a subtler failure hiding underneath. The model predicted “up” on <strong>74.76%</strong> of days against a 55.40% base rate. It’s not neutral and noisy; it’s biased long. The ARIMA constant is picking up the equity risk premium — real, persistent, and completely untradeable as a timing signal, because it’s the same information buy-and-hold already exploits by never selling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sDnfUoc_3Kc2VxWJPObIeQ.png" /></figure><p>Look at the left panel. That’s every forecast plotted against what actually happened. It’s a cloud. No slope, no structure, just a diffuse blob centred slightly to the right of zero. Twenty years of daily data compressed into a picture of nothing.</p><h4>The volatility model: it works</h4><p>Now the other half.</p><p>I scored the GARCH forecast against a naive benchmark — trailing 21-day realised volatility, the thing any practitioner would reach for if they didn’t want to fit a model. Two loss functions, both lower-is-better:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*dOg1TKdnMTHveoQ4vkxofQ.png" /></figure><p>GARCH wins on both. Correlation with next-day absolute return: 0.4638. Mean GARCH persistence (α + β) across the 211 refits: 0.9652, right where the literature says it should sit for equity indices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i57HZ-jwGkN8UoLSqpNi-Q.png" /></figure><p>The chart is the clearest evidence. The red line tracks the grey one through 2011, through the 2018 vol spike, through March 2020, through 2022. It anticipates rather than merely follows, which is exactly what the naive trailing measure can’t do.</p><p>One honest caveat: the forecast runs low. Mean forecast annualised vol was 15.88% against 17.79% realised. Part of that is the one-step horizon smoothing the tails, part of it is a variance clip I added to stop near-unit-root fits from collapsing the recursion toward zero. It’s well-calibrated in the middle of the distribution and conservative at the extremes.</p><p>So: the mean forecast is worthless, the variance forecast is good. Which leads to the question the whole week hinges on.</p><h4>Where did the money go?</h4><p>I decomposed the combo strategy into its components. All figures gross of costs unless stated, computed from the saved daily backtest — these are diagnostics, not separately backtested strategies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*S_0i-smPmtU0HPRmhDzw6A.png" /></figure><p>Read that table twice.</p><p><strong>Vol-target sizing beats buy-and-hold on a risk-adjusted basis.</strong> 1.005 against 0.867. Size your position inversely to a GARCH volatility forecast and you get a better Sharpe than owning the index outright, on a fraction of the turnover.</p><p><strong>The direction gate loses to buy-and-hold.</strong> 0.812 against 0.867. Adding the ARIMA’s opinion actively destroyed value.</p><p>And then costs. Gross Sharpe 0.917 collapses to net 0.422. Gross return of 445% becomes 106%. Cumulative trading costs: <strong>97.5%</strong> of starting capital, across 975 units of turnover and 1,109 switches.</p><p>Where does that turnover come from? The direction gate flips on <strong>25.0% of all days</strong>. One trading day in four, the ARIMA changes its mind and the entire position gets rebuilt. The vol-target weight drifts smoothly and I’d already added a 5-percentage-point rebalance band to stop it churning. The gate has no such smoothing — it’s binary and it’s noise.</p><p>So the mechanism is precise: the useless half of the model generated nearly all the turnover, and the turnover paid for a signal with negative predictive value. The half that worked was left carrying a passenger it couldn’t afford.</p><h4>What actually went right</h4><p>It’s worth being fair to the strategy on its own terms. Volatility came in at 11.24% against the benchmark’s 17.79%. Max drawdown was -19.87% against -33.72%. It cut exposure to an average of 0.462 through 2020 and beat the benchmark in 2018 (+2.30pp) and 2022 (+9.02pp) — the only two down years in the sample.</p><p>The risk control worked. It just cost far too much upside everywhere else: -28.35pp in 2009, -27.16pp in 2021, -25.81pp in 2023. The strategy’s worst drawdown ran 1,200 days from August 2021 to November 2024, which is less a drawdown than a sentence.</p><h4>One bug, found late</h4><p>A note on process, because I said at the start of this series that I’d publish the mistakes too.</p><p>My first run reported QLIKE as inf for both the GARCH and the naive model. Not a huge number — infinity. Twelve days in the sample closed at exactly zero return, making the squared-return proxy zero, and log(0) does what log(0) does.</p><p>One-line fix: filter the validity mask to strictly positive proxy values. It only touched the diagnostics, not the backtest. But it’s worth flagging that if I hadn’t scored the forecast separately and stared at the number, I’d have shipped a results file with inf in it and never noticed — because the P&amp;L was unaffected and the P&amp;L is what everyone looks at.</p><h4>The honest conclusion</h4><p>Run --mode voltarget and delete the ARIMA gate.</p><p>That’s it. That’s the week. The classical toolkit gave me one working component and one broken one, I wired them in series, and the broken one dominated. The correct response isn’t to conclude that ARIMA/GARCH fails on equity indices — it’s to notice that I asked the model to do two jobs and only fired it from one.</p><p>There’s a broader lesson I keep relearning in this series. Week 4 won on risk reduction, not returns. Week 6 won on risk-adjusted terms while still eating a -45.9% drawdown. Week 8 lost outright while containing a component that beat the benchmark. The headline number is almost never the finding.</p><p>Forecast quality and P&amp;L are different questions. Direction and sizing are different questions. Every week I collapse them, I learn less.</p><p><em>Two weeks left. Next up: cointegration and pairs trading — the first strategy in this series that doesn’t try to forecast anything at all, and instead bets on a relationship holding. Code and results, as always, either way.</em></p><p><em>All code, data, and results can be found in my </em><a href="https://github.com/NishaanthSivakumar/Quant-Strategies/tree/main"><em>Github</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9d5c4fb85af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Trained a Machine-Learning Model to Predict the Market. A Coin That Always Says “Up” Beat It.]]></title>
            <link>https://medium.com/@nishaanth.sivakumar/i-trained-a-machine-learning-model-to-predict-the-market-a-coin-that-always-says-up-beat-it-35af8a983c39?source=rss-40050eb1e09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/35af8a983c39</guid>
            <category><![CDATA[quantitative-finance]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Nishaanth Sivakumar]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 14:04:27 GMT</pubDate>
            <atom:updated>2026-07-26T14:04:27.256Z</atom:updated>
            <content:encoded><![CDATA[<h4>Week 7 of building 10 quant strategies from scratch. This is the one where the fancy tool loses to the dumbest possible baseline — and why that’s the most useful result so far.</h4><p>For six weeks I’d been testing strategies you can write on a napkin: moving-average crossovers, RSI thresholds, a volatility premium. Week 7 was supposed to be the step up into the “advanced” block — the point where I stop drawing lines on charts and let a machine-learning model find the patterns I can’t see.</p><p>That was the plan, anyway. What I got instead was the most quietly humiliating result of the series: a Random Forest, fed fifteen features and fifteen years of data, that predicted the direction of tomorrow’s market <em>worse</em> than a coin that mindlessly guesses “up” every single day.</p><p>Let me show you exactly how that happened, because the <em>way</em> it failed is more instructive than any of my winners.</p><h4>The setup</h4><p>The task was deliberately modest. Not “predict the price” — just predict the <strong>direction</strong>: will SPY close higher tomorrow than today, yes or no? A binary coin-flip of a question, and one that a decent edge on could, in principle, be very profitable.</p><p>I built fifteen features, all derived from plain OHLCV data and all strictly backward-looking: lagged returns over one to ten days, price relative to its 5-, 10- and 20-day moving averages, RSI, rolling realised volatility, a volume ratio, the daily high-low range, and medium-horizon momentum. Nothing exotic — this is the standard technical-analysis toolkit, handed to a model instead of a human.</p><p>The model was a Random Forest classifier, heavily regularised. Shallow trees, a large minimum leaf size, square-root feature sampling. Daily market data is almost all noise, and an unconstrained forest will happily memorise that noise and report 99% accuracy on data it’s already seen. The regularisation is there to stop it fooling itself. And me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x_fvtHGEKRQRp1XteYh-fA.png" /></figure><h4>The one thing I got right</h4><p>Before the result, the guardrail — because it’s the single most important line of code in the whole project.</p><p>The cardinal sin of machine learning on markets is <strong>look-ahead bias</strong>: letting the model peek, however subtly, at information from the future. It’s astonishingly easy to do by accident. Shuffle your data before splitting it into train and test sets — the default behaviour of almost every ML tutorial — and you’ve just let the model train on Thursdays to predict the Wednesdays sitting right beside them. Your backtest lights up. Your paper trading account does not.</p><p>So I split the data <strong>chronologically</strong>. Train on 2005 through early 2020. Test on everything after — February 2020 to today, roughly six and a half years the model never saw during training, COVID crash included. The model learns from the past and is graded only on its future. No shuffling, no peeking.</p><p>Here’s the tell that this worked: the result is <em>boring</em>. If I’d leaked future information, out-of-sample accuracy would have come back at 70%, 80%, and I’d have a strategy that looks like a money printer and evaporates the moment real money touches it. Instead I got 51.7%. A number that low is the sound of an honest backtest.</p><h4>The result</h4><p>Out of sample, the strategy went long when the model predicted “up” and sat in cash otherwise. Over six and a half years:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1pA-6H1_ghdKQQTpeH39w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*1l9W1HzpXzl29KGL46IkHg.png" /></figure><p>The strategy made money. In isolation, +38.6% doesn’t look like failure. But it kept pace with buy-and-hold only until 2022, then fell off and never recovered — you can watch it happen in the equity curve, the blue line flattening into a plateau while the market runs away above it.</p><p>And then there’s the number that reframes everything:</p><ul><li><strong>Directional accuracy: 51.7%.</strong></li><li><strong>Base rate — how often the market simply rose: 54.8%.</strong></li></ul><p>The model was right 51.7% of the time. A rock with “UP” written on it would have been right 54.8% of the time. My carefully-engineered, fifteen-year-trained Random Forest was beaten by the laziest baseline in existence, because in a market that mostly drifts upward, refusing to ever guess “down” is a genuinely hard benchmark to clear — and the model couldn’t clear it.</p><h4>Why it lost — and this is the good part</h4><p>A worse-than-baseline model that still makes money sounds contradictory. The confusion matrix explains it, and it’s the most quant-interview-relevant thing in the whole week.</p><p>The model went to cash 622 times over the test period. On 336 of those days — about 54% — the market went <em>up</em>. So more than half the time the model confidently told me to step aside, it was stepping aside from a gain. Its “get out” calls weren’t just weak; they were actively worse than a coin flip. Every exit was, on average, a small act of self-sabotage, and 622 of them compounded into that flat plateau on the equity curve.</p><p>That’s the mechanism. The model made money on its long calls, which were slightly better than chance, and then gave a chunk of it back every time it lost its nerve and sat out a rally.</p><p>It gets worse when you look at 2022 — the one genuine bear market in the test window, exactly the year a “smart” model that steps aside is supposed to earn its keep. The strategy lost <strong>20.8%</strong> that year. Buy-and-hold lost <strong>18.2%</strong>. It didn’t just fail to protect me; it protected me <em>worse than doing nothing</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hAWRw59N82YvVWmEPOSCUg.png" /></figure><p>The rolling-accuracy chart is the final nail, and the most honest picture in the post. It shows the model’s hit rate over a moving three-month window, and it looks like a heartbeat — swinging from 0.37 up to 0.70 and back, over and over, mean-reverting to a coin flip. There are stretches in 2021 and 2026 where the model looks like a genius. There are stretches in 2022 and 2024 where it looks broken. Neither is real. It’s noise oscillating around 50/50, and if I’d stopped my backtest at the end of one of the good stretches, I’d have written a very different, very wrong blog post.</p><p>The feature-importance chart tells the same story from another angle: the fifteen bars are almost the same height, clustered between 0.05 and 0.09. When a model can’t find a signal, it spreads its attention evenly across everything, because everything is equally useless. That flatness <em>is</em> the finding.</p><h4>The actual lesson</h4><p>The temptation now is to tune. More trees, different features, a longer horizon, a neural network instead of a forest. And maybe some combination nudges 51.7% to 53%. But the rolling-accuracy heartbeat is telling me the ceiling here is low and the floor is noise — and every knob I turn while staring at the test-set score is just a slower, more sophisticated way of overfitting to this particular six years.</p><p>The honest takeaway is the one the efficient-market people have been saying all along: the direction of a broad index tomorrow is close to unpredictable from its own recent price and volume. Not <em>literally</em> random — 51.7% isn’t 50.0% — but the edge is so thin that transaction costs and the market’s upward drift swallow it whole. Machine learning didn’t change that. It just gave me a more elaborate way to rediscover it, and a confusion matrix precise enough to show me exactly where the money leaked out.</p><p>That’s worth more to me than a lucky winner would have been. “I built an ML strategy and it beat the market” is a sentence that should make any quant interviewer reach for the follow-up questions. “I built an ML strategy, it lost to the base rate, and here’s the confusion matrix showing why its exit calls were worse than a coin flip” is a sentence that answers them.</p><h4>Next week</h4><p>Week 8 leaves classification behind for <strong>time-series forecasting</strong> — ARIMA and GARCH. If this week’s lesson is that predicting <em>direction</em> is near-hopeless, next week asks a subtler question: can we at least predict <em>volatility</em>? Because unlike returns, volatility clusters — calm follows calm, chaos follows chaos — and that persistence is one of the few things in this series that might actually be forecastable. We’ll see if the pattern holds up any better than the last one did.</p><p><em>All code, data, and the honest results — winners and losers — are on </em><a href="https://github.com/NishaanthSivakumar/Quant-Strategies/tree/main"><em>GitHub</em></a><em>. If you spot a methodological hole, open an issue. Finding them is the entire point.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35af8a983c39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Sold Volatility Insurance for 19 Years. The Premium Was Real. So Was the Claim.]]></title>
            <link>https://medium.com/@nishaanth.sivakumar/i-sold-volatility-insurance-for-19-years-the-premium-was-real-so-was-the-claim-f4e51bd97800?source=rss-40050eb1e09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4e51bd97800</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[quantitative-finance]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[Nishaanth Sivakumar]]></dc:creator>
            <pubDate>Sun, 12 Jul 2026 13:27:35 GMT</pubDate>
            <atom:updated>2026-07-12T13:27:35.180Z</atom:updated>
            <content:encoded><![CDATA[<h4>Week 6 of building 10 quant strategies in public. This week: the volatility risk premium — arguably the most consistent source of return in all of finance. I tested whether harvesting it works, and the answer is yes, with an asterisk the size of the 2008 financial crisis.</h4><p>Five weeks in, the scoreboard reads: two risk-adjusted wins (dual momentum and now this one), three losses (MA crossover, RSI mean reversion, calendar effect), and one famous anomaly that reversed on me (post-earnings drift). If you’ve been following along, you know the pattern by now — the interesting part is never “did it work?” but “why did it work the way it did?”</p><p>This week is the most interesting case yet.</p><h4>The idea</h4><p>Every day, the options market makes a prediction: how much will the S&amp;P 500 move over the next 30 days? That prediction is the VIX — the implied volatility baked into option prices.</p><p>And every day, reality produces an answer: how much did the S&amp;P 500 <em>actually</em> move? That’s realised volatility — the standard deviation of recent daily returns, annualised to match the VIX’s scale.</p><p>The volatility risk premium is the gap between the two. Implied minus realised. The market’s fear minus what actually happened.</p><p>The theory says this gap should be persistently positive, because investors are willing to overpay for downside protection. They’re buying insurance against crashes, and like all insurance, they pay more than the expected loss — otherwise no one would sell it. The seller of that insurance — the person on the other side of the trade — earns the premium.</p><p>Carr and Wu formalised this in 2009, but practitioners had been trading it for decades before that.</p><h4>What I tested</h4><p>The setup is simple. Every day, I compute:</p><p><strong>VRP = VIX − realised volatility (21-day rolling, annualised)</strong></p><p>When VRP is positive — implied vol exceeds realised, the premium exists — the strategy goes long SPY. When VRP flips negative — realised vol has spiked past implied, meaning a crash is underway — it steps to cash.</p><p>That’s it. One signal, one asset, binary position.</p><p>An important caveat upfront: this is a <em>proxy</em> backtest. I’m not actually selling straddles, shorting VIX futures, or writing variance swaps. I’m using equity exposure as a stand-in for being in the market when the vol premium is positive. A real vol-selling strategy would have leverage, margin calls, and convexity that this test doesn’t capture. I’m testing the <em>signal</em>, not the trade.</p><p>10 bps cost per switch. 2006 to 2024, roughly 19 years.</p><h4>The premium is real</h4><p>This is the clearest result in the series so far.</p><p>VIX overstated future realised volatility 84.5% of the time, by an average of 3.6 percentage points. The distribution is right-skewed in calm markets — the premium is steady and positive — with a vicious left tail when crashes send realised vol exploding past implied. The worst reading hit −48: during the Global Financial Crisis, realised vol was 48 points <em>higher</em> than what VIX had predicted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WgZrJQMdxB-hv1XyKYD2Hw.png" /></figure><p>Unlike the calendar effect (Week 3), which was noise, or PEAD (Week 5), which had decayed away, this is a premium with a clear economic reason to exist: investors are risk-averse and overpay for protection. That structural driver hasn’t gone away and probably won’t.</p><h4>The results</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*_6SeRw46g1ZKBcs6keDG3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eTFFvXJhgIXi9id6B5YM6w.png" /></figure><p>The strategy wins — on risk-adjusted terms. Lower volatility (−17%), shallower max drawdown (−9.3 percentage points), better Sharpe (+26%), and a small CAGR edge. The equity curves tell the story: they track each other closely in calm years, diverge during crises when the strategy steps aside, then converge again in the recovery.</p><p>This is the same pattern as Week 4’s dual momentum: the edge isn’t in making more money, it’s in losing less.</p><h4>But look at the drawdown</h4><p>Here’s the asterisk.</p><p>The strategy’s max drawdown was still −45.9%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ksoYGpFMtizxqBQhl6ka0Q.png" /></figure><p>That number should bother you — it bothered me. If the whole point is stepping to cash when volatility spikes, how do you still lose 46% of your peak value?</p><p>The answer is timing. The VRP signal is backward-looking by construction. Realised volatility is computed from <em>past</em> returns — a 21-day rolling window. By the time realised vol spikes past VIX, the crash has already started. The signal told me to leave the party after the fight had broken out.</p><p>In 2008, the strategy was only in the market 58.9% of the time — it <em>did</em> step aside — but not quickly enough to avoid the first leg of the Global Financial Crisis. It cut the drawdown from −55.2% to −45.9%. That’s meaningful, but it’s not the “I dodged the crash” narrative that short-vol marketing materials imply.</p><p>COVID was the better showcase. The vol spike was faster and more dramatic — realised vol went from normal to extreme in days, not months — and the signal turned more quickly. The strategy’s COVID drawdown was −20.6% vs buy-and-hold’s −33.7%.</p><h4>The year-by-year story</h4><p>The annual breakdown is where the trade-off becomes concrete:</p><p>The strategy earns its keep in bad years — 2008 (+14.3 pp vs benchmark), 2011 (+13.8 pp), 2020 (+9.8 pp), 2022 (+10.9 pp). These are the years where stepping aside matters.</p><p>It gives back ground in clean rallies — 2013 (−16.9 pp), 2019 (−18.1 pp), 2014 (−10.3 pp). These are the years where the signal jitters to cash during brief vol spikes that resolve quickly, and you miss the rally while waiting for VRP to stabilise.</p><p>In 2017 — the quietest year in recent memory — the signal never triggered a single exit. VRP was positive every trading day (average: 4.37). The strategy matched buy-and-hold exactly with zero switches. That’s the best year to be a vol seller: boring, persistent premium, no claims.</p><h4>What this actually teaches</h4><p>The volatility risk premium is the “selling insurance” strategy, and the metaphor is precise:</p><p>Insurance companies make money most years. Premiums exceed claims. The more years you sell, the more the law of large numbers works in your favour. But every so often, a hurricane hits, and you pay out more in a week than you collected in a decade. The question isn’t whether the expected value is positive — it is. The question is whether you survive the tail event with enough capital to keep selling.</p><p>This backtest’s −45.9% max drawdown is the answer for the equity-proxy version: you survive, but barely, and only if you have no leverage. A real short-vol strategy with 2x or 3x leverage — which is how many practitioners actually trade this — would have been margin-called out of existence in 2008.</p><p>That’s why the premium exists. It’s not free money that nobody noticed. It’s <em>compensation for risk</em> — specifically, for bearing the left tail. If it were easy to hold through the drawdowns, everyone would do it, and the premium would compress to zero. The fact that it hurts is the reason it persists.</p><h4>Limitations</h4><p>A few things I’d flag before anyone trades this:</p><p>This is a proxy, not reality. SPY long-or-cash is a pale imitation of actual vol selling. The convexity profile of short options or short VIX futures is meaningfully different — and worse in the tails.</p><p>Single lookback window. I used 21-day realised vol because it’s the textbook default and matches VIX’s 30-day horizon. A 10-day or 63-day window would change the signal timing. Consistent with the rest of the series, I didn’t sweep parameters.</p><p>The start date flatters the strategy. Opening in 2006 means the test includes the Global Financial Crisis — exactly the kind of event where a defensive strategy looks heroic. A 2010 start would show a narrower edge.</p><p>Cash earns nothing. In reality, sitting in T-bills during the off periods would add some return. That’s a small tailwind I’m not capturing.</p><p>Next week I’m testing something structurally different: an ML-based return predictor. A Random Forest trained on technical features (RSI, moving average ratios, volume z-scores), trying to predict whether tomorrow’s return is up or down.</p><p><em>The complete code, data, and methodology are available on </em><a href="https://github.com/NishaanthSivakumar/Quant-Strategies"><em>GitHub</em></a><em> as part of my ten-week series on systematically building and evaluating quantitative trading strategies. If you spot an issue I would genuinely appreciate your feedback. That’s one of the main reasons I’m publishing these experiments publicly.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4e51bd97800" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Most Bulletproof Anomaly in Finance Didn’t Survive Contact With Big Tech]]></title>
            <link>https://medium.com/@nishaanth.sivakumar/the-most-bulletproof-anomaly-in-finance-didnt-survive-contact-with-big-tech-2754d71adfac?source=rss-40050eb1e09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2754d71adfac</guid>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[quantitative-finance]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[Nishaanth Sivakumar]]></dc:creator>
            <pubDate>Sun, 05 Jul 2026 14:16:17 GMT</pubDate>
            <atom:updated>2026-07-05T14:16:17.081Z</atom:updated>
            <content:encoded><![CDATA[<h4>Week 5 of building and backtesting ten quantitative trading strategies in public.</h4><p>After four weeks, my scorecard wasn’t exactly encouraging.</p><p>A moving-average crossover strategy underperformed simply buying and holding the market. RSI mean reversion achieved an 83% win rate while still losing money. A day-of-the-week anomaly disappeared once I tested it properly. Only dual momentum delivered an edge — and even then, it came from reducing downside risk rather than generating spectacular returns.</p><p>So for Week 5, I picked what I thought would be the easiest strategy of the series.</p><p>Post-Earnings Announcement Drift (PEAD).</p><p>If there is one anomaly that has survived decades of academic scrutiny, it’s this one.</p><p>Unfortunately, my backtest had other ideas.</p><h4>The anomaly that’s supposed to work</h4><p>PEAD is one of the oldest and most widely documented market anomalies.</p><p>The intuition is straightforward. When a company reports earnings that are substantially better than analysts expected, investors do not fully incorporate the news immediately. Instead, prices continue drifting upward over the following weeks. Companies with negative earnings surprises experience the opposite effect.</p><p>The phenomenon was first documented by Ball and Brown in 1968 and has since been replicated across markets, countries, and decades of data. Unlike many anomalies, researchers have struggled to explain it away as compensation for hidden risk.</p><p>It has become one of the textbook examples of market underreaction.</p><p>Naturally, I expected it to be one of the easier strategies to reproduce.</p><h4>Building the strategy</h4><p>For every earnings announcement between 2018 and 2024, I measured the earnings surprise by comparing reported EPS against analyst consensus, expressed as a fraction of the estimate. (A note for the purists: the classic academic measure standardises the surprise by the historical volatility of a company’s past surprises — true “standardised unexpected earnings.” I used the simpler ratio of surprise to estimate size, which is more sensitive to near-zero estimates. More on why that matters later.)</p><p>Each earnings event was then sorted into five quintiles:</p><ul><li>Quintile 1: largest negative surprises</li><li>Quintile 5: largest positive surprises</li></ul><p>The classic PEAD prediction is simple:</p><ul><li>Buy the biggest positive surprises.</li><li>Short the biggest negative surprises.</li><li>Hold for roughly one month.</li></ul><p>I tested only the long leg — buying the biggest positive surprises — rather than the full long-short spread. That turned out to matter, for a reason the data made embarrassingly clear later on.</p><p>To avoid introducing look-ahead bias, trades only entered the trading day after earnings were announced, since many companies report after market close.</p><p>Returns were measured over 20 trading days and tracked out to 60 days. Every return was adjusted by subtracting the equal-weight return of the investment universe over the same period, allowing me to measure abnormal performance rather than a rising market.</p><p>Transaction costs of 10 basis points per trade were included throughout.</p><p>The universe consisted of fifteen US mega-cap companies — including Apple, Microsoft, Nvidia, Amazon and JPMorgan — producing 252 earnings events.</p><p>As it turned out, that universe choice ended up determining the entire result.</p><h4>What the data showed</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hWUHgn9u7GxG3nkzNzmfCA.png" /></figure><p>The expected picture is a clean fan-shaped pattern.</p><p>The stocks with the largest positive surprises should steadily outperform, while the biggest disappointments should continue drifting lower.</p><p>That isn’t what happened.</p><p>During roughly the first twenty trading days, there was only the faintest hint of the expected relationship. Stocks with stronger earnings surprises performed slightly less badly than those with weaker surprises.</p><p>By Day 20:</p><ul><li>Quintile 5: −0.12%</li><li>Quintile 4: −0.38%</li><li>Quintiles 1–3: roughly −1.1%</li></ul><p>The ordering looked vaguely consistent with PEAD.</p><p>The returns did not.</p><p>Every single quintile produced negative market-adjusted performance.</p><p>Then the result became even stranger.</p><p>Around Day 36, the entire ranking reversed.</p><p>The stocks with the worst earnings surprises eventually became the best performers, finishing roughly +2.2% by Day 60.</p><p>Meanwhile, the biggest positive surprises faded to approximately −1.0%.</p><p>Instead of observing post-earnings drift, the data showed something closer to mean reversion.</p><p>The companies that disappointed investors recovered.</p><p>The companies that beat expectations stalled.</p><p>It wasn’t a weaker version of PEAD.</p><p>It was the opposite.</p><h4>The strategy still made money — and still failed</h4><p>Buying the largest positive surprises and holding them for twenty trading days generated an average return of 2.18% per trade after transaction costs.</p><p>Viewed in isolation, that sounds perfectly respectable.</p><p>The problem is that these were US mega-cap stocks during one of the strongest bull markets in history.</p><p>Almost everything made money.</p><p>The real benchmark isn’t cash.</p><p>It’s simply buying the same basket of companies without looking at earnings at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*if-MzwXb4QBlyI8REzWUBg.png" /></figure><p>Across every meaningful metric, the simpler strategy won.</p><p>The earnings signal generated negative abnormal returns of approximately −0.22% per trade while taking substantially more risk.</p><p>In other words, I did more work, accepted higher volatility, and still ended up behind a passive benchmark.</p><p>And that day-40 reversal makes the long-only choice look almost fortunate: had I also shorted the worst misses as the textbook prescribes, I’d have been short exactly the stocks that rallied hardest. The full long-short version wouldn’t have rescued the result — it would have made it worse.</p><h4>Why a textbook anomaly disappeared</h4><p>The obvious conclusion would be that PEAD doesn’t work.</p><p>That would also be the wrong conclusion.</p><p>Academic research consistently shows that PEAD is strongest among small and mid-cap stocks, where analyst coverage is sparse and new information spreads more slowly.</p><p>My test focused on the opposite end of the spectrum.</p><p>Apple, Microsoft and Nvidia are among the most heavily researched companies in the world. Their earnings are dissected by dozens of analysts, institutional investors and quantitative funds within minutes of release.</p><p>If an anomaly is going to be arbitraged away anywhere, it will be here.</p><p>The sample period introduced another complication.</p><p>Between 2018 and 2024, the dataset contains both the COVID crash and the extraordinary recovery that followed. Some of the largest earnings surprises were driven by pandemic-related demand shocks rather than persistent changes in company fundamentals.</p><p>Amazon, for example, reported quarters where actual EPS came in several times its consensus estimate during the pandemic — surprises so large they distort any quintile sort built from them.</p><p>Those observations are statistically valid, but they reflect an extraordinary macroeconomic regime rather than the type of earnings information PEAD was originally designed to capture. This is also where my simpler surprise measure bites: dividing by a tiny consensus estimate turns a modest dollar beat into an enormous percentage surprise, and a handful of those pandemic quarters end up dominating the top quintile.</p><p>The reversal observed around Day 40 is likely capturing beaten-down companies recovering during a broader risk-on environment rather than delayed reactions to earnings announcements.</p><h4>What I learned</h4><p>his week’s result reinforced something more important than whether PEAD works.</p><p>Where you test an idea matters just as much as the idea itself.</p><p>A strategy can be robust in academic research while being ineffective in the exact universe most investors want to trade.</p><p>“It’s a documented anomaly.”</p><p>“It’s profitable after costs on large-cap US stocks.”</p><p>Those are very different claims.</p><p>The gap between them is where most trading ideas quietly fail.</p><p>Negative results like this are precisely why I’m publishing this series.</p><p>If every backtest simply confirmed what the textbooks promised, I’d probably be fitting the data to the story instead of testing the story against the data.</p><p>This week, the data said something interesting:</p><p>The famous anomaly still exists — but not where I looked for it.</p><p>Next week I’ll test a very different source of return: the volatility risk premium.</p><p>The theory is that investors consistently overpay for downside protection, creating a premium for those willing to sell insurance — until markets remind them why that premium exists.</p><p><em>The complete code, data, and methodology are available on GitHub as part of my ten-week series on systematically building and evaluating quantitative trading strategies. If you spot an issue I would genuinely appreciate your feedback. That’s one of the main reasons I’m publishing these experiments publicly.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2754d71adfac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dual Momentum Beat the Market on Risk — But the “Smart” Part Did Nothing]]></title>
            <link>https://medium.com/@nishaanth.sivakumar/dual-momentum-beat-the-market-on-risk-but-the-smart-part-did-nothing-daa03b0b6d48?source=rss-40050eb1e09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/daa03b0b6d48</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[quantitative-finance]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[Nishaanth Sivakumar]]></dc:creator>
            <pubDate>Sun, 28 Jun 2026 12:55:19 GMT</pubDate>
            <atom:updated>2026-06-28T12:55:19.230Z</atom:updated>
            <content:encoded><![CDATA[<h4>Week 4 of building 10 quant strategies in public. After three disappointments, the first one that worked — and an honest look at why it worked, which is not the reason I expected.</h4><p>Three weeks, three letdowns.</p><p>The moving-average crossover lost to doing nothing. RSI mean reversion had an 83% win rate and still lost money. The day-of-week “anomaly” turned out to be statistical noise on every ticker I tested. If you’ve been following this series, you’d be forgiven for thinking the whole exercise was just an elaborate way of proving that markets are hard.</p><p>So Week 4 feels like a turning point. I built a dual momentum strategy, and for the first time, the numbers came back genuinely good: lower volatility, a higher Sharpe ratio, and roughly half the maximum drawdown of the benchmark.</p><p>Then I looked closer, and the interesting story wasn’t that it worked. It was <em>which part</em> of it worked — and which part, the part I thought was clever, contributed almost nothing.</p><h4>The idea</h4><p>Dual momentum asks two questions at the end of every month.</p><p>The first is <strong>relative</strong>: among the assets I could hold, which one has been strongest lately? You rank them by trailing return and pick the leader. The intuition is simple — winners tend to keep winning, at least for a while. Momentum is one of the most stubbornly persistent patterns in finance; it shows up across decades, across countries, and across asset classes, which is more than you can say for most “anomalies.”</p><p>The second question is <strong>absolute</strong>: is that leader actually going anywhere, or is it just the tallest dwarf? You compare its trailing return against cash (T-bills). If even the strongest asset can’t beat cash, you don’t hold it — you step aside into bonds and wait.</p><p>Put together: hold the strongest risky asset, but only while it’s beating cash; otherwise hide in bonds. The approach was popularized by Gary Antonacci in his 2012 work on what he called Global Equities Momentum. The appeal is that it tries to do two things at once — capture the upside of the best-performing market, and sidestep the worst of the drawdowns.</p><h4>The setup</h4><p>I kept it deliberately plain, same discipline as the earlier weeks:</p><ul><li><strong>Risky sleeve:</strong> SPY (US equities) and VEU (the rest of the world). Each month, relative momentum picks whichever is stronger.</li><li><strong>Safe harbor:</strong> AGG (aggregate bonds), held whenever the absolute-momentum gate fails.</li><li><strong>The cash hurdle:</strong> BIL (T-bills), the bar the winning asset has to clear.</li><li><strong>Lookback:</strong> trailing 12 months.</li><li><strong>Rebalance:</strong> monthly.</li><li><strong>Costs:</strong> 10 basis points, one-way, charged only when the strategy actually switches assets.</li><li><strong>Benchmark:</strong> an equal-weight SPY/VEU basket, rebalanced monthly — because once you’re holding a basket, “buy and hold SPY” isn’t the fair comparison anymore.</li><li><strong>Window:</strong> July 2008 to June 2026. 216 months. Eighteen years.</li></ul><p>Signals are formed at month-end and applied to the <em>following</em> month, so the backtest never trades on information it wouldn’t have had in real time.</p><h4>The results</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*54R-NWX4nwUHJXkdgEU46g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*dy-u9kTKU4T9fqe3D6StYw.png" /></figure><p>Holdings over the full period: SPY 65.7% of the time, VEU 18.1%, bonds 16.2%, with 31 switches across eighteen years.</p><p>Read the table top to bottom and a clear picture emerges. The strategy made slightly <em>less</em> money than the benchmark — 8.74% a year versus 8.94%. But it did so with noticeably lower volatility, a better Sharpe ratio, and a maximum drawdown less than half the size. This is the textbook dual-momentum signature: you give up a little raw return in exchange for a lot of downside protection. If you can stomach a 45% drawdown, the benchmark is fine. Most people can’t — and a strategy you can actually stick with through a crash is worth more than a slightly higher number on paper.</p><p>That’s the headline most write-ups would stop at. Here’s where it gets more honest.</p><h4>Where the protection actually came from</h4><p>The drawdown gap: −21.7% versus −44.8%, sounds like the strategy was steadily, intelligently dodging losses for eighteen years. It wasn’t. Almost all of that protection was earned in a single stretch: the 2008 financial crisis, right at the start of the window.</p><p>The strategy <em>opened</em> in bonds. Its very first position, in July 2008, was AGG — because the trailing-12-month signal was already negative as the crisis built. It then sat in bonds through the worst of the crash. In October 2008, the benchmark fell about 19.6% in that one month. The strategy, parked in AGG, lost 2.3%.</p><p>That’s the whole trick, more or less. Get defensive before the crash, and your drawdown stat looks heroic for the next decade. Which leads directly to the first caveat I’ll get to below — but first, the part that genuinely surprised me.</p><h4>The “smart” part did nothing</h4><p>Here’s what I didn’t expect.</p><p>The strategy spent 65.7% of its life in SPY — and over this particular window, US equities crushed international ones. SPY was, by a wide margin, the better of the two risky assets. So a strategy that correctly spent two-thirds of its time in the winner <em>should</em> have beaten an equal-weight basket that’s permanently dragging around 50% of the loser (VEU).</p><p>It didn’t. It slightly <em>lagged</em> the benchmark on return.</p><p>Sit with that for a second. The relative-momentum engine — the clever part, the part that picks the strongest asset each month — added no excess return at all. The 31 switches it made came with timing lag and transaction costs, and those frictions roughly cancelled out the benefit of being in the right asset. Every time it rotated out of SPY after a dip and back in after the rebound, it paid for the privilege of being slightly late in both directions.</p><p>So if relative momentum didn’t earn its keep, what produced the good Sharpe and the small drawdown? The <em>absolute</em> gate. The boring rule. The one that just says “if nothing’s working, go to bonds.” That single defensive switch — concentrated in 2008 — is responsible for nearly all of the edge.</p><p>The clever component was a wash. The dumb component did the work. That’s not the story I set out to tell, but it’s the one the data tells, and it’s a more useful lesson than “momentum wins.”</p><h4>The caveats that matter</h4><p><strong>The sample window flatters the strategy.</strong> Starting the backtest in mid-2008 means it opens with the worst crash in a generation — exactly the environment where a defensive strategy looks brilliant. If I’d started in 2013, the strategy would have spent most of the test sitting out of a roaring bull market, and the drawdown advantage would have looked far less impressive against the return it gave up. The −21.7% number isn’t wrong, but it’s heavily a product of <em>when</em> I started counting.</p><p><strong>The menu is thin.</strong> With only two risky assets, the relative-momentum leg barely has anything to choose between. Adding more (emerging markets, sectors, factors) would give it real decisions to make — at the cost of more turnover and more chances to whipsaw.</p><p><strong>The day was chosen in-sample, and I didn’t tune.</strong> I used a 12-month lookback because it’s the textbook default, and I deliberately did not sweep across 6-, 9-, and 12-month variants looking for the best one. That restraint is the whole point of this series — the fastest way to fool yourself is to optimize parameters on the same data you then report results on.</p><p><strong>Costs are modeled flat.</strong> Ten basis points is a reasonable round number, not a measured one.</p><h4>What I’m taking away</h4><p>Two things.</p><p>First, <strong>risk-adjusted return is the number that matters</strong>, and it’s the one most retail backtests ignore. A strategy that earns roughly the same as the market with half the drawdown is genuinely better, even with a slightly lower CAGR — because you can lever it up to match the market’s risk and come out ahead, or you can simply hold it through a crash without panic-selling at the bottom. Total return is the number that gets the clicks. Sharpe and max drawdown are the numbers that get you through a bad year.</p><p>Second, and more broadly: <strong>decompose your edge before you take credit for it.</strong> It would have been easy to write this post as “dual momentum works, here’s my clever multi-asset rotation.” But the rotation didn’t work. A two-line defensive rule, firing once in 2008, did. If I hadn’t pulled the result apart, I’d have learned exactly the wrong lesson — and so would you.</p><p>Next week: post-earnings announcement drift, one of the most-cited anomalies in academic finance, and a chance to see whether something with real theoretical backing holds up better than a calendar quirk did.</p><p><em>This is Week 4 of a 10-week series building and honestly evaluating quant trading strategies in Python. All the code, including the backtest that produced these numbers, is on GitHub. If you spot a methodological error, please reach out.</em></p><p><em>Code: </em><a href="https://github.com/NishaanthSivakumar/Quant-Strategies"><em>GitHub</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=daa03b0b6d48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Does Wednesday Beat Monday? Testing the Day-of-Week Effect on Five Tickers]]></title>
            <link>https://medium.com/@nishaanth.sivakumar/does-wednesday-beat-monday-testing-the-day-of-week-effect-on-five-tickers-b2023663d887?source=rss-40050eb1e09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2023663d887</guid>
            <category><![CDATA[quantitative-strategies]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Nishaanth Sivakumar]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 04:38:27 GMT</pubDate>
            <atom:updated>2026-06-21T04:59:14.449Z</atom:updated>
            <content:encoded><![CDATA[<h4>Week 3 of my 10-week quant strategies series — a null result, but a useful one.</h4><p>One of the oldest “anomalies” in financial markets is the day-of-week effect. The textbook version goes:</p><blockquote>Monday returns in US equities are systematically lower than other days — sometimes negative on average — while Friday returns are systematically higher. Papers documenting this go back to French (1980) and Gibbons &amp; Hess (1981).</blockquote><p>When I started this week, the question I wanted to answer wasn’t <em>“does this still exist?”</em> — it was actually two separate questions that most write-ups conflate:</p><ul><li><strong>Statistical:</strong> Is there a detectable difference in mean daily returns across the five weekdays?</li><li><strong>Practical:</strong> Even if there is, is it big enough to turn into a profitable trading rule after costs?</li></ul><p>You can answer “yes” to the first and still get “no” to the second. The honest version of the first answer requires a significance test, not just a bar chart. The honest version of the second requires a backtest that accounts for the opportunity cost of sitting out four days a week.</p><p>I tested both, on a five-ticker basket — SPY, QQQ, AAPL, MSFT, GLD — from 2015 to 2024.</p><h4>The setup</h4><p>The pipeline is short:</p><ol><li>Pull daily adjusted close prices.</li><li>Compute daily returns. Tag each day Monday through Friday.</li><li>Group returns by day-of-week and report the mean.</li><li>Run a one-way ANOVA across the five groups. If the spread of group means could plausibly come from random sampling, the F-test will flag it.</li><li>Pick the highest-mean day in-sample, build a long-only-on-that-day rule, and backtest it against buy-and-hold with 5 bps per trade.</li></ol><p>A few methodology choices worth being explicit about:</p><p><strong>Five tickers, tested independently.</strong> The original 1980s findings were on US equity indices. A pattern that only shows up in one asset is more likely sampling noise than a real anomaly, so I wanted a basket: SPY and QQQ for broad equity exposure, AAPL and MSFT for the two largest US single names, and GLD for a non-equity asset to check whether anything generalises.</p><p><strong>Statistical significance, not just point estimates.</strong> A 0.5% gap between Wednesday’s and Thursday’s mean returns means nothing if the daily standard deviation is 1.2% — that gap could easily be noise. The ANOVA answers whether the five means are different <em>more than chance would predict</em>, which is the right question to ask before deciding anything is real.</p><p><strong>No parameter optimization.</strong> The “best day” is whatever the data says in-sample. There’s no search across thresholds or lookbacks that could quietly produce an overfit “result”.</p><h4>What the data looks like</h4><p>The annualised mean return by day of week, ticker by ticker:</p><p><strong>SPY</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p_HY2maqlj1gGY2nJTljgg.png" /></figure><p>Wednesday highest at 17.8%, Thursday lowest at 9.9%. All five days are positive. No Monday weakness at all.</p><p><strong>QQQ</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k19tc-p0f0UL8D01gtJYSA.png" /></figure><p>Wednesday again at 28.7%, with Friday the <em>lowest</em> at 3.6%. The classical Friday effect — supposedly a positive anomaly — has the opposite sign here.</p><p><strong>AAPL</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*11ecRfKuALJDwGbn8YqVNA.png" /></figure><p>The most visually striking pattern. AAPL’s annualised mean Monday return is 58% — more than double the next-best day. Thursday is mildly negative at -3.0%. This is the opposite of the textbook Monday effect, which says Mondays are the <em>worst</em> day. On AAPL over the past decade, Monday has been the best day by a wide margin.</p><p><strong>MSFT</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*25m258sA3vf_8y3TFPgtTg.png" /></figure><p>Wednesday at 46.4%, Tuesday weakest at 13.8%. All five days positive. No pattern matching either the Monday or Friday classical claim.</p><p><strong>GLD</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qyk0zuT7vhmvYwpaOVjviA.png" /></figure><p>Finally — a ticker where Monday actually is the worst day, with an annualised mean return of -3.3%. Friday is the best at 15.9%. This is the only ticker in the basket where the pattern points the same direction as the textbook.</p><p>So across five tickers: one (GLD) loosely matches the classical story, one (AAPL) is its mirror image, and the other three look like noise around a positive drift. If the day-of-week effect were a real, structural feature of markets, you’d expect more consistency than this.</p><h4>The statistical verdict</h4><p>Bar charts of five group means are seductive but misleading. Five bars <em>will</em> always have a highest and lowest — that’s not evidence of a real effect, that’s what taking five samples from anything looks like. The question is whether the spread between the highest and lowest is bigger than you’d expect under random sampling.</p><p><strong>The ANOVA p-values:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*JdX7gyBPxkQ7a-d9RFQskQ.png" /></figure><p>None of them clear p &lt; 0.05. AAPL is closest at 0.17 — meaning that even with Monday’s 58% annualised return looking so dramatic, the within-day variation is large enough that there’s a 17% chance of seeing this much spread under the null hypothesis of no real effect. That’s well above the conventional bar.</p><p>The other four aren’t even close. SPY’s p-value of 0.99 means the five days are statistically indistinguishable — the data couldn’t be more consistent with the null.</p><p>There’s also a multiple-comparisons issue I want to flag. Running five ANOVAs inflates the false-positive rate; if the true effect were zero everywhere, you’d still expect roughly a one-in-four chance that at least one ticker comes back with p &lt; 0.05 by chance. None did, so it’s moot here — but if AAPL had come back at p = 0.04, I would have wanted a Bonferroni-style correction before getting excited.</p><p><strong>Answer to question 1</strong>: the day-of-week effect is not statistically detectable in this basket over this window.</p><h4>The trading verdict</h4><p>I could have stopped there. But the more interesting question — and the one that separates a research finding from a usable result — is what happens if you trade the apparent in-sample pattern anyway. Particularly on AAPL, where the bar chart looks so compelling.</p><p>For each ticker, the rule is the simplest possible test of the calendar effect: long on the best in-sample day, flat the other four. 5 bps per trade. Compared to buy-and-hold over the same window.</p><p><strong>SPY — long Wednesdays only</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BTJD9x36eM1D0d2QLLqdlA.png" /></figure><p>From $10,000 in 2015 to roughly $8,350 in 2025 — down 16.5%. Buy-and-hold finished at $34,000, up 240.8%. The strategy lost money outright over a decade in which the underlying more than tripled.</p><p><strong>AAPL — long Mondays only</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W5tgkDWQO4783N-gzMgq5Q.png" /></figure><p>The most interesting case. AAPL’s Monday returns really were high in-sample, and the strategy made real money — up 69.1% over the decade. But buy-and-hold made 935.9%. The opportunity cost of sitting out four days a week, in one of the best-performing stocks of the decade, swamped the apparent edge by roughly fourteen-to-one. On Sharpe — the risk-adjusted comparison that strips out volatility — the strategy at 0.47 still came in at less than half of buy-and-hold’s 0.97.</p><p><strong>GLD — long Fridays only</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yf6WYs6idJ1O2RWE-46GgQ.png" /></figure><p>The non-equity case. The strategy finished at roughly $8,100 — down 18.9% — on a rule designed explicitly to capture the highest-return day of the week. Buy-and-hold finished at $21,000, up 110.9%. GLD is the only ticker in the basket where the data even loosely matched the classical Monday-weak/Friday-strong pattern, and the strategy still lost money.</p><p><strong>Summary across the full basket:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*CLaC4IfK886eKYHGJJRXCw.png" /></figure><p>The strategy underperformed buy-and-hold on every ticker, in both total return and Sharpe. Three of five (QQQ, AAPL, MSFT) produced positive returns in absolute terms — meaning the “best day” rule worked, in the literal sense of making money — but every one of them still got crushed by buy-and-hold. Even on AAPL, where the in-sample pattern was strongest and the strategy was up 69%, the risk-adjusted return came in at less than half of buy-and-hold’s.</p><p><strong>Answer to question 2: </strong>even where a pattern appears, it isn’t big enough to be tradeable against the alternative of just holding the underlying.</p><h4>What this teaches</h4><p>Three things worth pulling out:</p><p><strong>A 20%-time-in-market rule with no statistical edge will lose to buy-and-hold on a drifting asset — even when it makes money in absolute terms.</strong> This is the arithmetic of opportunity cost. Three of five strategies in this basket finished positive; all five still got beaten by buy-and-hold, several by an order of magnitude. If the average day has positive expected return — which has been true for everything tested here — sitting out four days in five forfeits most of the drift. The only way to win is if your one day has <em>much</em> higher mean return than the others, <em>consistently</em>, in a way that survives both noise and costs. None of the five tickers showed that.</p><p><strong>The bar chart is a trap on its own.</strong> AAPL Monday at 58% looks like an obvious signal until you note that AAPL’s daily standard deviation is around 1.9%, which annualises to roughly 30%. A 50-ish percentage point spread between Monday and Thursday’s annualised means is well within one standard deviation of the daily noise. Without a significance test sitting alongside the bar chart, you can convince yourself of almost anything. The bar chart shows you the point estimate; the p-value tells you how much to trust it.</p><p><strong>The classical Monday/Friday effect, if it ever existed, isn’t reliably present in modern data.</strong> Five tickers, five different “best days”, none statistically detectable. This is consistent with a known pattern in the academic literature: documented anomalies tend to weaken once they’re published, plausibly because capital flows in to arbitrage them away. The day-of-week effect, originally found in pre-1980s US equity data, may be one of those.</p><h4>The honest framing</h4><p>A clean null result isn’t a failure of the experiment — it’s what you wanted to know. Going in, I gave the day-of-week effect every reasonable chance: a 10-year window, five tickers including both equities and a non-equity, an in-sample optimised best-day selection that should have biased the strategy <em>toward</em> looking good. It still couldn’t beat buy-and-hold anywhere.</p><p>That’s a finding I’d rather have than a marginal “win” that doesn’t survive an out-of-sample test or a slight change in basket. The point of building this portfolio is to test classical claims honestly, not to find a profitable strategy at any cost.</p><p>Next week: a more interesting question — does volatility scaling improve the buy-and-hold benchmark itself?</p><p><em>Full code, equity curves, and per-ticker breakdowns on </em><a href="https://github.com/NishaanthSivakumar/Quant-Strategies/tree/main"><em>GitHub</em></a><em>. This is part of a 10-week series — one strategy a week, honest results either way.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2023663d887" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built a Trading Strategy With an 83% Win Rate. It Lost Spectacularly.]]></title>
            <link>https://medium.com/@nishaanth.sivakumar/i-built-a-trading-strategy-with-an-83-win-rate-it-lost-spectacularly-fc7585fe0827?source=rss-40050eb1e09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc7585fe0827</guid>
            <category><![CDATA[quantitative-strategies]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[quantitative-trading]]></category>
            <dc:creator><![CDATA[Nishaanth Sivakumar]]></dc:creator>
            <pubDate>Sun, 14 Jun 2026 11:51:41 GMT</pubDate>
            <atom:updated>2026-06-14T11:51:41.816Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why a perfect-looking metric is the diagnostic signature of a broken strategy — and what it taught me about how markets actually work.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YDuiuIt210PjBdpNxeRkag.png" /></figure><p>I’m in week 2 of building 10 quantitative trading strategies from scratch, with honest write-ups whether they win or lose. Week 1 was a moving average crossover — it underperformed buy-and-hold, exactly as 50 years of academic literature predicted it would. Week 2 was supposed to be the redemption: RSI mean reversion, a strategy with logical underpinnings, academic backing, and a fifty-year track record on retail trading screens.</p><p>The result was more interesting than I expected.</p><p>The strategy made money. It won 83% of its trades. Its average trade returned 8.6%. By every metric you’d read about on a trading blog, it looked like a winner.</p><p>It also got beaten by buy-and-hold by a factor of <strong>26 to 1</strong>.</p><p>This article is about how those two things can be true at the same time, and what it taught me about the gap between indicators that <em>look</em> like they work and strategies that <em>actually</em> work.</p><h4>What I tested</h4><p>The Relative Strength Index — RSI — is probably the most widely-used indicator in retail trading. It’s on every TradingView chart, every Robinhood watchlist, every CNBC chyron. It was invented by J. Welles Wilder in 1978, and despite being almost half a century old, it’s still the default momentum gauge on most trading platforms.</p><p>The intuition is simple. Over a 14-day window, RSI asks: <em>what fraction of the recent price movement was upward?</em> The result is a number between 0 and 100. Above 70 is conventionally called “overbought.” Below 30 is “oversold.”</p><p>The trading hypothesis is equally simple. When something falls hard and fast, sellers eventually exhaust themselves. Panicked retail, forced margin calls, stop-losses — all of it concentrates in a short window. Once that selling burns out, the price tends to bounce back toward fair value. RSI dipping below 30 is supposed to identify that exhaustion point.</p><p>So the rule:</p><ul><li>Buy when RSI(14) crosses below 30</li><li>Sell when RSI(14) crosses above 70</li><li>Stay flat in between</li></ul><p>I tested it on AAPL from 2010 to 2024 — fifteen years across recovery, growth, COVID, and the rate-hike cycle. I used the textbook 14-day window and standard 30/70 thresholds. No parameter tuning. Transaction costs of 5 basis points per trade. Benchmark: buy-and-hold the same stock.</p><h4>The results</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*yDicm8STyXe0A8fOygTbPQ.png" /></figure><p>The strategy did make money. $10,000 invested in 2010 would have grown to $24,500 — not nothing. The Sharpe ratio was positive. The win rate was excellent.</p><p>But $10,000 in AAPL itself would have grown to $391,000.</p><p>The chart tells the story even more starkly. The strategy’s equity curve crawls upward like a sleeping animal, while AAPL ramps off the top of the page. The blue line <em>barely registers</em> against the orange.</p><p>How does a strategy with an 83% win rate end up looking like that?</p><h4>The 83% win rate was the diagnostic, not the strength</h4><p>Here’s the thing about win rate that the popular trading literature gets wrong: it’s almost meaningless without context.</p><p>A strategy that wins 83% of its trades but only trades once a year, while sitting on cash for the other 71% of the time, is exactly the <em>signature</em> of a mean-reversion strategy applied to the wrong asset in the wrong regime.</p><p>Think about what RSI mean reversion is doing. It waits for an asset to fall sharply, buys the dip, and exits when the asset has bounced. By definition, this strategy is <em>only</em> in the market during periods when price has recently fallen and is now recovering. The rest of the time — including most of the great bull runs — it’s flat, in cash, earning nothing.</p><p>If you point this strategy at an asset that mostly goes up, you get exactly what I got: a high win rate (most dips do bounce), a positive expected per-trade return (the strategy is locally correct), and <em>terrible</em> compounding (because you missed all the steady upward drift between dips).</p><p>The unit of analysis isn’t whether you win a trade. It’s:</p><p>(win rate × average win) − (loss rate × average loss) × frequency × time deployed</p><p>The strategy nailed the first three terms. It got annihilated by the last two. Twelve trades in fifteen years isn’t enough at-bats to compound, no matter how often you’re right.</p><p>This is the difference between “the indicator works” and “the strategy makes money.” RSI does, in fact, identify short-term oversold conditions. The signal has informational content. But the <em>strategy built around it</em> only makes money in environments where the underlying asset isn’t doing something better with its time — like, say, going up 38x.</p><h4>The failure mode wasn’t what I expected</h4><p>Going into this, the obvious risk I was worried about was the classic mean-reversion failure: buying oversold in a downtrend. “Catching falling knives,” as the saying goes. In a bear market, RSI below 30 doesn’t mean “about to bounce.” It means “still falling.” If your exit signal is RSI above 70, you might never get there before the trade has bled out.</p><p>That’s not what killed this strategy.</p><p>AAPL from 2010 to 2024 wasn’t a downtrend. It was one of the most powerful sustained uptrends in equity market history. The strategy didn’t lose money on falling knives — there weren’t enough falling knives to lose money on.</p><p>What killed it was the opposite problem: <strong>opportunity cost in an uptrend</strong>. Oversold signals on a rallying stock are rare. The strategy fired twelve times in fifteen years. Between those signals, AAPL kept compounding without it. Each missed month of buy-and-hold was a tiny tax. Multiplied over fifteen years, it became a 26x gap.</p><p>This is a subtler failure mode than the textbook one, and a more uncomfortable one. The strategy didn’t <em>do</em> anything wrong, per se. Every trade was sensible. The discipline held. The win rate was great. It just wasn’t <em>playing the right game</em>.</p><p>That’s a more useful lesson than “RSI mean reversion doesn’t work.” Because RSI mean reversion probably <em>does</em> work — in choppy, range-bound markets, on assets that genuinely mean-revert, with regime filters to keep it out of strong trends.</p><p>What doesn’t work is applying it indiscriminately and trusting the win rate to tell you whether you’re winning.</p><h4>What I’d do differently</h4><p>The temptation, having seen these results, is to start optimising. Try RSI(2) instead of 14 (more frequent signals). Try different thresholds. Add a trend filter so the strategy only fires when the long-term trend is <em>not</em> rising. Layer in stop-losses.</p><p>All of these are reasonable ideas. None of them belong in this writeup. Optimising on the same data the strategy was evaluated on isn’t science — it’s confirmation bias with extra steps. If I tune parameters until AAPL looks better, all I’ve discovered is which parameters fit AAPL 2010–2024 in retrospect. That tells me nothing about whether they’d work going forward.</p><p>What’s worth doing — and what’s going on my list for a future writeup — is testing the <em>same</em> unoptimised strategy on assets where the regime is different. Index ETFs like SPY, where mean reversion is theoretically weaker. Sector ETFs in range-bound periods. Stocks with high realised volatility but low trend. If the strategy looks better in those environments, that’s evidence the regime hypothesis is real. If it looks the same or worse, the idea needs more work than just regime selection can fix.</p><p>There’s also a version of this question that’s about indicators, and a version that’s about discipline. The disciplined version says: don’t pick winners by win rate, don’t optimise on the test set, don’t trust your strategy until you’ve stress-tested it across regimes. The indicator version says: RSI is a measurement, not an oracle. It tells you something true about recent price behaviour. What you do with that information is a separate question, and the answer depends on what the rest of the market is doing.</p><p>Both versions are worth keeping in mind, because most strategies that fail in the real world fail for one of those two reasons.</p><h4>What this is teaching me</h4><p>This is the second strategy I’ve built and the second one to lose to buy-and-hold. That’s not a coincidence. Most strategies you read about in trading books and on YouTube lose to buy-and-hold — and the reason isn’t that buy-and-hold is some kind of cosmic optimum. It’s that strategies which <em>aren’t</em> in the market 100% of the time need a really good reason to outperform something that is.</p><p>The question isn’t “does this indicator work?” The question is “does this indicator give me enough edge, often enough, with enough certainty, to overcome the opportunity cost of not just holding the asset?”</p><p>For RSI mean reversion on AAPL, the answer is clearly no. For RSI mean reversion on something else, in a different regime, with different rules, the answer might be yes. But that’s a research project, not a conclusion you can draw from one backtest.</p><p>Next week I’m testing whether day-of-week effects — the famous “weekend effect” — still exist in modern markets. The honest expectation, based on what I’ve read, is that they’ve mostly been arbitraged away since 2000. But that’s what we said about mean reversion too, and the picture turned out more nuanced than that.</p><p>I’ll find out.</p><p><em>Code, full backtest data, and methodology notes are on GitHub: </em><a href="https://github.com/NishaanthSivakumar/Quant-Strategies"><em>Github Link</em></a></p><p><em>This is part of a 10-week series testing quantitative trading strategies from scratch in Python, with honest results either way.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc7585fe0827" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why the Most Famous Strategy in Trading Lost to Doing Nothing]]></title>
            <link>https://medium.com/@nishaanth.sivakumar/why-the-most-famous-strategy-in-trading-lost-to-doing-nothing-fc2daddd1c4b?source=rss-40050eb1e09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc2daddd1c4b</guid>
            <category><![CDATA[backtesting]]></category>
            <category><![CDATA[quantitative-finance]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Nishaanth Sivakumar]]></dc:creator>
            <pubDate>Sun, 07 Jun 2026 13:28:44 GMT</pubDate>
            <atom:updated>2026-06-07T13:28:44.641Z</atom:updated>
            <content:encoded><![CDATA[<h4>A clean backtest of the 10/50 moving average crossover on SPY — what I found, and what I think it means. Week 1 of 10.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WEOAuZPXzAFbvYMkb4gLEw.png" /></figure><h4>Why I’m doing this</h4><p>I’m spending the next ten weeks building one quant trading strategy a week, backtesting it honestly, and writing about what I find. The goal isn’t to discover an alpha source — realistically, I won’t. The goal is to get reps at the actual workflow a junior quant researcher does every day: take a hypothesis, test it without fooling yourself, and analyse the result critically.</p><p>This is week 1. I picked the most famous strategy in trading on purpose: if I can’t implement and analyse this one cleanly, the more interesting strategies later in the series won’t mean anything.</p><h4>The strategy</h4><p>The 10/50 moving average crossover is the “hello world” of trend following.</p><blockquote><em>When the 10-day moving average of price crosses </em><strong><em>above</em></strong><em> the 50-day moving average, the asset is in an uptrend — go long. When it crosses back below, exit to cash.</em></blockquote><p>The intuition is reasonable: in a genuine uptrend, recent prices should drag the short MA above the long MA before the trend reverses. The empirical question is whether that signal is strong enough — and clean enough — to make money after costs.</p><p>I tested it on SPY (the S&amp;P 500 ETF) from 2019 to 2024. Six years that include the late-cycle 2019 rally, the COVID crash, the 2020–21 ZIRP boom, the 2022 drawdown, and the 2023–24 AI-driven rally. A decent stress test.</p><h4>Methodology</h4><p>A few choices worth being explicit about, because they’re where most amateur backtests quietly cheat:</p><p><strong>Signal timing:</strong> The MA crossover is computed at the close of day <em>t</em>, but the trade executes at the open of day <em>t+1</em>. In code that means shifting the signal by one day before multiplying by returns. Skip this and you get “look-ahead bias” — the strategy magically trades on information it didn’t have. Backtests without this shift routinely look 2–3x better than they should.</p><p><strong>Transaction costs:</strong> I charged 5 basis points (0.05%) per trade. For a retail trader on a liquid ETF like SPY, this is a conservative estimate covering bid-ask spread plus slippage.</p><p><strong>Position sizing:</strong> All-in or all-out, no leverage. This keeps the test about the signal, not about sizing tricks.</p><p><strong>Benchmark:</strong> Buy-and-hold SPY over the same window. Same asset, same period.</p><p>Full code, charts, and write-up on GitHub — link at the bottom.</p><h4>Results</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*QNrKIXTOScm9KiNkbnGYeQ.png" /></figure><p>The strategy with rules underperformed the strategy with no rules by 92 percentage points of total return. It also cut the worst peak-to-trough loss by more than half. Both of those things matter, and most write-ups about MA crossovers stop at the first one.</p><p>The interesting part is what’s underneath.</p><h4>Why it lost</h4><p>My first instinct was that whipsaws and transaction costs were the main culprit. They weren’t. 33 trades over 6 years at 5 bps per trade adds up to about 1.65 percentage points of cost drag — meaningful, but tiny against the 92-point gap.</p><p>The real story is structural, and sharper than I expected when I started.</p><p><strong>The strategy is in the market 71% of the time.</strong> So the first question is: how much of the underperformance is just from having lower average exposure to an asset that compounded at 17% per year?</p><p>To answer this, compare against a naive portfolio that’s <em>constantly</em> 71% SPY and 29% cash, daily-rebalanced. No signal, no timing — just lower exposure. Over the same period this would have returned approximately <strong>96%</strong>. The MA strategy returned <strong>67%</strong>.</p><p>That’s the finding I didn’t expect: <strong>the timing signal isn’t just buying you less exposure — it’s actively destroying about 30 percentage points of return relative to the same exposure held constantly.</strong> A coin flip with the same average market exposure would, on average, have done better than the MA signal.</p><p>The mechanism is the well-known weakness of lagging indicators. A 50-day moving average is, by definition, the mean of the last 50 days of prices. By the time it confirms a trend reversal, you’ve already lived through 25 days of the reversal. In the March 2020 crash the strategy stayed long well into the decline, exited near the bottom, and re-entered after a sizeable chunk of the recovery had passed. Both ends of every major move got chopped off.</p><p>The one thing the strategy genuinely achieved is the drawdown: <strong>-15.1% vs -33.7%</strong>. That’s real risk reduction — less than half the worst peak-to-trough loss. But the cost of buying that protection, measured against the constant-exposure alternative, was ~30 percentage points of return. That’s an extraordinary insurance premium.</p><h4>What this teaches about strategy design</h4><p>Three takeaways I’ll carry into the rest of the series.</p><p><strong>Average exposure isn’t enough — timing has to add value over and above it.</strong> The natural benchmark for any timing strategy is <em>not just</em> buy-and-hold — it’s also a constant-exposure portfolio matched to the strategy’s average exposure. If the signal can’t beat <em>that</em>, it’s destroying value rather than adding it. The MA crossover on SPY fails this test by 30 percentage points.</p><p><strong>Sharpe captures what total return hides.</strong> The strategy’s lower volatility makes its return underperformance look “less bad” in absolute terms. But Sharpe (0.76 vs 0.90) confirms that the risk reduction didn’t compensate for the lost return. On a risk-adjusted basis, the strategy is just a worse buy-and-hold.</p><p><strong>Costs were the first thing I checked, and they turned out not to be the story.</strong> 1.65 percentage points of cost drag is small change against the 92-point gap. The structural problem — timing a strongly uptrending asset with a lagging signal — turned out to be much bigger than the friction. Worth remembering for future backtests: check the obvious explanation, but don’t stop there if the arithmetic doesn’t add up.</p><h4>Limitations</h4><p>Worth being upfront about:</p><ul><li><strong>One asset, one period.</strong> Results don’t generalise. The same parameters tested on QQQ, EFA, or a basket of small-caps would give different numbers.</li><li><strong>No parameter optimisation.</strong> I picked 10 and 50 because they’re the textbook defaults. I deliberately didn’t search for the “best” window pair, which would have produced a better-looking but overfit result.</li><li><strong>Daily close data only.</strong> Real execution involves intraday slippage and bid-ask spread costs the 5-bp assumption is trying to bundle in.</li><li><strong>Long-only.</strong> I didn’t test shorting on the bearish signal, which would change the picture in 2022.</li></ul><h4>What’s next</h4><p>Week 2: an RSI mean-reversion strategy — the philosophical opposite of trend-following. The hypothesis there is that markets <em>overreact</em> to short-term moves, so buying short-term oversold conditions should pay. Different asset class, different signal, different intuition. I’ll find out whether being wrong in the opposite direction works any better.</p><p><strong>Code &amp; full write-up:</strong> <a href="https://github.com/NishaanthSivakumar/Quant-Strategies/tree/main">My Github Link</a></p><p><em>If you’re a quant practitioner reading this, I’d genuinely value feedback on the methodology. If you spot a mistake, please tell me — that’s most of why I’m writing publicly in the first place.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc2daddd1c4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>