MCPcopy Index your code
hub / github.com/chadyi/AITradeGame

github.com/chadyi/AITradeGame @v1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.0 ↗ · + Follow
147 symbols 369 edges 8 files 41 documented · 28%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

AITradeGame - Open Source AI Trading Simulator

English | 中文

Python 3.9+ Flask License

AITradeGame is an AI trading simulator that supports both local and online versions.

Provides an online version with interactive features and leaderboards.

Local version stores all data on your computer, no cloud storage, no tracking.

Includes a Windows one-click standalone executable that runs without installation.

Features

Desktop Version (Local)

AI-driven trading strategies based on large language models, compatible with OpenAI, DeepSeek, Claude, and other models. Leveraged portfolio management with ECharts visualizations. 100% privacy with all data stored in local database. Trading fee configuration supported to simulate real trading environment.

Latest Features: - API Provider Management: Unified management of multiple AI service provider API configurations - Smart Model Selection: Automatically fetch available model lists for each provider - Aggregated View: View aggregated assets and performance comparison across all models - System Settings: Configurable trading frequency and fee rates

Online Version (Public)

Leaderboard functionality to compete with AI enthusiasts worldwide. Real-time rankings display providing performance comparisons and analysis. Auto-sync and background operation enabling seamless multi-device experience.

Quick Start

Try Online Version

Launch the online version at https://aitradegame.com without any installation.

Desktop Version

Download AITradeGame.exe from GitHub releases. Double-click the executable to run. The interface will open automatically. Start adding AI models and begin trading.

Alternatively, clone the repository from GitHub. Install dependencies with pip install -r requirements.txt. Run the application with python app.py and visit http://localhost:5000.

Configuration

API Provider Setup

First, add AI service providers: 1. Click the "API Provider" button 2. Enter provider name, API URL, and API key 3. Manually input available models or click "Fetch Models" to auto-fetch 4. Click save to complete configuration

Adding Trading Models

After configuring providers, add trading models: 1. Click the "Add Model" button 2. Select a configured API provider 3. Choose a specific model from the dropdown 4. Enter display name and initial capital 5. Click submit to start trading

System Settings

Click the "Settings" button to configure: - Trading Frequency: Control AI decision interval (1-1440 minutes) - Trading Fee Rate: Commission rate per trade (default 0.1%)

Supported AI Models

Supports all OpenAI-compatible APIs. This includes OpenAI models like gpt-4 and gpt-3.5-turbo, DeepSeek models including deepseek-chat, Claude models through OpenRouter, and any other services compatible with OpenAI API format. More protocols are being added.

Usage

Start the server by running AITradeGame.exe or python app.py. Add AI model configuration through the web interface at http://localhost:5000. The system automatically begins trading simulation based on your configuration. Trading fees are charged for each open and close position according to the set rate, ensuring AI strategies operate under realistic cost conditions.

Privacy and Security

All data is stored in the AITradeGame.db SQLite file in the same directory as the executable. No external servers are contacted except your specified AI API endpoints. No user accounts or login required - everything runs locally.

Development

Development requires Python 3.9 or later. Internet connection is needed for market data and AI API calls.

Install all dependencies with: pip install -r requirements.txt

Contributing

Community contributions are welcome.

Disclaimer

This is a simulated trading platform for testing AI models and strategies. It is not real trading and no actual money is involved. Always conduct your own research and analysis before making investment decisions. No warranties are provided regarding trading outcomes or AI performance.

Links

Online version with leaderboard and social features: https://aitradegame.com

Desktop builds and releases: https://github.com/chadyi/AITradeGame/releases/tag/main

Source code repository: https://github.com/chadyi/AITradeGame

Core symbols most depended-on inside this repo

get_connection
called by 23
database.py
loadModels
called by 6
static/app.js
get_portfolio
called by 5
database.py
get_current_prices
called by 5
market_data.py
get_model
called by 4
database.py
get_all_models
called by 4
database.py
loadProviders
called by 4
static/app.js
add_trade
called by 3
database.py

Shape

Method 96
Function 25
Route 20
Class 6

Languages

Python64%
TypeScript36%

Modules by API surface

static/app.js53 symbols
app.py45 symbols
database.py26 symbols
trading_engine.py10 symbols
market_data.py7 symbols
ai_trader.py6 symbols

For agents

$ claude mcp add AITradeGame \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact