mlstocks / README.md
github-actions[bot]
Deploy to Hugging Face Space
abf702c
metadata
title: AI Model Driven Trading Intelligence
emoji: πŸ“
colorFrom: blue
colorTo: green
sdk: docker
pinned: true

🧠 NEXUS Trading Intelligence Platform

AI-Driven Financial Analysis & Automated Model Architecture

MLStocks (NEXUS) is an advanced, open-source trading intelligence platform that unifies Classical Machine Learning, Deep Learning, and Agentic AI into a single workflow. It allows traders and developers to build, backtest, and deploy predictive models without writing complex pipelines from scratch.


οΏ½ Key Intelligence Engines

1. πŸ›οΈ NEXUS Quadrant (Classical Intelligence)

Dedicated to robust, statistical market modeling.

  • Algorithms: Random Forest, XGBoost, Linear Regression, SVM.
  • Use Case: Identifying rigid price structures, support/resistance clustering, and factor-based alpha generation.
  • Workflow: Auto-training pipelines with hyperparameter optimization.

2. οΏ½ NEXUS Neural (Deep Intelligence)

A cutting-edge deep learning environment for non-linear pattern recognition.

  • Architectures: LSTM (Long Short-Term Memory), GRU, and Transformer-based time-series models.
  • Use Case: Predicting complex sequential patterns, volatility shifts, and sentiment-market correlations.

3. πŸ€– Option Strategy Architect (Agentic AI)

A multi-agent autonomous team that debates and structures option trades in real-time.

  • The Team:
    • πŸ“Š Market Analyst: Scrapes technicals and volume profiles.
    • πŸ“° Sentiment Analyst: Parses news for event-driven risks.
    • 🧠 Strategy Advisor: Proposes complex option spreads (Iron Condors, Verticals).
    • πŸ›‘οΈ Risk Manager: Validates capital exposure and final probability.
  • Output: A final "Trade" or "Wait" decision with specific entry/exit criteria.

πŸ› οΈ Technology Stack

  • Frontend: Vue 3, Vite, TailwindCSS (Glassmorphism UI).
  • Backend: FastAPI (Python 3.10+), Uvicorn.
  • Database: Neon PostgreSQL (Async SQLAlchemy).
  • AI/LLM: Google Gemini 2.0 Flash / Llama 3 (via Ollama/Groq), Scikit-Learn, PyTorch.
  • Deployment: Docker (Monolithic), Hugging Face Spaces.

πŸš€ Getting Started

Local Development

# 1. Clone the repository
git clone https://github.com/mishrabp/mlstocks.git
cd mlstocks

# 2. Setup Backend
cd backend
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install -r requirements.txt
# Create .env file with NEON_DB_CONNECTION and GOOGLE_API_KEY

# 3. Setup Frontend
cd ../frontend
npm install
npm run dev

Docker Deployment

The project is configured for a single-container deployment suitable for Hugging Face Spaces.

docker build -t nexus-platform .
docker run -p 7860:7860 --env-file backend/.env nexus-platform

πŸ”’ Security & Privacy

  • No Data Storage: Market data is processed in-memory or ephemeral sessions.
  • API Keys: All keys (OpenAI, Gemini, HF) are stored in secure environment variables.
  • Compliance: This tool is for educational and research purposes only.

⚠️ Disclaimer

Using this software does not guarantee profits. Trading stocks, options, and futures involves substantial risk of loss. The AI agents and models provided in NEXUS are for informational assistance only and should not be construed as financial advice. Always perform your own due diligence.