Get your AI-powered trading system up and running in minutes!
By the end of this guide, you'll have:
- ✅ A fully operational trading system running in Docker
- ✅ Paper trading enabled with $100k virtual portfolio
- ✅ 3 AI strategies actively monitoring markets
- ✅ Real-time monitoring dashboards
- ✅ API access for system control
Before starting, ensure you have:
- Docker Desktop installed and running (Download here)
- Git installed (Download here)
- API Keys (see API Keys Section below)
- 10 minutes of your time
-
Alpaca (Stock Trading - Paper Account)
- Sign up at alpaca.markets
- Go to "Paper Trading" → "API Keys"
- Copy your API Key and Secret Key
-
Polygon (Market Data)
- Sign up at polygon.io
- Get your free API key (2 calls/minute)
-
News API (Sentiment Analysis)
- Sign up at newsapi.org
- Free tier: 1000 requests/day
-
Financial Modeling Prep (Fundamental Data)
- Sign up at financialmodelingprep.com
- Free tier: 250 requests/day
git clone <repository-url>
cd trading_system_v2# Copy the example environment file
cp .env.example .env
# Edit with your API keys (use any text editor)
nano .env # or vim .env, or code .envMinimal .env configuration:
# Required for basic functionality
ALPACA_API_KEY=your_alpaca_key_here
ALPACA_SECRET_KEY=your_alpaca_secret_here
ALPACA_BASE_URL=https://paper-api.alpaca.markets
POLYGON_API_KEY=your_polygon_key_here
# System settings
TRADING_MODE=paper
LOG_LEVEL=INFO# Start all services (this will take 2-3 minutes on first run)
docker-compose -f docker-compose.production.yml up --buildWhat's happening:
- 🐳 Building Docker containers
- 🗄️ Starting PostgreSQL database
- 🔄 Starting Redis cache
- 🤖 Initializing AI agents
- 📊 Starting monitoring services
# In a new terminal, check system status
curl http://localhost:8000/api/v1/status
# Expected response:
{
"status": "running",
"trading_active": false,
"portfolio_value": 100000.00,
"active_strategies": 3,
"system_health": "healthy"
}-
Main API: http://localhost:8000
- System status and control
-
Grafana Dashboard: http://localhost:3000
- Username:
admin - Password:
admin - Real-time system metrics
- Username:
-
Prometheus Metrics: http://localhost:9090
- Raw system metrics
Your system is now:
- 🟢 Monitoring Markets: 24/7 across stocks, crypto, and forex
- 🧠 AI Analysis: 7 specialized agents analyzing opportunities
- 📊 Paper Trading: Safe virtual trading with $100k portfolio
- 🛡️ Risk Management: Automatic position sizing and stop losses
- 📈 Strategy Execution: 3 active strategies (Covered Calls, Momentum, Mean Reversion)
curl http://localhost:8000/api/v1/portfoliocurl http://localhost:8000/api/v1/strategiescurl http://localhost:8000/api/v1/health# Check logs
docker-compose logs -f trading-system
# View specific service logs
docker-compose logs -f trading-redis
docker-compose logs -f trading-postgresSolution:
# Check if containers are running
docker ps
# If not running, restart
docker-compose -f docker-compose.production.yml up --buildSolution:
- Double-check your
.envfile has correct API keys - Ensure no extra spaces around the
=sign - Restart containers:
docker-compose down && docker-compose -f docker-compose.production.yml up --build
Solution:
# Check resource usage
docker stats
# Reduce log level in .env
LOG_LEVEL=WARNING- Review the main README.md for detailed documentation
- Check out DEPLOYMENT_GUIDE.md for advanced configuration
- Modify
config/strategies.yamlto adjust trading strategies - Update
config/agents.yamlto configure AI behavior - Edit
config/data_sources.yamlfor data source preferences
- Set up alerts in Grafana
- Review daily performance reports
- Analyze strategy effectiveness
- Get live API keys from your brokers
- Update
.envwithTRADING_MODE=live - Start with small position sizes
- Monitor closely for the first few days
- Documentation: Check README.md and DEPLOYMENT_GUIDE.md
- Logs:
docker-compose logs -f trading-system - System Status:
curl http://localhost:8000/api/v1/status - Health Check:
curl http://localhost:8000/api/v1/health
- System responds to API calls
- Grafana dashboard loads
- Portfolio shows $100k starting value
- 3 strategies are active
- No error messages in logs
- All Docker containers are "healthy"
Congratulations! Your AI trading system is now operational! 🎉
Remember: This system is running in paper trading mode with virtual money. Always test thoroughly before considering live trading.