Skip to content

Latest commit

 

History

History
221 lines (170 loc) · 4.52 KB

File metadata and controls

221 lines (170 loc) · 4.52 KB

🚀 SupertradeX Service Management Guide

This guide provides multiple reliable ways to start and manage your SupertradeX trading platform.

📋 Quick Start (Recommended)

The easiest and most reliable way to start SupertradeX:

# Start everything with auto-restart
python start_supertradex.py

This starts both the trading system and web dashboard with automatic monitoring and restart capabilities.

🎛️ Available Options

1. Service Manager (Recommended)

Starts both main trading system and web dashboard with auto-restart:

python start_supertradex.py
  • Auto-restart if services crash
  • Health monitoring
  • Process management
  • Centralized logging
  • 📊 Dashboard: http://127.0.0.1:8000

2. Individual Services

Start only specific components:

Main Trading System Only:

python start_supertradex.py --main-only

Web Dashboard Only:

python start_supertradex.py --web-only

3. Background Mode

Start in background (daemon mode):

python start_supertradex.py --background
  • Runs in background without terminal
  • Check status: python start_supertradex.py --status

4. Direct Scripts

For development/debugging:

Service Manager:

python supertradex_manager.py

Main System:

python main.py

Web Dashboard:

python run_web.py

Bash Script:

./run_supertradex.sh

🔧 Management Commands

Check Status

python start_supertradex.py --status

Kill All Processes

python start_supertradex.py --kill

Force Kill + Restart

python start_supertradex.py --force-kill

🖥️ System Service Installation

macOS (LaunchAgent)

python start_supertradex.py --install
  • Starts automatically on login
  • Runs in background
  • Managed by macOS

Linux (systemd)

python start_supertradex.py --install
  • Starts automatically on boot
  • Managed by systemd
  • Check with: sudo systemctl status supertradex

📊 Web Dashboard

Once running, access the dashboard at:

  • URL: http://127.0.0.1:8000
  • Features:
    • Real-time trading data
    • System status monitoring
    • Trade execution controls
    • Performance metrics

🔍 Troubleshooting

Services Won't Start

  1. Check virtual environment:

    source .venv/bin/activate
    pip install -r requirements.txt
  2. Kill existing processes:

    python start_supertradex.py --kill
  3. Check logs:

    tail -f supertradex_manager.log
    tail -f main.log
    tail -f web.log

Port 8000 Already in Use

# Find and kill process using port 8000
lsof -t -i:8000 | xargs kill -9

Permission Issues

# Make scripts executable
chmod +x *.py *.sh

📁 Key Files

  • start_supertradex.py - Main launcher (use this)
  • supertradex_manager.py - Service manager
  • run_supertradex.sh - Bash launcher
  • main.py - Trading system
  • run_web.py - Web dashboard

🔄 Auto-Restart Features

The service manager automatically:

  • ✅ Restarts crashed services
  • ✅ Monitors service health
  • ✅ Logs all activities
  • ✅ Handles graceful shutdowns
  • ✅ Manages process dependencies

🚨 Emergency Stops

Ctrl+C - Graceful shutdown (recommended)

Force stop everything:

pkill -f "supertradex"
pkill -f "main.py"
pkill -f "run_web.py"

📈 Production Deployment

For 24/7 trading operations:

  1. Install as system service:

    python start_supertradex.py --install
  2. Monitor logs:

    tail -f supertradex_manager.log
  3. Set up external monitoring (optional):

💡 Best Practices

  1. Always use the service manager for production
  2. Monitor logs regularly
  3. Test restarts periodically
  4. Keep backups of configuration files
  5. Monitor system resources (CPU, memory, disk)

⚡ Quick Reference

Command Purpose
python start_supertradex.py Start everything (recommended)
python start_supertradex.py --status Check what's running
python start_supertradex.py --kill Stop everything
python start_supertradex.py --background Start in background
python start_supertradex.py --install Install as system service

Dashboard: http://127.0.0.1:8000


For support, check the logs in the project directory or contact the development team.