AI-Powered Time Series Forecasting Meets Financial Strategy
gru-stock-backtester
is an AI-powered backtesting framework that leverages GRU-based deep learning for time series forecasting in financial markets. Built to bridge predictive analytics and trading strategy evaluation, it enables developers and data scientists to simulate, refine, and validate investment logic using historical stock data. Designed with modular components and scalable architecture, this project demonstrates expertise in Python, machine learning model integration, and quantitative strategy design. Ideal for showcasing applied knowledge in AI engineering, financial modeling, and decision-support systems.
- 📈 GRU-powered predictive modeling for stock price movements
- 🧪 Historical data simulation with flexible strategy injection
- 📊 Visual performance tracking of trades vs. predictions
- 📂 Modular architecture for easy strategy swap-ins
- Clone the repository
git clone https://github.com/your-username/gru-stock-backtester.git
- Install dependencies
pip install -r requirements.txt
- Run the demo notebook
jupyter notebook notebooks/gru_backtest_demo.ipynb
Multivariate GRU neural network trained on:
RSI, MACD, Volume Shift
Close price sequences
Simulated sentiment scoring from:
News, earnings, and social media
Hybrid trading logic using:
MACD crossovers
Sentiment thresholds
Model predictions
Performance metrics:
CAGR (Compound Annual Growth Rate)
Sharpe Ratio
Final Portfolio Value
Apple (AAPL)
Amazon (AMZN)
Tesla (TSLA)
Microsoft (MSFT)
{ 'AAPL': {'CAGR': '-0.17%', 'Final Value': 9745.86, 'Sharpe': -0.15}, 'AMZN': {'CAGR': '-0.27%', 'Final Value': 9606.56, 'Sharpe': -0.25}, 'MSFT': {'CAGR': '-0.78%', 'Final Value': 8891.12, 'Sharpe': -0.46}, 'TSLA': {'CAGR': '0.94%', 'Final Value': 11446.97, 'Sharpe': 0.33} }
See requirements.txt. Core dependencies include: numpy pandas matplotlib yfinance ta tensorflow scikit-learn
stock_backtester.ipynb — full pipeline from GRU training to backtest
requirements.txt — dependency list
README.md — this file
Integrate trained GRU instead of rolling predictions
Add true sentiment data via APIs (e.g. news or Twitter)
Deploy as an API with Flask or FastAPI
Add front-end dashboard (Plotly/Dash)
Added custom banner to README