MetaTrader 5 Issues
Connection Failed
Symptoms:- Bot fails to start
- Error message: “Failed to initialize MT5”
- No market data displayed
Ensure MetaTrader 5 is Running
Ensure MetaTrader 5 is Running
- Open MetaTrader 5 desktop application
- Log in to your account
- Ensure you see live price feeds
- Keep MT5 running while using the bot
The bot requires MT5 to be running and logged in to access market data via the API.
Check Account Login Status
Check Account Login Status
- In MT5, go to Tools → Options → Server
- Verify you’re connected to the server (green icon in bottom right)
- If disconnected, re-enter your credentials
- Check your internet connection
Verify MT5 Python Package Installation
Verify MT5 Python Package Installation
Platform Compatibility
Platform Compatibility
The MetaTrader5 Python package works best on:
- Windows: Full support
- Linux: Limited support (requires Wine)
- macOS: Limited support (requires Wine or virtual machine)
Symbol Not Found
Symptoms:- Error: “XAUUSD symbol not found”
- No price data for gold
-
Check Symbol Availability:
- In MT5, right-click Market Watch
- Select “Symbols”
- Search for XAUUSD or Gold
- Ensure it’s visible in Market Watch
-
Verify Symbol Name:
- Some brokers use different naming:
XAUUSD,GOLD,XAUUSD.m - Check your broker’s symbol naming convention
- Update the symbol name in
XAUSD_AI.pyif needed
- Some brokers use different naming:
Different brokers may use different symbol names. Always verify the exact symbol name in your MT5 platform.
Data Retrieval Issues
Symptoms:- Incomplete historical data
- Missing timeframe data
- Empty dataframes
Increase Data History
Increase Data History
- In MT5, go to Tools → Options → Charts
- Set “Max bars in chart” to at least 10,000
- Set “Max bars in history” to at least 100,000
- Restart MT5
Wait for Data Synchronization
Wait for Data Synchronization
When you first add XAUUSD to Market Watch:
- MT5 needs time to download historical data
- Wait 5-10 minutes for complete synchronization
- Check the status bar for download progress
API Key Issues
Invalid Groq API Key
Symptoms:- Error: “Invalid API key”
- Authentication failed
- AI analysis not working
Verify API Key Format
Verify API Key Format
- Check
.streamlit/secrets.tomlfile exists - Ensure format is correct:
- No extra spaces or quotes
- Key should start with
gsk_
Generate New API Key
Generate New API Key
- Visit Groq Console
- Navigate to API Keys section
- Revoke old key (if compromised)
- Create new API key
- Update
.streamlit/secrets.toml - Restart the Streamlit app
Check API Quota
Check API Quota
- Free tier has rate limits
- Monitor usage in Groq Console
- Consider upgrading if hitting limits
- Wait for quota reset (usually hourly/daily)
If you’re making frequent requests, you may hit rate limits. Space out your analysis requests or upgrade your plan.
API Connection Timeout
Symptoms:- Request timeout errors
- Slow response from AI
- Connection refused
- Check internet connection
- Verify firewall isn’t blocking Groq API
- Try using a VPN if blocked in your region
- Increase timeout settings in the code
Dependency Issues
Package Installation Failures
Symptoms:pip installerrors- Module not found errors
- Version conflicts
Use Virtual Environment
Use Virtual Environment
Virtual environments prevent dependency conflicts with other Python projects.
Update pip and setuptools
Update pip and setuptools
Install Individual Packages
Install Individual Packages
If
requirements.txt fails, install packages individually:Python Version Issues
Python Version Issues
Ensure you’re using Python 3.8 or higher:If version is too old:
- Download latest Python from python.org
- Install and update PATH
- Recreate virtual environment with new version
Import Errors
Symptoms:ModuleNotFoundErrorImportError- Missing dependencies
Streamlit Dashboard Issues
Dashboard Won’t Start
Symptoms:streamlit run app.pyfails- Port already in use
- Application crashes on startup
Check if Port is Already in Use
Check if Port is Already in Use
Clear Streamlit Cache
Clear Streamlit Cache
Check File Paths
Check File Paths
Ensure you’re in the correct directory:
Dashboard Shows Errors
Symptoms:- Red error messages in dashboard
- Features not working
- No data displayed
-
Check Browser Console:
- Press F12 in browser
- Look for JavaScript errors
- Try different browser
-
Refresh the Page:
- Click “Rerun” in Streamlit
- Hard refresh: Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (Mac)
-
Check Logs:
- Look at terminal where Streamlit is running
- Check for error messages
- Debug based on error output
Streamlit dashboard errors are often displayed both in the browser and terminal. Check both locations for complete error information.
Performance Issues
Slow Analysis
Symptoms:- Analysis takes too long
- Dashboard freezes
- Timeout errors
Reduce Timeframe Analysis
Reduce Timeframe Analysis
- Focus on fewer timeframes initially
- Comment out some timeframes in
XAUSD_AI.py - Start with H4, H1, M30 for faster analysis
Optimize Historical Data Range
Optimize Historical Data Range
- Reduce the number of bars fetched
- Use smaller lookback periods
- Balance between data sufficiency and speed
System Resources
System Resources
- Close unnecessary applications
- Ensure adequate RAM (4GB+ recommended)
- Check CPU usage
- Consider upgrading hardware for intensive analysis
High Memory Usage
Solutions:- Clear Python cache regularly
- Restart the Streamlit app periodically
- Limit auto-refresh frequency
- Use smaller data batches
Data Accuracy Issues
Inconsistent Signals
This is Normal If:- Markets are volatile or choppy
- Different timeframes show conflicting signals
- Major news events are occurring
- Signals change drastically within seconds
- Data appears corrupted or unusual
- Indicators show impossible values
- Verify MT5 data feed is stable
- Check for broker server issues
- Compare with MT5’s built-in indicators
- Ensure sufficient historical data
Spread Warnings
Symptoms:- High spread alerts
- “Spread too wide” messages
- During market open/close
- Major news releases
- Low liquidity periods
- Some broker’s typical spreads
High spreads can significantly impact profitability. The bot alerts you to avoid trading during unfavorable spread conditions.
Getting Additional Help
Enable Debug Mode
Enable Debug Mode
Add debug logging to help diagnose issues:
Collect System Information
Collect System Information
When reporting issues, include:
- Python version:
python --version - Package versions:
pip list - Operating system
- MT5 version
- Error messages (complete text)
- Steps to reproduce
Community Support
Community Support
- Check GitHub Issues for similar problems
- Search existing solutions
- Create detailed issue reports
- Provide code samples and error logs
If you’ve tried all troubleshooting steps and still face issues, consider checking the updated version of the project or reaching out through GitHub Issues with detailed information about your problem.