Hi everyone,
I wanted to share an interesting case study on the January Effect anomaly and why extended backtesting is critical before trusting any strategy.
The Strategy
The January Effect strategy exploits the well-documented anomaly where small-cap stocks tend to outperform large-caps in January, driven by tax-loss harvesting reversals, window dressing effects, and renewed investor optimism at the start of the year.
The algorithm uses a custom universe selection model to filter a coarse universe of 1,000 US equities down to the top 10 small-cap candidates based on fundamental data. Positions are entered at the start of January and held through the month, then liquidated.
The Trap: 5-Year Backtest (2020-2025)
When backtested over just 5 years (2020-2025), the results looked amazing:
- Sharpe Ratio: 2.327
- PSR: 94.043%
- 154 orders
- Consistent across multiple parameter variations
A Sharpe above 2 is exceptional. PSR of 94% suggests a very high probability the positive Sharpe is real.
The Reality: 27-Year Backtest (1998-2026)
Then I ran the same strategy from 1998 (earliest available for US Equities coarse/fine universe data) to present:
- Sharpe Ratio: -0.461 (NEGATIVE)
- PSR: 0.000%
- Sortino Ratio: -0.114
- Net Profit: 4.23% total over 27 years (CAGR: 0.148%)
- Max Drawdown: 27%
- Win Rate: 48%
- 380 orders
Key Takeaways
1. Always test on the longest period available. A 5-year window can be misleading.
2. The January Effect may have worked in certain market regimes (2020-2025 post-COVID recovery) but fails across full market cycles.
3. QuantConnect's Research Guide flagged "Possible Overfitting" with 10 parameters detected - it was right.
4. PSR and Sharpe can look incredible on short windows and still be worthless long-term.
5. A strategy that only trades one month per year needs decades of data to be statistically significant.
Hope this helps others avoid the same trap. Always stress-test your strategies across the longest possible timeframe before deploying capital.
The full code is attached to this project if anyone wants to replicate or improve upon it.
Ney Torres
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!