## Inspiration The stock market has always felt like a game rigged for the wealthy. Big banks and hedge funds have teams of data scientists and millions in computing power, whilst ordinary people are left guessing with basic charts and gut feelings.

I wanted to change that. What if everyone could have access to the same advanced AI that Wall Street uses?

## What it does FairStock is an advanced AI stock predictor that uses the same technology as ChatGPT (Transformer neural networks) to forecast stock prices. It analyses 24 days of market data with 22 different indicators to predict future prices up to 10 days ahead.

The system prevents "future peeking" (a common mistake in many prediction models) and uses state-of-the-art attention mechanisms to focus on the most relevant market patterns.

## How we built it

  • Advanced Transformer Architecture: Same tech as modern AI systems
  • Causal Masking: Prevents cheating by looking at future data
  • SwiGLU Activation: More powerful than standard neural networks
  • 24-Day Sequences: Learns from market patterns over time
  • 22 Technical Indicators: RSI, MACD, Bollinger Bands, and more
  • Local Attention: Focuses on recent 14-day patterns

The model processes data like this:

  1. Download stock data from Yahoo Finance
  2. Calculate technical indicators (momentum, volatility, trends)
  3. Create 24-day sliding windows of data
  4. Train Transformer to spot patterns
  5. Make predictions whilst preventing overfitting

## Challenges we ran into

  • Model Complexity: Transformers are notoriously difficult to get right
  • Data Leakage: Ensuring the model doesn't accidentally "peek" at future data
  • Attention Dimensions: Fixed critical bug where key dimensions were wrong
  • Overfitting: Balancing model power with generalisation

## Accomplishments that we're proud of

  • 92% Loss Improvement: From 0.0387 to 0.0053 during training
  • Excellent Accuracy: Mean Absolute Error of just 0.056
  • No Future Peeking: Proper causal masking for real-world use
  • Advanced Features: SwiGLU MLP, learned positional embeddings
  • Working System: Not just a concept - fully functional predictor

## What we learned

  • Advanced attention mechanisms can dramatically improve time-series prediction
  • Proper masking is crucial for real-world financial forecasting
  • State-of-the-art NLP techniques work brilliantly for financial data
  • Small architecture details (like key dimensions) make huge differences

## What's next for FairStock

  • Real-time API: Live predictions updated every market hour
  • Multiple Assets: Expand to crypto, forex, and commodities
  • Risk Assessment: Add portfolio risk analysis features
  • Mobile App: Make it accessible on phones
  • Education Mode: Teach users about technical indicators

## Social Impact This democratises advanced financial AI. Instead of only big firms having access to sophisticated prediction models, everyone can now use the same powerful technology to make informed investment decisions.

Built With

Share this project:

Updates

Submission history