Stock Market Direction Prediction
Project Overview:
In this project, I built a machine learning pipeline to predict the directional movement of the S&P 500 index (whether it will go up or down the next day). I used historical market data from Yahoo Finance, engineered time-series trend features, and applied a Random Forest classifier with a custom backtesting framework.
Technologies Used:
- Python
- Pandas, NumPy, yfinance
- scikit-learn (Random Forest, metrics)
- Matplotlib (visualisation)
Key Features:
- Fetched and cleaned long-term S&P 500 historical data from Yahoo Finance
- Generated binary target (market up/down) based on tomorrow's closing price
- Engineered trend features over various time horizons (2, 5, 60, 250, 1000 days)
- Implemented rolling backtest function to simulate real market conditions
- Achieved ~57% precision in predicting upward movement using Random Forest