An intelligent stock analysis platform that combines technical analysis, financial news sentiment, machine learning, risk assessment, and multi-horizon forecasting to generate explainable investment insights.
Built using Flask, XGBoost, VADER Sentiment Analysis, and modern web technologies, StockSage AI enables users to analyze publicly traded stocks and receive data-driven BUY, HOLD, or SELL recommendations.
- Simple Moving Averages (SMA 20, SMA 50)
- Exponential Moving Averages (EMA 12, EMA 26)
- Relative Strength Index (RSI)
- MACD and Signal Line
- Bollinger Bands
- Volume Analysis
- Volatility Metrics
- Trend Strength Indicators
- Live company news via Yahoo Finance
- Sector-wide news via Google News RSS
- VADER-based sentiment scoring
- Positive, Neutral, and Negative sentiment classification
- Weighted company and sector sentiment aggregation
- XGBoost classifier for next-day price direction prediction
- Probability-based bullish/bearish forecasting
- Feature importance analysis
- Confidence scoring
Predicts expected price movement across:
- 1 Week
- 1 Month
- 3 Months
- 6 Months
- 1 Year
Implemented using Ridge Regression with fallback forecasting logic for limited datasets.
- Annualized Volatility
- Maximum Drawdown
- Sharpe Ratio Analysis
- Composite Risk Score (0–100)
- Risk Categorization (Low, Medium, High)
Combines:
- Machine Learning Signal
- Sentiment Signal
- Technical Indicators
- Risk Adjustment
Generates:
- BUY Recommendation
- HOLD Recommendation
- SELL Recommendation
with confidence scores and explainable reasoning.
| Layer | Technologies |
|---|---|
| Backend | Flask, Flask-CORS |
| Data Processing | Pandas, NumPy |
| Machine Learning | XGBoost, Scikit-Learn |
| Sentiment Analysis | NLTK VADER |
| Market Data | Yahoo Finance (yfinance) |
| News Sources | Yahoo Finance News, Google News RSS |
| Frontend | HTML5, CSS3, JavaScript |
| Visualisation | Chart.js |
Market Data + News Sources ↓ Data Acquisition Layer ↓ Technical Indicator Engine ↓ Sentiment Analysis Engine ↓ Machine Learning Models ↓ Risk Assessment Module ↓ Recommendation Engine ↓ Interactive Dashboard
git clone https://github.com/yourusername/StockSage-AI.git
cd StockSage-AIpython -m venv venvActivate the environment:
Windows
venv\Scripts\activateLinux / macOS
source venv/bin/activatepip install -r requirements.txtPlace the dataset at:
data/combined_news.csv
This dataset is loaded only for offline experimentation and future training. Live analysis does not depend on this file.
python app.pyBackend URL:
http://localhost:5000
Open:
index.html
in any modern web browser.
No build tools or frontend frameworks are required.
- Enter a stock ticker symbol.
Examples:
AAPL
MSFT
GOOGL
RELIANCE.NS
TCS.NS
INFY.NS
- Select a historical analysis period.
Options:
- 3 Months
- 1 Year
- 2 Years
- 5 Years
- Click Analyze
The dashboard will display:
- Price and Trend Analysis
- Technical Indicators
- Live News Sentiment
- Machine Learning Predictions
- Feature Importance Rankings
- Risk Assessment
- Multi-Horizon Forecasts
- AI Recommendation
GET /api/searchResolves company names and ticker symbols.
GET /api/analyzeReturns:
- Historical price data
- Technical indicators
- Sentiment analysis
- Machine learning predictions
- Risk metrics
- Forecasts
- Final recommendation
GET /healthVerifies backend availability.
StockSage-AI/
│
├── app.py
├── index.html
├── requirements.txt
├── test_forecast.py
│
├── data/
│ └── combined_news.csv
│
└── README.md
Purpose:
- Predict next-day price movement
Inputs:
- Technical indicators
- Trend metrics
- Volatility metrics
- Volume metrics
- Sentiment metrics
Outputs:
- Bullish probability
- Bearish probability
- Confidence score
Purpose:
- Multi-horizon price forecasting
Forecast Periods:
- 1 Week
- 1 Month
- 3 Months
- 6 Months
- 1 Year
- LSTM-based forecasting
- Transformer-based financial models
- Prediction tracking database
- Portfolio analytics
- Backtesting framework
- Social media sentiment integration
- Earnings calendar integration
- Docker deployment
- Cloud hosting support
This project is intended for educational, research, and demonstration purposes only.
The predictions and recommendations generated by StockSage AI should not be considered financial advice. Stock markets involve risk, and past performance does not guarantee future results.
Always conduct independent research and consult a qualified financial advisor before making investment decisions.
- Yahoo Finance (yfinance)
- VADER Sentiment Analysis
- XGBoost
- Scikit-Learn
- Pandas
- NumPy
- Chart.js
- Flask









