Inspiration

Honestly, looking at the raw dataset scared us a bit. The market is noisy, and news headlines are often just clickbait. But we remembered the prompt: "Wall Street no longer runs on gut feeling."

We wanted to answer a specific question: Does a "panic" headline actually trigger a volatility spike, or is it already priced in?

We weren't just trying to fit a curve; we wanted to bridge the gap between "fuzzy" language (NLP) and "hard" math (Stochastic Calculus). The inspiration came from realizing that standard Geometric Brownian Motion assumes constant drift, but in reality, news headlines are the shocks that change the drift.

What it does

Our algorithm, S.A.D. (Sentiment-Adjusted Drift), is a hybrid trading strategy that predicts SPY direction.

  1. Filters the Noise: It ingests the provided headlines and filters out irrelevant noise (like "Top 10 stocks to buy") to focus on macro-moving news.
  2. Quantifies "Vibe": It assigns a sentiment score (-1 to +1) and an "impact score" to each headline using a fine-tuned NLP model.
  3. Adjusts the Math: Instead of treating volatility as a random walk, we feed the sentiment scores into a GARCH(1,1) model.
  4. Executes: It outputs a Buy/Sell/Hold signal based on whether the predicted Sharpe Ratio exceeds our risk threshold.

How we built it

We treated this like a factory assembly line inside a Kaggle Notebook:

  • The Brain (NLP): We used FinBERT (ProsusAI) because it's pre-trained on financial texts. Standard BERT thought "bear market" meant cute animals, so FinBERT was necessary.
  • The Math (Stochastic): We implemented an Ornstein-Uhlenbeck process for mean reversion but modified the drift term ($\mu$) to be dynamic based on the sentiment signal from step 1.
  • The Glue: Pandas for data wrangling and PyTorch for the model fine-tuning.
  • Risk Management: We added a "Kelly Criterion" sizing logic to ensure we didn't bet the house on a single tweet.

Challenges we ran into

  • Look-ahead Bias: Our first model had a Sharpe Ratio of 8.0. We were ecstatic until we realized we were accidentally training on tomorrow's prices. Fixing that data leakage took 5 hours and broke our hearts.
  • The "Neutral" Trap: 80% of the headlines were neutral. The model initially predicted "Hold" for everything. We had to implement a custom weighting system to make the model aggressive enough to actually trade.
  • Kaggle Timeouts: Processing thousands of headlines with a Transformer model is heavy. We had to quantize the model and optimize our batch sizes to finish within the runtime limit.

Accomplishments that we're proud of

  • Surviving the "Private Test Set" logic: We built a robust cross-validation framework (Walk-Forward Optimization) instead of just random K-Fold, so we're confident our Sharpe Ratio isn't a fluke.
  • Hybrid Architecture: Successfully merging a Deep Learning model (NLP) with a traditional Econometric model (GARCH) without the code exploding.
  • Sanity: We managed to submit a Strategy Memo that actually explains why it works, not just that it works.

What we learned

  • Context matters: A headline saying "Apple beats earnings" is good, but if the market expected more, the price drops. Our model struggled with this nuance.
  • NLP is lagging: Often, the price moves before the headline hits the wire. The "Signal" is sometimes in the volume, not the text.
  • Risk Management > Alpha: Capping our max drawdowns improved our Sharpe Ratio more than improving the prediction accuracy did.

What's next for Sentiment-Adjusted Drift

  • Adding Earnings Call Transcripts: Headlines are short; transcripts are where the real alpha hides.
  • Regime Switching: Implementing a Hidden Markov Model (HMM) to detect if we are in a Bull or Bear regime automatically.
  • Sleep: We are going to sleep for 12 hours straight.

Built With

Share this project:

Updates

Submission history