PythonLSTMDeep LearningFastAPIHTMLCSS
Multi-Stock Price Prediction
DL-based stock price forecasting system analyzing 5 years of market data using a 2-layer LSTM with technical indicator feature engineering.
R² = 0.98Train/test gap: 0.082-layer LSTM
Live Repository Metrics:
★ 2 stars⑂ 0 forks👁 2 watchers
accuracy / pipeline benchmarks
Model R² Score98%
Train/Test Gap8%
Feature Importance75%
languages distribution
HTML51.3%Python48.7%
performance & dataset details
5 YrsDataset Spanhistorical market data
2LSTM Layerswith dropout regularization
14msInference TimeFastAPI endpoint speed
MultiTickers Trackeddynamic selection
problem
Stock price prediction is notoriously noisy. Most toy implementations use raw OHLCV data without feature engineering, leading to models that memorize training patterns but fail on held-out windows.
approach
Used Yahoo Finance API to pull 5 years of historical data for multiple tickers. Engineered technical indicators (RSI, MACD, Bollinger Bands, moving averages) as additional features. Built a 2-layer LSTM with dropout trained on sliding windows. Served via FastAPI with an interactive frontend dashboard showing historical vs. predicted prices.
tech stack
PythonTensorFlow/KerasFastAPIPandasNumPyyfinanceMatplotlibHTML/CSSRender
results & metrics
- →R² score of 0.98 on test set with only -0.08 train/test gap (minimal overfitting)
- →Low MAE relative to price range across all tickers tested
- →Interactive dashboard with candlestick + prediction overlay visualization
learnings
- 01Technical indicators significantly improve LSTM performance over raw OHLCV - the model learns from rate-of-change, not just absolute levels
- 02R² is more informative than accuracy for regression; wrote about this distinction separately
- 03FastAPI's async handling made the multi-ticker endpoint fast enough for real-time use