Financial data analysis in Python. Code examples, market analysis, and data quality deep-dives.

All posts

328 posts · Page 1 of 17
S&P 500 Additions: Does Joining Raise a Stock’s Beta?S&P 500 additions 1995-2023: R-squared with SPY rose 0.035 net of incumbents (t 5.17). Beta rose 0.089, but only 0.032 outside 1998-2001, not significant.Index & UniverseNovember 15, 2026 Survivorship Bias in Machine Learning Stock PredictionSurvivorship bias in machine learning stock prediction: trained on today’s S&P 500 list, a model shows a 7.6-point annual spread; on past rosters, 0.0 points.Index & UniverseNovember 14, 2026 Dow Jones Additions and Deletions: Which Side Did Better?Dow Jones additions and deletions since 1999: removed stocks did better in 6 of 10 changes over one year; over five years additions led, 61.2% to 24.3%.Index & UniverseNovember 13, 2026 Portfolio Optimization: Survivorship Bias by Weighting RulePortfolio optimization survivorship bias, S&P 500 2000-2024: a survivor list adds 6.44 points a year to max Sharpe, 5.20 to equal weight, not a significant gap.Index & UniverseNovember 12, 2026 S&P 500 Spin-Offs: How Did They Do After Joining?S&P 500 spin-offs added 1993-2021 led SPY by a median 3.6 points over 36 months, not a significant lead. The 25 still in the index at end-2024 show 16.6.Index & UniverseNovember 11, 2026 Pairs Trading Backtest: Survivorship Bias in the S&P 500Pairs trading backtest, point-in-time S&P 500 rosters 2000-2024: -0.01% per six months. The end-2024 list shows +0.59%; the survivorship gap is not significant.Index & UniverseNovember 10, 2026 How Many S&P 500 Companies Are on Nasdaq? 1975-2024How many S&P 500 companies are on Nasdaq? 153 of 503 index lines at end-2024, 30.4%, up from 10.0% in 1999; the end-2024 list projected back shows 27.4%.Index & UniverseNovember 9, 2026 Do Stocks Recover After a 50% Drop? Survivorship Bias TestDo stocks recover after a 50% drop? Of 785 S&P 500 halvings in 1995-2019, 38.6% regained the peak in five years; survivorship bias on today’s list shows 60.8%.Index & UniverseNovember 8, 2026 Stocks Removed From the S&P 500: The Slide Before ExitStocks removed from the S&P 500 but still trading trailed SPY by a median 57.6 points over their last 24 months as members, 1995-2024; 91% lagged.Index & UniverseNovember 7, 2026 January Effect Backtest: Survivorship Bias in the S&P 500January effect survivorship bias test: S&P 500 prior-year losers beat winners by 2.22 points in January 2000-2024 (t 1.46); survivor lists inflate losers.Index & UniverseNovember 6, 2026 How Many S&P 500 Stocks Beat the Index Since 2000?How many S&P 500 stocks beat the index? Of 500 members in January 2000, 55.6% beat SPY through 2024 and 24.8% lost money; a survivor list shows 71.6%.Index & UniverseNovember 5, 2026 Look-Ahead Bias in Split-Adjusted Prices, Tested in PythonLook-ahead bias from split-adjusted prices: buying the cheapest S&P 500 fifth on adj_close returned 16.82% a year in 2000-2024, against 10.24% on traded prices.Index & UniverseNovember 4, 2026 New vs Veteran S&P 500 Members: Returns by TenureS&P 500 members in their first year in the index returned 4.95% a year from 2000 to 2024, against 10.75% for members of 10+ years. Today’s list flips the order.Index & UniverseNovember 3, 2026 How to Backtest a Stock Strategy in Python: 7 StepsHow to backtest a stock strategy in Python, in seven steps with real code. One momentum rule earns 8.51% a year done properly, 21.10% on today’s S&P 500 list.GuidesNovember 2, 2026 Market Breadth: Survivorship Bias in the 200-Day IndicatorMarket breadth survivorship bias: today’s S&P 500 list overstates the share of members above their 200-day average by 4.4 points on average, 15.5 at most.Index & UniverseNovember 1, 2026 Stop-Loss Backtest: Survivorship Bias Inflates the CostStop-loss backtest survivorship bias: a 30% trailing stop cost S&P 500 holders 6.09 points a year on point-in-time rosters and 9.64 on today’s list.Index & UniverseOctober 31, 2026 Portfolio Diversification: Survivorship Bias Hides LossesPortfolio diversification and survivorship bias: 3.79% of random 5-stock S&P 500 portfolios lost money over ten years on dated rosters, 0.18% on today’s.Index & UniverseOctober 30, 2026 Dividend Strategy Backtest: Survivorship Bias Flips RankingSurvivorship bias in a dividend strategy backtest: on point-in-time S&P 500 rosters top-yield stocks beat non-payers by 3.31 points a year; on today’s, -6.74.Index & UniverseOctober 29, 2026 Short-Term Reversal: Survivorship Bias Creates a Fake EdgeShort-term reversal on point-in-time S&P 500 rosters: last month’s losers beat winners by 0.19 points a year, 2000-2024. Today’s roster shows 5.71.Index & UniverseOctober 25, 2026 Low-Volatility Anomaly: Survivorship Bias Reverses ItLow-volatility anomaly on point-in-time S&P 500 rosters: calm stocks beat volatile ones by 3.39 points a year, 2000-2024. Today’s roster flips it to -11.85.Index & UniverseOctober 24, 2026