PyStockBot is a comprehensive machine learning-powered stock prediction and analysis platform that combines advanced Python data processing with a modern web dashboard interface.
DISCLAIMER: In general, there is no preference given to any of these metrics, models, and resources, this is not a recommendation to use them. Besides implementing and categorizing them Uhstray.io and all contributors are not officially suggesting any opinion on any of these, Uhstray.io and any contributors are not financial advisors. Do your own due diligence and speak to a professional financial advisor before making any financial decisions.
PyStockBot consists of two main components:
- Data Collection: Automated fetching from Yahoo Finance, market events, and corporate actions
- Feature Engineering: 200+ technical indicators including moving averages, RSI, MACD, Bollinger Bands, ADX, Fibonacci retracements, and Hurst exponent
- Machine Learning: XGBoost and other models for price prediction and market analysis
- Multi-Asset Support: Stocks, cryptocurrencies, ETFs, and indices
- Modern UI: React 19 + Next.js 15 with TypeScript
- Professional Design: Financial-focused interface with dark/light themes
- Interactive Charts: Real-time visualizations using Recharts
- Multiple Dashboards: ML predictions, market indicators, social sentiment, earnings analysis, and asset tracking
- Responsive Design: Optimized for desktop and mobile viewing
βββ api/ # Go Huma API
β βββ controllers/
β βββ models/
β βββ middleware/
β βββ services/
βββ db/ # PostgreSQL Database
β βββ migrations/
βββ frontend/ # Next.js Application
β βββ app/
β βββ components/
β βββ hooks/
β βββ store/
βββ infra/ # Infrastructure Deployment
β βββ docker/
β βββ kubernetes/
β βββ scripts/
βββ ml-pipeline/ # Python ML Services
β βββ models/
β βββ pipelines/
β βββ serving/
β βββ streaming/
βββ tests/
- Python 3.13+
- Node.js 18+
- pnpm (for UI development)
This project uses uv
as the Python package manager for faster dependency resolution:
# Install uv
pip install -U uv
# Install Python dependencies
uv sync
# Navigate to UI directory
cd ui
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Build for production
pnpm build
# Run linting
pnpm lint
Run the Jupyter notebooks in sequence to execute the complete ML pipeline:
pull_data.ipynb
- Fetch OHLCV market data from Yahoo Financepull_events.ipynb
- Collect market events and news sentimentpull_dividends_splits.ipynb
- Gather dividend and stock split dataprepare_dataset.ipynb
- Advanced feature engineering with technical indicatorstrain_model.ipynb
- Train ML models (XGBoost, neural networks)analyze_model.ipynb
- Model evaluation and performance analysis
adx_rsi_trendlines.ipynb
- Specialized ADX and RSI analysisvalid_trendlines.ipynb
- Trendline validation and pattern recognition
- Advanced Technical Indicators: RSI, MACD, Bollinger Bands, ADX, Stochastic Oscillator
- Pattern Recognition: Fibonacci retracements, trendline analysis, support/resistance levels
- Multi-Timeframe Analysis: 7, 14, and 30-day analysis windows
- Event-Driven Features: Market events with decay factors for temporal relevance
- Ensemble Models: XGBoost, Random Forest, and neural network architectures
- ML Indicator Dashboard: AI-powered trading signals and model confidence metrics
- Market Analysis: Real-time technical indicator visualization
- Social Sentiment: News and social media sentiment analysis
- Earnings Tracker: Corporate earnings analysis and predictions
- Asset Portfolio: Multi-asset tracking and performance monitoring
- Risk Management: Volatility analysis and risk factor assessment
- Automated Data Pipeline: Scheduled data collection and processing
- Feature Engineering: 200+ engineered features per asset
- Data Validation: Comprehensive data quality checks and error handling
- Efficient Storage: Parquet format for optimized data storage and retrieval
- Data Processing: pandas, numpy, yfinance
- Machine Learning: scikit-learn, XGBoost, Keras
- Visualization: matplotlib, seaborn, plotly
- Technical Analysis: Custom implementations of financial indicators
- Package Management: uv for fast dependency resolution
- Framework: Next.js 15 with React 19
- Styling: Tailwind CSS with custom financial theme
- Components: shadcn/ui with Radix UI primitives
- Charts: Recharts for interactive financial visualizations
- Typography: Professional financial fonts (Source Sans Pro, Playfair Display)
- State Management: React hooks and context
We welcome contributions to PyStockBot! Please read our guidelines:
- Fork the repository
- Create a feature branch
- Make your changes following our coding standards
- Test thoroughly (both Python and UI components)
- Submit a pull request with detailed description
https://machinelearningmastery.com/xgboost-for-time-series-forecasting/ https://www.kaggle.com/code/faressayah/stock-market-analysis-prediction-using-lstm/notebook
https://www.youtube.com/watch?v=vV12dGe_Fho https://www.youtube.com/watch?v=z3ZnOW-S550
https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.TimeSeriesSplit.html https://pandas-datareader.readthedocs.io/en/latest/remote_data.html