Increasing Analysis: Which Models Perform Best Across Then Entire S&P 500

In Part I, we compared rule-based vs reinforcement learning (RL) trading strategies on AAPL using a 2-year backtest of daily data. Now, we’re scaling that idea across all 500+ tickers in the S&P 500.

What happens when we apply the same logic to the entire market?

We keep the same seven models and run a uniform backtest across all tickers. Our goal: uncover which models are consistently effective, which sectors they perform best in, and where RL models can offer an edge over traditional strategies.


Recap: The Trading Models

ModelTop 2 CountTop 2 %
Model0 (Rule SMA)22043.7%
Model4 (RL)18336.4%
Model1 (RL)15330.4%
Model2 (RL)14629.0%
Model5 (Mean Reversion)12324.5%
Model3 (RL)12224.3%
Model6 (RL Mean Reversion)5911.7%

Insight:
Model0 (simple SMA rule) remains the most consistently high-ranking model. However, RL models like Model4 and Model1 are not far behind — showing strong adaptability in certain sectors.


Average Return by Sector

SectorModel0Model1Model2Model3Model4Model5Model6
Communication Services12.5012.649.538.5210.8512.115.50
Consumer Discretionary18.009.088.72-0.347.533.153.21
Consumer Staples-2.44-5.05-1.61-4.98-6.42-0.750.26
Energy17.8611.5311.953.9412.338.50-0.52
Financials26.7615.2913.9111.2919.288.701.78
Health Care-0.46-2.890.712.681.73-2.53-0.47
Industrials19.0713.1812.089.9212.158.941.06
Information Technology16.4910.5911.587.1620.117.690.04
Materials8.13-3.484.562.644.105.82-2.54
Real Estate6.480.864.414.018.929.022.14
Utilities16.5211.2513.758.6918.341.04-2.92

Insight:

  • Financials and Industrials delivered strong returns across most models.
  • Model4 (RL using only SMA) outperformed in Information Technology and Utilities.
  • Model5 (Rule Mean Reversion) dominated Real Estate, but performed poorly in Consumer sectors.

Top 2 Model Finishes by Sector

SectorM0M1M2M3M4M5M6
Communication Services91075573
Consumer Discretionary2519171011119
Consumer Staples14914791211
Energy87871051
Financials4822191631100
Health Care19151920171515
Industrials3524222030205
Information Technology2525191731174
Materials84997123
Real Estate1363616126
Utilities1612951622

Most Consistent Top Model by Sector

SectorTop ModelTop Model Count
FinancialsModel0 (Rule SMA)48
IndustrialsModel0 (Rule SMA)35
Information TechnologyModel4 (RL)31
Consumer DiscretionaryModel0 (Rule SMA)25
Health CareModel3 (RL)20
Real EstateModel4 (RL)16
UtilitiesModel0 (Rule SMA)16
Consumer StaplesModel0 (Rule SMA)14
MaterialsModel5 (Rule Mean Reversion)12
Communication ServicesModel1 (RL)10
EnergyModel4 (RL)10

Sector-by-Sector Leaderboard (Best Avg Return)

SectorBest ModelAvg Return (%)
FinancialsModel0 (Rule SMA)26.76
Information TechnologyModel4 (RL)20.11
IndustrialsModel0 (Rule SMA)19.07
UtilitiesModel4 (RL)18.34
Consumer DiscretionaryModel0 (Rule SMA)18.00
EnergyModel0 (Rule SMA)17.86
Communication ServicesModel1 (RL)12.64
Real EstateModel5 (Rule Mean Reversion)9.02
MaterialsModel0 (Rule SMA)8.13
Health CareModel3 (RL)2.68
Consumer StaplesModel6 (RL Mean Reversion)0.26

Key Takeaways

  • Model 0 (SMA Rule) was the most consistently successful strategy overall — with the best average return in 6 out of 11 sectors, and the highest top-2 count across all tickers.
  • Model 4 (RL using only SMA) was the strongest reinforcement learning model, outperforming in sectors like Information Technology, Utilities, and Energy.
  • Model 3 (RL using SMA + Volume + Day of Week) led in the Health Care sector, while Model 1 (RL with SMA + Volume) topped Communication Services.
  • While rule-based models dominated overall consistency, select RL models performed best in specific industries — particularly when input features aligned well with sector characteristics.
  • Simple features often outperform more complex ones unless RL is well-tuned.

What’s Next?

In Part III, we’ll visualize all of these results using a Streamlit dashboard, where you can explore model performance by sector, ticker, or metric — all with just a few clicks.

GitHub Link to notebook: GitHub

Sharing

Related Articles

  • All Post
  • Articles
  • Blog Post
  • General Business Automation
  • Portfolio
  • Stock Market & Finance