diff --git a/.github/workflows/basic-ci.yml b/.github/workflows/basic-ci.yml index 103b780..fe4cbdd 100644 --- a/.github/workflows/basic-ci.yml +++ b/.github/workflows/basic-ci.yml @@ -1,8 +1,11 @@ -name: Basic CI +name: Basic CI -# Basic CI workflow for syntax and lint checks. -# This workflow ensures the codebase has no syntax errors and passes linting. +# Basic CI workflow for backend syntax and lint checks. +# This workflow ensures the backend codebase has no syntax errors and passes linting. # It does NOT run tests, start servers, or require external services. +# +# Note: Frontend source code is in a separate private repository. +# Frontend CI/CD is handled there. This repo only contains pre-built frontend assets. on: push: @@ -72,70 +75,43 @@ jobs: # - Core module structure is intact frontend-check: - name: Frontend Syntax Check + name: Frontend Build Check runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - # Use Node.js 20 to meet dependency requirements (commander@14.0.0 requires Node >= 20) - # Note: Dockerfile uses Node 18, but dependencies require Node 20 - - - name: Install dependencies - working-directory: ./quantdinger_vue - env: - HUSKY: 0 - # Disable husky in CI (git hooks are not needed in CI environment) + - name: Verify frontend dist exists run: | - # Project uses yarn (as specified in package.json packageManager field) - # Enable corepack to use the correct yarn version - corepack enable - # Configure yarn registry with fallback to mirror for better reliability - # Try official registry first, fallback to Taobao mirror if needed - yarn config set registry https://registry.npmjs.org/ || true - yarn config set network-timeout 300000 || true - # IMPORTANT: skip lifecycle scripts in CI to avoid running `prepare` (husky install), - # which fails because `.git` is not present in GitHub Actions checkouts by default. - # Retry logic: try up to 3 times with exponential backoff - max_retries=3 - retry_count=0 - while [ $retry_count -lt $max_retries ]; do - if yarn install --frozen-lockfile --ignore-scripts; then - echo "✓ Dependencies installed successfully" - break - else - retry_count=$((retry_count + 1)) - if [ $retry_count -lt $max_retries ]; then - echo "⚠ Install failed, retrying ($retry_count/$max_retries)..." - # Switch to Taobao mirror on retry for better reliability in China/network issues - if [ $retry_count -eq 2 ]; then - echo "Switching to Taobao mirror for retry..." - yarn config set registry https://registry.npmmirror.com/ || true - fi - sleep $((retry_count * 5)) - else - echo "✗ Failed to install dependencies after $max_retries attempts" - exit 1 - fi - fi - done - # Use --frozen-lockfile for reproducible installs. Use --ignore-scripts to keep CI non-intrusive. + # Since frontend source is in a private repo, we only verify + # that the pre-built frontend assets are present and valid + echo "Checking frontend dist directory..." + if [ -d "frontend/dist" ] && [ "$(ls -A frontend/dist 2>/dev/null)" ]; then + echo "✓ frontend/dist/ exists and is not empty" + echo "Files found:" + find frontend/dist -type f | head -20 + else + echo "⚠ frontend/dist/ is empty or missing" + echo "This is expected for initial setup. Run build-frontend.sh or wait for CI to populate it." + fi - - name: Frontend lint check - working-directory: ./quantdinger_vue + - name: Verify Nginx config run: | - # Run ESLint to check JavaScript/Vue syntax and code quality - # Using --no-fix to ensure we only check, not modify code - npm run lint:nofix - # This will FAIL if: - # - JavaScript/Vue syntax errors exist - # - ESLint rules are violated - # This will PASS if: - # - Code is syntactically valid - # - Code passes ESLint rules + echo "Checking Nginx configuration..." + if [ -f "frontend/nginx.conf" ]; then + echo "✓ frontend/nginx.conf exists" + else + echo "✗ frontend/nginx.conf is missing!" + exit 1 + fi + - name: Verify Dockerfile + run: | + echo "Checking frontend Dockerfile..." + if [ -f "frontend/Dockerfile" ]; then + echo "✓ frontend/Dockerfile exists" + else + echo "✗ frontend/Dockerfile is missing!" + exit 1 + fi diff --git a/README.md b/README.md index a41069b..c1553a4 100644 --- a/README.md +++ b/README.md @@ -3,54 +3,42 @@ QuantDinger Logo -

QuantDinger

+

QuantDinger

-
- -

- Next-Gen AI Quantitative Trading Platform -

- -

- 🤖 AI-Native · 🐍 Visual Python · 🌍 Multi-Market · 🔒 Privacy-First +

AI-Native Quantitative Trading Platform

+

Vibe Coding Meets Algo Trading

+ +

+ 7 AI Agents · Python Strategies · 10+ Exchanges · Your Server, Your Keys

-

- Build, Backtest, and Trade with an AI Co-Pilot. Better than PineScript, Smarter than SaaS. +

+ Describe your trading idea in natural language → AI writes the Python strategy → Backtest → Live trade.
+ Zero coding required. Self-hosted — your API keys and strategies never leave your machine.

-

- Official Community · - Live Demo · - 📺 Video Demo · - 🌟 Join Us +

+ 🌐 Live Demo  ·  + 📺 Video  ·  + 💬 Community  ·  + 🚀 Quick Start

-

+

License Version Python - Docker + Docker + Vibe Coding Stars

-

- Telegram Group - Discord - X +

+ Telegram + Discord + X

-

- English - Chinese - Traditional Chinese - Japanese - Korean - German - French - Thai - Vietnamese - Arabic -

+ 🇺🇸 English · 🇨🇳 简体中文 · 🇹🇼 繁體中文 · 🇯🇵 日本語 · 🇰🇷 한국어 · 🇩🇪 Deutsch · 🇫🇷 Français · 🇹🇭 ไทย · 🇻🇳 Tiếng Việt · 🇸🇦 العربية --- @@ -58,8 +46,8 @@ ## 📑 Table of Contents - [🚀 Quick Start (2 Minutes)](#-quick-start-2-minutes) -- [📖 Introduction](#-introduction) -- [📸 Visual Tour](#-visual-tour) +- [🎯 Why QuantDinger?](#-why-quantdinger) +- [📸 Visual Tour](#-visual-tour--watch-video-demo) - [✨ Key Features](#-key-features) - [🔌 Supported Exchanges & Brokers](#-supported-exchanges--brokers) - [🏗️ Architecture & Configuration](#️-architecture--configuration) @@ -139,130 +127,118 @@ BACKEND_PORT=127.0.0.1:5001 # Default: 5000 --- -## 📖 Introduction +## 🎯 Why QuantDinger? -**QuantDinger** is a **self-hosted, privacy-first AI quantitative trading platform**. Your strategies, API keys, and trading data stay on **your own machine** — not in someone else's cloud. +> **Vibe Coding for Trading** — Describe your trading idea in plain English (or any language). AI writes the Python strategy, backtests it, and deploys it to live markets. No manual coding. No SaaS lock-in. Everything runs on your own server. | | | |---|---| -| 🔒 **Privacy-First** | Your API keys, strategies, and data never leave your server | -| 🐍 **Python-Native** | Write indicators in Python, visualize on K-line charts with AI assistance | -| 🤖 **AI Co-Pilot** | Multi-agent analysis, backtest optimization, trading radar | -| 🌍 **Multi-Market** | Crypto (10+ exchanges), US Stocks (IBKR), Forex (MT5) | -| 💳 **Monetization-Ready** | Membership, credits, USDT on-chain payment — all built-in | -| ⚡ **One-Click Deploy** | `docker-compose up -d` — production-ready in 2 minutes | +| 🎵 **Vibe Coding** | Describe ideas in natural language → AI generates production-ready Python strategies | +| 🔒 **100% Self-Hosted** | API keys & strategies never leave your server — privacy by design | +| 🤖 **7 AI Agents** | Multi-agent research team: parallel analysis → debate → trade decision | +| 🐍 **Python-Native** | Full ecosystem (Pandas, NumPy, TA-Lib, scikit-learn) — no proprietary language limits | +| 📊 **Professional Charts** | K-line charts with Python indicators, real-time visualization | +| 🌍 **Crypto + Stocks + Forex** | 10+ exchanges, IBKR, MT5 — all in one platform | +| 💰 **Monetization-Ready** | Membership, credits, USDT on-chain payment — built-in | +| ⚡ **2-Minute Deploy** | `docker-compose up -d` — production-ready, zero build | --- -## 📺 Video Demo - -
- - QuantDinger Project Introduction Video - -

▶️ Click to watch the full project introduction

-
- ---- - -## 📸 Visual Tour - -
-

🗺️ System Architecture Overview

- QuantDinger System Topology -
- -
- -
-

📊 Professional Quant Dashboard

- QuantDinger Dashboard -
- -
+## 📸 Visual Tour  |  [📺 Watch Video Demo](https://youtu.be/HPTVpqL7knM) - - - - - + + + + + + + + + + +
-

🤖 AI Deep Research

-

Multi-agent market sentiment & technical analysis

- AI Market Analysis -
-

💬 Smart Trading Assistant

-

Natural language interface for market insights

- Trading Assistant +
+ Video Demo
-

📈 Indicator Analysis

-

Technical indicators with drag-and-drop

- Indicator Analysis -
-

🐍 AI Strategy Coding

-

AI-assisted Python strategy generation

- Code Generation +
+ System Topology +
🗺️ System Architecture Overview
-

📊 Portfolio Monitor

-

Track positions, set alerts, AI-powered analysis via Email/Telegram

- Portfolio Monitor +
+ Dashboard +
📊 Professional Quant Dashboard
AI Analysis
🤖 AI Deep Research
Trading Assistant
💬 Smart Trading Assistant
Indicator Analysis
📈 Indicator Analysis
Code Generation
🐍 AI Strategy Coding
Portfolio Monitor
📊 Portfolio Monitor
--- ## ✨ Key Features -### 🐍 Visual Python Strategy Workbench +### 🎵 Vibe Coding Strategy Workbench -Write indicators in **Python** (not PineScript), run them on built-in K-line charts, and let AI write the complex logic for you. Full Python ecosystem: Pandas, Numpy, TA-Lib. +> **No coding required.** Tell AI what you want in natural language — it generates production-ready Python strategies. Or write your own with the full Python ecosystem (Pandas, NumPy, TA-Lib, scikit-learn). Visualize everything on professional K-line charts. -### 📈 Complete Trading Lifecycle +``` +💬 "I want a MACD crossover strategy with RSI filter on BTC 15min" + ↓ AI generates Python code + ↓ 📈 Visualize on K-line charts + ↓ 🔄 Backtest with rich metrics + ↓ 🤖 AI suggests optimizations + ↓ 🚀 One-click deploy to live trading +``` -**Indicator → Strategy → Backtest → AI Optimize → Live Trade / Signal Notify** +### 🤖 7-Agent AI Analysis Engine -- Simplified strategy creation with smart defaults (15min K-line, 5x leverage, market order) -- AI analyzes backtest results and suggests parameter improvements -- Live trading on Crypto (10+ exchanges), US Stocks (IBKR), Forex (MT5) -- Signal notifications via Telegram, Discord, Email, SMS, Webhook +> Not just one AI call. QuantDinger deploys **7 specialized agents** that collaborate like a research team — analyze, debate, and reach consensus: -### 🤖 AI-Powered Analysis +``` +Phase 1 (Parallel): 📊 Technical · 📑 Fundamental · 📰 News · 💭 Sentiment · ⚠️ Risk +Phase 2 (Debate): 🐂 Bull vs 🐻 Bear — structured argumentation +Phase 3 (Decision): 🎯 TraderAgent → BUY / SELL / HOLD (with confidence %) +``` -- **Multi-Agent Analysis**: 5 parallel analysts + bull/bear debate + final trading decision -- **AI Trading Radar**: Auto-scans Crypto/Stocks/Forex markets hourly -- **Quick Trade Panel (⚡)**: One-click trade from any analysis signal -- **Memory-Augmented**: RAG-style local memory — agents learn from past analyses +- **🎵 Natural Language Analysis** — Ask "Analyze BTC trend for next week" → 7 agents deliver a full report +- **📡 AI Trading Radar** — Auto-scans Crypto/Stocks/Forex hourly, surfaces opportunities +- **⚡ Quick Trade Panel** — See a signal? One-click to execute. No page switching. +- **🧠 Memory-Augmented** — Agents learn from past analyses (local RAG, not cloud) +- **🔌 5+ LLM Providers**: OpenRouter (100+ models), OpenAI, Gemini, DeepSeek, Grok -### 💳 Built-in Monetization +### 📈 Full Trading Lifecycle -- **Membership Plans**: Monthly / Yearly / Lifetime with credits -- **USDT On-Chain Payment**: TRC20 scan-to-pay, HD Wallet address derivation, auto-reconciliation -- **Indicator Marketplace**: Publish, buy, and sell Python indicators with credits +| Step | What Happens | +|------|-------------| +| **1. 💬 Describe** | Tell AI your trading idea in natural language — or write Python directly | +| **2. 🤖 Generate** | AI creates the indicator & strategy code for you | +| **3. 📊 Visualize** | See signals on professional K-line charts instantly | +| **4. 🔄 Backtest** | Rich metrics + **AI analyzes results & suggests improvements** | +| **5. 🚀 Execute** | Live trade on 10+ crypto exchanges, IBKR (stocks), MT5 (forex) | +| **6. 📡 Monitor** | Portfolio tracker, alerts via Telegram/Discord/Email/SMS/Webhook | -### 🔐 User Management & Security +### 💰 Built-in Monetization -- Multi-user with PostgreSQL, role-based permissions -- Google & GitHub OAuth, email verification -- Cloudflare Turnstile captcha, rate limiting, demo mode +> Most open-source projects need months of custom billing work. QuantDinger ships with a **complete monetization system** out of the box: -### 🧠 Multi-LLM Support +- **💳 Membership Plans** — Monthly / Yearly / Lifetime tiers with configurable pricing & credits +- **₿ USDT On-Chain Payment** — TRC20 scan-to-pay, HD Wallet (xpub) per-order addresses, auto-reconciliation via TronGrid +- **🏪 Indicator Marketplace** — Users publish & sell Python indicators, you take commission +- **⚙️ Admin Dashboard** — Order management, AI usage stats, user analytics -| Provider | Models | -|----------|--------| -| **OpenRouter** | 100+ models (recommended) | -| **OpenAI** | GPT-4o, GPT-4o-mini | -| **Google Gemini** | Gemini 1.5 Flash/Pro | -| **DeepSeek** | DeepSeek Chat | -| **xAI Grok** | Grok Beta | +### 🔐 Enterprise-Grade Security + +- **Multi-User** — PostgreSQL-backed accounts with role-based permissions +- **OAuth** — Google & GitHub one-click login +- **Protection** — Cloudflare Turnstile, IP/account rate limiting, email verification +- **Demo Mode** — Read-only mode for public showcases
-🔄 Memory-Augmented Agent Architecture (Click to expand) +🧠 AI Agent Architecture Diagram (Click to expand) ```mermaid flowchart TB @@ -275,34 +251,34 @@ flowchart TB C[AgentCoordinator] D["📊 Build Context
price · kline · news · indicators"] end - subgraph Agents["🤖 Multi-Agent Workflow"] - subgraph P1["📈 Phase 1 · Analysis (Parallel)"] + subgraph Agents["🤖 7-Agent Workflow"] + subgraph P1["📈 Phase 1 · Parallel Analysis"] E1["🔍 MarketAnalyst"] E2["📑 FundamentalAnalyst"] E3["📰 NewsAnalyst"] E4["💭 SentimentAnalyst"] E5["⚠️ RiskAnalyst"] end - subgraph P2["🎯 Phase 2 · Debate"] + subgraph P2["🎯 Phase 2 · Bull vs Bear Debate"] F1["🐂 BullResearcher"] F2["🐻 BearResearcher"] end - subgraph P3["💹 Phase 3 · Decision"] + subgraph P3["💹 Phase 3 · Final Decision"] G["🎰 TraderAgent → BUY / SELL / HOLD"] end end - subgraph Memory["🧠 PostgreSQL Memory Store"] - M1[("agent memories")] + subgraph Memory["🧠 Local Memory Store"] + M1[("Agent Memories (PostgreSQL)")] end subgraph Reflect["🔄 Reflection Loop"] R[ReflectionService] - W["⏰ ReflectionWorker"] + W["⏰ ReflectionWorker → verify + learn"] end A --> B --> C --> D D --> P1 --> P2 --> P3 - Agents <-.-> M1 + Agents <-.->|"RAG retrieval"| M1 C --> R - W -.->|"verify + learn"| M1 + W -.->|"update memories"| M1 ```
@@ -337,6 +313,17 @@ flowchart TB ## 🏗️ Architecture & Configuration +### Tech Stack + +| Layer | Technology | +|-------|-----------| +| **AI Engine** | 7-Agent Multi-Agent System · RAG Memory · 5+ LLM Providers · Vibe Coding (NL→Python) | +| **Backend** | Python 3.10+ · Flask · PostgreSQL 16 · Redis (optional) | +| **Frontend** | Vue.js · Ant Design · KlineCharts · ECharts | +| **Payment** | USDT TRC20 On-Chain · HD Wallet (BIP-32/44) · TronGrid API | +| **Mobile** | Vue 3 + Capacitor (Android / iOS) | +| **Deploy** | Docker Compose · Nginx · Zero-build one-click | + ```text ┌─────────────────────────────────────┐ │ Docker Compose │ @@ -536,15 +523,6 @@ For **commercial use**, purchase a license to get: ### Acknowledgements -| Project | Link | -|---------|------| -| Flask | [flask.palletsprojects.com](https://flask.palletsprojects.com/) | -| Pandas | [pandas.pydata.org](https://pandas.pydata.org/) | -| CCXT | [github.com/ccxt/ccxt](https://github.com/ccxt/ccxt) | -| yfinance | [github.com/ranaroussi/yfinance](https://github.com/ranaroussi/yfinance) | -| Vue.js | [vuejs.org](https://vuejs.org/) | -| Ant Design Vue | [antdv.com](https://antdv.com/) | -| KlineCharts | [github.com/klinecharts/KLineChart](https://github.com/klinecharts/KLineChart) | -| ECharts | [echarts.apache.org](https://echarts.apache.org/) | +Built with ❤️ on the shoulders of: [Flask](https://flask.palletsprojects.com/) · [Pandas](https://pandas.pydata.org/) · [CCXT](https://github.com/ccxt/ccxt) · [yfinance](https://github.com/ranaroussi/yfinance) · [Vue.js](https://vuejs.org/) · [Ant Design Vue](https://antdv.com/) · [KlineCharts](https://github.com/klinecharts/KLineChart) · [ECharts](https://echarts.apache.org/) · [Capacitor](https://capacitorjs.com/) · [bip-utils](https://github.com/ebellocchia/bip_utils) -Thanks to all maintainers and contributors! ❤️ +

If QuantDinger helps you, consider ⭐ starring the repo — it means a lot!