Skip to main content

Installation Guide

This guide provides comprehensive installation instructions for the XAUUSD Trading Assistant AI on Windows, macOS, and Linux.

System Requirements

Minimum Requirements

  • Operating System: Windows 10+, macOS 10.14+, or Linux (Ubuntu 20.04+)
  • Python: Version 3.8 or higher
  • RAM: 4GB minimum (8GB recommended)
  • Storage: 500MB free space
  • Internet: Stable connection for API calls and market data

Required Accounts

  • MetaTrader 5 Account: Live or demo trading account
  • Groq API Key: Free tier available at console.groq.com
The bot works with both live and demo MetaTrader 5 accounts. We recommend starting with a demo account for testing.

Step 1: Install Python

  1. Download Python from python.org
  2. Run the installer
  3. Important: Check “Add Python to PATH” during installation
  4. Verify installation:
python --version
Should output Python 3.8.x or higher.

Step 2: Install MetaTrader 5

1

Download MetaTrader 5

Download from metatrader5.com or your broker’s website.
Some brokers provide custom MT5 builds. Use your broker’s version if available.
2

Install and Configure

  1. Run the MetaTrader 5 installer
  2. Complete the installation wizard
  3. Launch MT5 and log in with your trading account credentials
  4. Go to Tools → Options → Expert Advisors
  5. Enable these options:
    • ✅ Allow automated trading
    • ✅ Allow DLL imports
    • ✅ Allow WebRequests for listed URLs (add your broker’s URL)
3

Verify Connection

  • Check the connection status in the bottom-right corner (should show green bars)
  • Ensure XAUUSD is available in the Market Watch
  • Right-click Market Watch → Symbols → Search for “XAUUSD” or “Gold”
See the MetaTrader Setup Guide for detailed configuration.

Step 3: Clone the Repository

Clone the XAUUSD Trading Assistant AI repository:
git clone https://github.com/codebytemirza/XAUUSD_TRADING_ASISTENT_AI.git
cd XAUUSD_TRADING_ASISTENT_AI
If you don’t have Git installed, download the repository as a ZIP file from GitHub and extract it.

Step 4: Install Python Dependencies

Install required packages using pip:
pip install MetaTrader5 pandas numpy langchain-groq streamlit

Required Packages

  • MetaTrader5: Python integration for MT5
  • pandas: Data manipulation and analysis
  • numpy: Numerical computing
  • langchain-groq: LangChain integration for Groq LLM
  • streamlit: Web dashboard framework
If you encounter installation errors with MetaTrader5, ensure you have Visual C++ Redistributables installed on Windows.

Step 5: Configure Groq API

1

Get Your API Key

  1. Visit console.groq.com
  2. Sign up or log in
  3. Navigate to API Keys section
  4. Click Create API Key
  5. Copy your API key
See the Groq Configuration Guide for detailed instructions.
2

Create Secrets File

Create the .streamlit directory and secrets.toml file:
mkdir -p .streamlit
Create .streamlit/secrets.toml with your API key:
.streamlit/secrets.toml
GROQ_API_KEY = "gsk_your_actual_api_key_here"
3

Secure Your API Key

Add .streamlit/ to your .gitignore to prevent committing secrets:
.gitignore
.streamlit/
secrets.toml
*.env
Never commit API keys to version control. Keep your secrets.toml file private.

Step 6: Verify Installation

Test your installation by starting the dashboard:
streamlit run app.py
You should see:
You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501
Network URL: http://192.168.x.x:8501
Open the local URL in your browser. If the dashboard loads successfully, installation is complete!
If the dashboard doesn’t load, check the Troubleshooting Guide for common issues.

Project Structure

After installation, your directory should look like this:
XAUUSD_TRADING_ASISTENT_AI/
├── .streamlit/
│   └── secrets.toml          # Your API key (DO NOT COMMIT)
├── XAUSD_AI.py               # Core trading bot logic
├── app.py                    # Streamlit dashboard
├── requirements.txt          # Python dependencies
└── README.md                 # Project documentation

Optional: Running in Production

For continuous operation, consider running the bot as a background service:
Create a systemd service file:
/etc/systemd/system/xauusd-bot.service
[Unit]
Description=XAUUSD Trading Bot
After=network.target

[Service]
Type=simple
User=your-username
WorkingDirectory=/path/to/XAUUSD_TRADING_ASISTENT_AI
ExecStart=/usr/bin/streamlit run app.py
Restart=on-failure

[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl enable xauusd-bot
sudo systemctl start xauusd-bot

Next Steps

Quick Start

Run your first analysis in 5 minutes

Dashboard Guide

Learn to use the Streamlit interface

Architecture

Understand how the system works

Troubleshooting

Fix common installation issues

Getting Help

If you encounter issues during installation:
  1. Check the Troubleshooting Guide
  2. Review the FAQ
  3. Open an issue on GitHub
For assistance, include your Python version, operating system, and complete error messages when reporting issues.

Build docs developers (and LLMs) love