Skip to content

jamie-clements/LSTM-Trading-Analysis-Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LSTM Trading Analysis Platform

Python License

A quantitative equity analysis tool combining LSTM-based price forecasting, multi-indicator technical analysis, and NLP sentiment scoring to generate interpretable trading signals via an interactive dashboard.


Problem

Retail and research traders typically rely on fragmented tools — separate platforms for technical charting, news aggregation, and price forecasting. This project unifies those signals into a single, real-time pipeline backed by a neural network model and a rule-based signal ensemble, making the decision logic explicit and auditable.


Technical Approach

Component Method
Price Forecasting LSTM (PyTorch), trained on rolling 60-day windows across 5 features
Technical Analysis RSI, MACD, Bollinger Bands, SMA/EMA, ADX, OBV, MFI
Candlestick Patterns Rule-based detection: Doji, Hammer, Engulfing, Morning Star
Sentiment Scoring TextBlob polarity scoring on real-time headlines via yfinance
Signal Ensemble Weighted vote across technical, sentiment, and forecast signals
Persistence SQLite — watchlist and analysis history

Signals are combined into a confidence-weighted BUY / HOLD / SELL recommendation. The LSTM is retrained on each analysis run using the trailing year of OHLCV data.


Stack

  • PyTorch — LSTM architecture
  • yfinance — market data and news ingestion
  • ta — technical indicator computation
  • TextBlob — NLP sentiment analysis
  • Streamlit + Plotly — interactive dashboard and charting
  • SQLite — local persistence

Getting Started

git clone https://github.com/yourusername/LSTM-Trading-Analysis-Platform.git
cd LSTM-Trading-Analysis-Platform

python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate

pip install -r requirements.txt
streamlit run src/app.py

Open http://localhost:8501 in your browser.


Project Structure

LSTM-Trading-Analysis-Platform/
├── src/
│   ├── app.py          # Streamlit entry point and UI
│   ├── analysis.py     # TechnicalAnalysis and TradingBot (signal ensemble)
│   ├── prediction.py   # PricePredictionModel (LSTM training and inference)
│   ├── sentiment.py    # NewsAnalyzer and news fetching
│   ├── portfolio.py    # PortfolioConnector (Trading 212 API and CSV)
│   ├── tracker.py      # StockTracker (SQLite persistence layer)
│   ├── models.py       # LSTM architecture and Trade dataclass
│   └── config.py       # Constants
├── requirements.txt
├── .gitignore
└── README.md

Disclaimer

This tool is for research and educational purposes only. It does not constitute financial advice. Always consult a qualified financial adviser before making investment decisions.

About

LSTM Trading Analysis Platform, combines technical analysis, machine learning, and sentiment analysis into a powerful tool for generating actionable trading insights. With real-time visualisations and predictions, it simplifies market analysis for smarter decision-making.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages