Skip to content

executiveusa/CHEGGIE-AI-Trader

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

53 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Welcome to your Lovable project

Agents Dashboard (Flowise)

Python License Deploy on Railway Feishu WeChat

Five AIs battle for NASDAQ 100 supremacy. Zero human input. Pure competition.

๐ŸŽ‰ NEW: Zero-Secrets Railway Deployment!

Deploy this application to Railway without any API keys or configuration! The app runs in demo mode using local data, with optional API keys for full functionality.

๐Ÿš€ One-Click Deploy to Railway | ๐Ÿ“– Deployment Guide | ๐Ÿ”’ Zero-Secrets Architecture

Features:

  • โœ… Deploy in seconds without configuration
  • โœ… Automatic cost protection and free-tier monitoring
  • โœ… Gradual enhancement (add API keys later)
  • โœ… Built-in Coolify migration support

๐Ÿ† Current Championship Leaderboard ๐Ÿ†

click me to check

Championship Period: (Last Update 2025/10/24)

๐Ÿ† Rank ๐Ÿค– AI Model ๐Ÿ“ˆ Total Earnings
๐Ÿฅ‡ 1st DeepSeek ๐Ÿš€ +10.61%
๐Ÿฅˆ 2nd Claude-3.7 ๐Ÿ“Š +4.03%
๐Ÿฅ‰ 3rd GPT-5 ๐Ÿ“Š +3.89%
4th Qwen3-max ๐Ÿ“Š +2.49%
Baseline QQQ ๐Ÿ“Š +2.30%
5th Gemini-2.5-flash ๐Ÿ“Š -2.73%

๐Ÿ“Š Live Performance Dashboard

rank

Daily Performance Tracking of AI Models in NASDAQ 100 Trading

๐Ÿš€ Railway Deployment โ€ข ๐Ÿš€ Quick Start โ€ข ๐Ÿ“ˆ Performance Analysis โ€ข ๐Ÿ› ๏ธ Configuration Guide โ€ข ไธญๆ–‡ๆ–‡ๆกฃ


๐ŸŒŸ Project Introduction

AI-Trader enables five distinct AI models, each employing unique investment strategies, to compete autonomously in the same market and determine which can generate the highest profits in NASDAQ 100 trading!

๐ŸŽฏ Core Features

  • ๐Ÿค– Fully Autonomous Decision-Making: AI agents perform 100% independent analysis, decision-making, and execution without human intervention
  • ๐Ÿ› ๏ธ Pure Tool-Driven Architecture: Built on MCP toolchain, enabling AI to complete all trading operations through standardized tool calls
  • ๐Ÿ† Multi-Model Competition Arena: Deploy multiple AI models (GPT, Claude, Qwen, etc.) for competitive trading
  • ๐Ÿ“Š Real-Time Performance Analytics: Comprehensive trading records, position monitoring, and profit/loss analysis
  • ๐Ÿ” Intelligent Market Intelligence: Integrated Jina search for real-time market news and financial reports
  • โšก MCP Toolchain Integration: Modular tool ecosystem based on Model Context Protocol
  • ๐Ÿ”Œ Extensible Strategy Framework: Support for third-party strategies and custom AI agent integration
  • โฐ Historical Replay Capability: Time-period replay functionality with automatic future information filtering

๐ŸŽฎ Trading Environment

Each AI model starts with $10,000 to trade NASDAQ 100 stocks in a controlled environment with real market data and historical replay capabilities.

  • ๐Ÿ’ฐ Initial Capital: $10,000 USD starting balance
  • ๐Ÿ“ˆ Trading Universe: NASDAQ 100 component stocks (top 100 technology stocks)
  • โฐ Trading Schedule: Weekday market hours with historical simulation support
  • ๐Ÿ“Š Data Integration: Alpha Vantage API combined with Jina AI market intelligence
  • ๐Ÿ”„ Time Management: Historical period replay with automated future information filtering

๐Ÿง  Agentic Trading Capabilities

AI agents operate with complete autonomy, conducting market research, making trading decisions, and continuously evolving their strategies without human intervention.

  • ๐Ÿ“ฐ Autonomous Market Research: Intelligent retrieval and filtering of market news, analyst reports, and financial data
  • ๐Ÿ’ก Independent Decision Engine: Multi-dimensional analysis driving fully autonomous buy/sell execution
  • ๐Ÿ“ Comprehensive Trade Logging: Automated documentation of trading rationale, execution details, and portfolio changes
  • ๐Ÿ”„ Adaptive Strategy Evolution: Self-optimizing algorithms that adjust based on market performance feedback

๐Ÿ Competition Rules

All AI models compete under identical conditions with the same capital, data access, tools, and evaluation metrics to ensure fair comparison.

  • ๐Ÿ’ฐ Starting Capital: $10,000 USD initial investment
  • ๐Ÿ“Š Data Access: Uniform market data and information feeds
  • โฐ Operating Hours: Synchronized trading time windows
  • ๐Ÿ“ˆ Performance Metrics: Standardized evaluation criteria across all models
  • ๐Ÿ› ๏ธ Tool Access: Identical MCP toolchain for all participants

๐ŸŽฏ Objective: Determine which AI model achieves superior investment returns through pure autonomous operation!

๐Ÿšซ Zero Human Intervention

AI agents operate with complete autonomy, making all trading decisions and strategy adjustments without any human programming, guidance, or intervention.

  • โŒ No Pre-Programming: Zero preset trading strategies or algorithmic rules
  • โŒ No Human Input: Complete reliance on inherent AI reasoning capabilities
  • โŒ No Manual Override: Absolute prohibition of human intervention during trading
  • โœ… Tool-Only Execution: All operations executed exclusively through standardized tool calls
  • โœ… Self-Adaptive Learning: Independent strategy refinement based on market performance feedback

โฐ Historical Replay Architecture

A core innovation of AI-Trader Bench is its fully replayable trading environment, ensuring scientific rigor and reproducibility in AI agent performance evaluation on historical market data.

๐Ÿ”„ Temporal Control Framework

๐Ÿ“… Flexible Time Settings

{
  "date_range": {
    "init_date": "2025-01-01",  // Any start date
    "end_date": "2025-01-31"    // Any end date
  }
}

๐Ÿ›ก๏ธ Anti-Look-Ahead Data Controls

AI can only access market data from current time and before. No future information allowed.

  • ๐Ÿ“Š Price Data Boundaries: Market data access limited to simulation timestamp and historical records
  • ๐Ÿ“ฐ News Chronology Enforcement: Real-time filtering prevents access to future-dated news and announcements
  • ๐Ÿ“ˆ Financial Report Timeline: Information restricted to officially published data as of current simulation date
  • ๐Ÿ” Historical Intelligence Scope: Market analysis constrained to chronologically appropriate data availability

๐ŸŽฏ Replay Advantages

๐Ÿ”ฌ Empirical Research Framework

  • ๐Ÿ“Š Market Efficiency Studies: Evaluate AI performance across diverse market conditions and volatility regimes
  • ๐Ÿง  Decision Consistency Analysis: Examine temporal stability and behavioral patterns in AI trading logic
  • ๐Ÿ“ˆ Risk Management Assessment: Validate effectiveness of AI-driven risk mitigation strategies

๐ŸŽฏ Fair Competition Framework

  • ๐Ÿ† Equal Information Access: All AI models operate with identical historical datasets
  • ๐Ÿ“Š Standardized Evaluation: Performance metrics calculated using uniform data sources
  • ๐Ÿ” Full Reproducibility: Complete experimental transparency with verifiable results

๐Ÿ“ Project Architecture

AI-Trader Bench/
โ”œโ”€โ”€ ๐Ÿค– Core System
โ”‚   โ”œโ”€โ”€ main.py    # ๐ŸŽฏ Main program entry
โ”‚   โ”œโ”€โ”€ agent/base_agent/          # ๐Ÿง  AI agent core
โ”‚   โ””โ”€โ”€ configs/                   # โš™๏ธ Configuration files
โ”‚
โ”œโ”€โ”€ ๐Ÿ› ๏ธ MCP Toolchain
โ”‚   โ”œโ”€โ”€ agent_tools/
โ”‚   โ”‚   โ”œโ”€โ”€ tool_trade.py          # ๐Ÿ’ฐ Trade execution
โ”‚   โ”‚   โ”œโ”€โ”€ tool_get_price_local.py # ๐Ÿ“Š Price queries
โ”‚   โ”‚   โ”œโ”€โ”€ tool_jina_search.py   # ๐Ÿ” Information search
โ”‚   โ”‚   โ””โ”€โ”€ tool_math.py           # ๐Ÿงฎ Mathematical calculations
โ”‚   โ””โ”€โ”€ tools/                     # ๐Ÿ”ง Auxiliary tools
โ”‚
โ”œโ”€โ”€ ๐Ÿ“Š Data System
โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”‚   โ”œโ”€โ”€ daily_prices_*.json    # ๐Ÿ“ˆ Stock price data
โ”‚   โ”‚   โ”œโ”€โ”€ merged.jsonl           # ๐Ÿ”„ Unified data format
โ”‚   โ”‚   โ””โ”€โ”€ agent_data/            # ๐Ÿ“ AI trading records
โ”‚   โ””โ”€โ”€ calculate_performance.py   # ๐Ÿ“ˆ Performance analysis
โ”‚
โ”œโ”€โ”€ ๐ŸŽจ Frontend Interface
โ”‚   โ””โ”€โ”€ frontend/                  # ๐ŸŒ Web dashboard
โ”‚
โ””โ”€โ”€ ๐Ÿ“‹ Configuration & Documentation
    โ”œโ”€โ”€ configs/                   # โš™๏ธ System configuration
    โ”œโ”€โ”€ prompts/                   # ๐Ÿ’ฌ AI prompts
    โ””โ”€โ”€ calc_perf.sh              # ๐Ÿš€ Performance calculation script

๐Ÿ”ง Core Components Details

๐ŸŽฏ Main Program (main.py)

  • Multi-Model Concurrency: Run multiple AI models simultaneously for trading
  • Configuration Management: Support for JSON configuration files and environment variables
  • Date Management: Flexible trading calendar and date range settings
  • Error Handling: Comprehensive exception handling and retry mechanisms

๐Ÿ› ๏ธ MCP Toolchain

Tool Function API
Trading Tool Buy/sell stocks, position management buy(), sell()
Price Tool Real-time and historical price queries get_price_local()
Search Tool Market information search get_information()
Math Tool Financial calculations and analysis Basic mathematical operations

๐Ÿ“Š Data System

  • ๐Ÿ“ˆ Price Data: Complete OHLCV data for NASDAQ 100 component stocks
  • ๐Ÿ“ Trading Records: Detailed trading history for each AI model
  • ๐Ÿ“Š Performance Metrics: Sharpe ratio, maximum drawdown, annualized returns, etc.
  • ๐Ÿ”„ Data Synchronization: Automated data acquisition and update mechanisms

๐Ÿš€ Railway Deployment

Deploy CHEGGIE AI Trader to Railway with zero configuration required!

๐ŸŽฏ Zero-Secrets Architecture

This application is designed for immediate deployment without any API keys. It runs in demo mode using local historical data, with optional API keys for full functionality.

๐Ÿš‚ Deploy Options

Option 1: One-Click Deploy (Fastest)

Click the button to deploy instantly:

Deploy on Railway

Option 2: Automated Script

# Clone repository
git clone https://github.com/executiveusa/CHEGGIE-AI-Trader.git
cd CHEGGIE-AI-Trader

# Run deployment script
./deploy_railway.sh

Option 3: Railway CLI

# Install Railway CLI
npm install -g @railway/cli

# Login and deploy
railway login
railway init
railway up

โœ… What Works Out of the Box

Demo Mode (No Configuration Needed):

  • โœ… Application starts successfully
  • โœ… Uses pre-loaded NASDAQ 100 historical data
  • โœ… Mock AI trading decisions
  • โœ… All MCP services operational
  • โœ… Trading simulation with local data

Full Mode (Add API Keys Later):

  • Add OPENAI_API_KEY for real AI inference
  • Add ALPHAADVANTAGE_API_KEY for live market data
  • Add JINA_API_KEY for active web search

๐Ÿ›ก๏ธ Built-in Cost Protection

  • Automatic resource monitoring
  • Free-tier ceiling detection
  • Auto-shutdown on limit breach
  • Maintenance mode activation
  • Coolify migration support

๐Ÿ“š Comprehensive Documentation

๐Ÿ’ก Quick Tips

  1. Start with demo mode - No configuration needed
  2. Monitor resources - Check Railway dashboard regularly
  3. Add secrets gradually - Enable features as needed
  4. Plan for scale - Coolify migration ready when needed

๐Ÿš€ Quick Start

๐Ÿ“‹ Prerequisites

  • Python 3.8+
  • API Keys: OpenAI, Alpha Vantage, Jina AI

โšก One-Click Installation

Run the Flowise dashboard locally:

cp .env.example .env
docker compose up -d        # starts Flowise at :3000
pnpm dev                    # Vite app; dashboard at http://localhost:5173/agents

Deploy: reverse proxy /agents and /api/v1 to the Flowise service.

Project info

URL: https://lovable.dev/projects/dbaf2aff-f8d4-4161-b05d-40acdf00d282

How can I edit this code?

There are several ways of editing your application.

Use Lovable

Simply visit the Lovable Project and start prompting.

Changes made via Lovable will be committed automatically to this repo.

Use your preferred IDE

If you want to work locally using your own IDE, you can clone this repo and push changes. Pushed changes will also be reflected in Lovable.

The only requirement is having Node.js & npm installed - install with nvm

Follow these steps:

# Step 1: Clone the repository using the project's Git URL.
git clone <YOUR_GIT_URL>

# Step 2: Navigate to the project directory.
cd <YOUR_PROJECT_NAME>

# Step 3: Install the necessary dependencies.
npm i

# Step 4: Start the development server with auto-reloading and an instant preview.
npm run dev

Edit a file directly in GitHub

  • Navigate to the desired file(s).
  • Click the "Edit" button (pencil icon) at the top right of the file view.
  • Make your changes and commit the changes.

Use GitHub Codespaces

  • Navigate to the main page of your repository.
  • Click on the "Code" button (green button) near the top right.
  • Select the "Codespaces" tab.
  • Click on "New codespace" to launch a new Codespace environment.
  • Edit files directly within the Codespace and commit and push your changes once you're done.

What technologies are used for this project?

This project is built with:

  • Vite
  • TypeScript
  • React
  • shadcn-ui
  • Tailwind CSS

How can I deploy this project?

Simply open Lovable and click on Share -> Publish.

Can I connect a custom domain to my Lovable project?

Yes, you can!

To connect a domain, navigate to Project > Settings > Domains and click Connect Domain.

Read more here: Setting up a custom domain

โ–ฒ Vercel Deployment (SPA)

This repository now includes vercel.json for Vite + React Router SPA rewrites.

Quick deploy

npm install
npm run build

Then import the repo in Vercel and keep defaults:

  • Framework Preset: Vite
  • Build Command: npm run build
  • Output Directory: dist

Required environment variables

Set the same runtime env vars you use locally (.env) inside the Vercel project settings.

Notes

  • Client routes (e.g. /dashboard, /auth, /language) are rewritten to index.html via vercel.json.
  • For demo-only mode, no additional secrets are required.

About

"AI-Trader: Can AI Beat the Market?"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 56.5%
  • TypeScript 27.1%
  • HTML 15.4%
  • Shell 0.6%
  • CSS 0.2%
  • Batchfile 0.2%