Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Python Streamlit LSTM

📈 Asset Price Prediction Using LSTM

A Deep Learning System for Multi-Interval Financial Market Forecasting

This project is a full-stack machine learning application that predicts future prices of financial assets such as stocks, cryptocurrencies, forex pairs, and commodities using LSTM (Long Short-Term Memory) neural networks. The system integrates real-time data ingestion, technical analysis, risk analytics, and interactive visualization into a unified Streamlit dashboard.

Image

🎯 Project Objectives

  • ✔ Develop a robust LSTM model for multi-step financial time-series forecasting
  • ✔ Support multiple assets and intervals (1h, 4h, 1d)
  • ✔ Incorporate technical indicators for more stable predictions
  • ✔ Provide real-time market risk analysis (Volatility, VaR, Sharpe Ratio, Drawdown)
  • ✔ Build a user-friendly dashboard for traders, analysts, and researchers
  • ✔ Maintain a modular, scalable codebase suitable for deployment and extension
  • ✔ Cache data efficiently using SQLite to avoid redundant API calls
  • ✔ Enable live visualization of past data, predictions, and confidence intervals

📌 Key Features

🔄 Dynamic Data Fetching

  • Pulls the latest historical OHLCV data using yfinance

  • Automatically updates based on the chosen asset and interval

  • Uses SQLite caching to reduce network calls

🧠 LSTM-Based Price Prediction

  • Trains a dedicated LSTM model per asset + time interval

  • Predicts the next price and provides confidence bounds

  • Computes evaluation metrics:

  1. R² Score

  2. MAE

  3. RMSE

📦 Packages Used

- Pandas, Numpy - Matplotlib, Seaborn, Plotly - Scikit-Learn, StatsModel - Tensorflow - sqlalchemy, os - Streamlit

📊 Technical Indicators (ta / TA-Lib)

  • Integrated indicators include:

  • SMA / EMA (Simple/ Exponential Moving Average)

  • RSI (Relative Strength Index)

  • MACD ((Moving Average Convergence Divergence)

  • Bollinger Bands

  • Volatility

  • Daily Returns

These features improve the model’s predictive capability beyond raw prices.

📉 Risk Metrics Dashboard

Real-time risk evaluation: Volatility (%), Sharpe Ratio, Maximum Drawdown, Value at Risk (VaR 95%)

Image

📈 Interactive Visualization

  • Built using Plotly + Streamlit, including:

  • Historical price chart

  • Future price predictions

  • Confidence bands

  • Indicator overlays

  • Real-time metric cards

About

It predicts the next price movements based on the given period(1hr,4hr....). Using the real time market price movements data from YahooFinance. And it also depicts the risk metrics. Visualizing the price history.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages