2025AI-Powered Market Analysis

S&P 500 Trading

Built with
01 / Overview

A comprehensive quantitative trading framework that integrates FinBERT-based sentiment analysis of 19,127 financial headlines with macroeconomic indicators to predict S&P 500 movements using ensemble machine learning.

Financial markets are increasingly influenced by narrative and sentiment alongside traditional economic fundamentals. This project develops a multi-modal prediction system that processes 16 years of financial news (2008-2024) through FinBERT sentiment analysis with Mac M4 GPU acceleration, achieving 66.5% high-confidence predictions. The framework combines sentiment scores with economic indicators (GDP, inflation, unemployment, interest rates, gold prices) and technical analysis features (RSI, MACD, volatility) across three base models—LSTM for sequence modeling, XGBoost for gradient boosting, and Linear Regression for baseline comparison—integrated via a meta-classifier with comprehensive 16-year backtesting.
02 / Process
01

Sentiment Analysis Pipeline

Implemented FinBERT (ProsusAI/finbert) sentiment classification on 19,127 financial headlines with automatic MPS (Metal Performance Shaders) detection for Mac M4 GPU acceleration. Applied financial text normalization and batch processing to generate sentiment scores (positive/neutral/negative) with confidence thresholds, achieving 66.5% high-confidence predictions.

02

Multi-Modal Feature Engineering

Constructed comprehensive dataset by merging sentiment analysis with macroeconomic indicators (GDP, inflation, unemployment, interest rates) and commodity prices (gold). Engineered technical indicators including RSI, MACD, moving averages, and volatility measures. Created binary classification targets for price movement prediction with temporal feature engineering.

03

Ensemble Model Development & Backtesting

Trained three base models—LSTM for temporal sequence modeling, XGBoost with hyperparameter optimization, and regularized logistic regression—using cross-validation. Implemented meta-classifier combining base model predictions through logistic regression ensemble. Developed comprehensive backtesting framework evaluating trading strategies via Sharpe ratio, maximum drawdown, win rate, and equity curve analysis over 16-year holdout period.

03 / Impact
  • Processed 19,127 S&P 500 headlines (2008-2024) through FinBERT sentiment analysis with Mac M4 GPU acceleration via Metal Performance Shaders (MPS), achieving 2-3x speedup over CPU and 66.5% high-confidence predictions.

  • Engineered comprehensive feature set combining sentiment scores, macroeconomic indicators, and technical analysis (RSI, MACD, moving averages) across 16 years of market data for robust multi-modal prediction.

  • Implemented meta-learning ensemble combining LSTM sequence models, XGBoost gradient boosting, and linear regression through a meta-classifier, with comprehensive backtesting framework evaluating Sharpe ratio, maximum drawdown, and win rate.

"

"This project showcases the power of combining natural language processing with traditional machine learning techniques in financial markets. The integration of sentiment analysis with economic indicators provides a comprehensive approach to market prediction, while the ensemble learning methodology ensures robust and reliable results."