This guide will walk you through installing ForexSmartBot on your system.
- Operating System: Windows 10+, macOS 10.15+, or Ubuntu 18.04+
- Python: 3.10 or higher
- RAM: 4GB minimum, 8GB recommended
- Storage: 1GB free space
- Internet: Required for data downloads and live trading
- Operating System: Windows 11, macOS 12+, or Ubuntu 20.04+
- Python: 3.11 or 3.12
- RAM: 8GB or more
- Storage: 5GB free space
- Internet: Stable broadband connection
-
Clone the repository
git clone https://github.com/voxhash/forexsmartbot.git cd forexsmartbot -
Create a virtual environment
# Windows python -m venv .venv .venv\Scripts\activate # macOS/Linux python3 -m venv .venv source .venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Verify installation
python app.py --version
pip install forexsmartbot-
Clone the repository
git clone https://github.com/voxhash/forexsmartbot.git cd forexsmartbot -
Build the Docker image
docker build -t forexsmartbot . -
Run the container
docker run -it --rm -p 8080:8080 forexsmartbot
-
Install Python 3.10+
- Download from python.org
- Make sure to check "Add Python to PATH" during installation
-
Install Git (if not already installed)
- Download from git-scm.com
-
Follow the general installation steps above
-
Install Python using Homebrew
brew install python@3.11
-
Install Git (if not already installed)
brew install git
-
Follow the general installation steps above
-
Update package list
sudo apt update
-
Install Python and pip
sudo apt install python3.11 python3.11-venv python3-pip git
-
Follow the general installation steps above
- PyQt6: GUI framework
- pandas: Data manipulation
- numpy: Numerical computing
- yfinance: Market data
- pyzmq: ZeroMQ for MT4 integration
- matplotlib: Charting
- pydantic: Data validation
- python-dotenv: Environment variables
- pytest: Testing framework
- black: Code formatting
- ruff: Linting
- mypy: Type checking
Create a .env file in the project root:
# Broker settings
BROKER_MODE=PAPER
MT4_ZMQ_HOST=127.0.0.1
MT4_ZMQ_PORT=5555
# Risk settings
RISK_PCT=0.02
MAX_DRAWDOWN_PCT=0.25
TRADE_AMOUNT_MIN=10
TRADE_AMOUNT_MAX=100
# UI settings
THEME=auto
DEFAULT_SYMBOLS=EURUSD,USDJPY,GBPUSDForexSmartBot creates a settings file at ~/.forexsmartbot/settings.json on first run. You can modify this file or use the Settings dialog in the application.
-
Run the application
python app.py
-
Test backtesting
python scripts/run_backtest.py --strategy SMA_Crossover --symbol EURUSD --start 2024-01-01 --end 2024-01-31
-
Test walk-forward analysis
python scripts/walk_forward.py --strategy SMA_Crossover --symbol EURUSD --start 2024-01-01 --end 2024-12-31
# Install test dependencies
pip install pytest pytest-cov
# Run all tests
pytest
# Run with coverage
pytest --cov=forexsmartbot --cov-report=html- Windows: Add Python to PATH or reinstall with "Add to PATH" checked
- macOS: Use
python3instead ofpython - Linux: Install python3-pip package
- Windows: Run Command Prompt as Administrator
- macOS/Linux: Use
sudofor system-wide installation or fix permissions
- Ensure virtual environment is activated
- Reinstall requirements:
pip install -r requirements.txt - Check Python version:
python --version
- Linux: Install GUI dependencies:
sudo apt install python3-pyqt6 - macOS: Install XQuartz if needed
- Windows: Ensure Windows 10+ with proper display drivers
- Check the Troubleshooting wiki page
- Search GitHub Issues
- Create a new issue with the bug report template
- Join community discussions
This tutorial will get you up and running with ForexSmartBot in just a few minutes.
python app.pyYou should see the ForexSmartBot main window with:
- Trading controls at the top
- Log and metrics tabs on the left
- Chart area on the right
- In the "Broker" dropdown, select "PAPER" for safe testing
- Click "Connect" - you should see "Connected to PAPER broker" in the log
- In the "Strategy" dropdown, select "SMA_Crossover"
- This is a beginner-friendly trend-following strategy
- In the "Symbols" field, enter "EURUSD"
- You can add multiple symbols separated by commas:
EURUSD,USDJPY,GBPUSD
- Set "Risk %" to 2.0 (2% risk per trade)
- This is a conservative starting point
- Click "Start Bot"
- You should see "Trading bot started" in the log
- The bot will begin analyzing the market and generating signals
- The bot downloads recent price data for EURUSD
- It calculates technical indicators (SMA, ATR)
- It generates buy/sell signals based on the strategy
- It simulates trades in paper mode (no real money)
- Check the "Log" tab for real-time activity
- Look for signal generation and trade execution messages
- Switch to the "Metrics" tab to see performance statistics
- Monitor equity, drawdown, win rate, and other key metrics
- The "Positions" tab shows any open trades
- You'll see entry price, current price, and unrealized PnL
- Buy Signal: Fast SMA crosses above slow SMA
- Sell Signal: Fast SMA crosses below slow SMA
- Stop Loss: 2x ATR below/above entry price
- Take Profit: 3x ATR above/below entry price
- Position size is calculated based on your risk percentage
- Stop losses protect against large losses
- Take profits lock in gains
- Stop the bot (click "Stop Bot")
- Change strategy to "BreakoutATR"
- Start the bot again
- This strategy looks for price breakouts with volatility filters
- Stop the bot
- Change strategy to "RSI_Reversion"
- Start the bot again
- This strategy looks for oversold/overbought conditions
python scripts/run_backtest.py --strategy SMA_Crossover --symbol EURUSD --start 2024-01-01 --end 2024-12-31python scripts/run_backtest.py --strategy SMA_Crossover --symbol EURUSD --start 2024-01-01 --end 2024-12-31 --plotpython scripts/walk_forward.py --strategy SMA_Crossover --symbol EURUSD --start 2024-01-01 --end 2024-12-31 --training 252 --testing 63- Click "Settings" button
- Explore different tabs:
- General: Strategy and data settings
- Broker: MT4 and API configuration
- Risk: Position sizing and limits
- UI: Theme and display options
- Go to Settings → General
- Check "Enable Portfolio Mode"
- Add multiple symbols:
EURUSD,USDJPY,GBPUSD - Start the bot
- Trade multiple symbols simultaneously
- Diversified risk across currency pairs
- Portfolio-level risk management
- The chart area shows price data and indicators
- Switch between symbols using the dropdown
- View different time periods
- Click "Export Trades" to save trade history
- Backtest results are automatically saved
- Logs are saved to
~/.forexsmartbot/logs/
- Check your internet connection
- Verify the symbol is correct (e.g., "EURUSD" not "EUR/USD")
- Try a different symbol
- The strategy might need more data
- Check if the market is in a suitable condition
- Try a different strategy
- Check the log for error messages
- Ensure all dependencies are installed
- Try restarting the application
After successful installation and quick start:
- Configure your Settings
- Learn about Trading Strategies
- Set up Risk Management
- Try Backtesting
deactivate
rm -rf .venvpip uninstall forexsmartbot# Remove settings directory
rm -rf ~/.forexsmartbotFor more detailed information, see the Configuration Guide and Troubleshooting pages.