xauusd mt5 algo bot

    by Mohd Zaid

    1

    Deploy and configure an XAUUSD MetaTrader 5 bot using HMA filters, UT Bot signals, and ORB logic.

    $3

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    xauusd mt5 algo bot

    Example session with this skill installed

    Configure the Python XAUUSD bot with a 0.05 lot size, a 20.0 ATR stop-loss multiplier, and an HMA period of 50. Provide the updated configuration code.

    • Read your context and instructions
    • Compiled the xauusd mt5 algo

    I have updated the configuration parameters for the Python implementation of the XAUUSD bot. These changes increase the HMA period for a smoother trend filter and widen the stop-loss to 20x ATR to allow for more market noise.

    Updated Python Configuration

    
    # scripts/mt5_bot.py - Configuration Section
    
    # Instrument settings
    SYMBOL = "XAUUSD"
    TIMEFRAME = mt5.TIMEFRAME_M1
    
    # Trade execution settings
    LOT_SIZE = 0.05
    MAGIC_NUMBER = 123456
    SL_ATR_MULTIPLIER = 20.0  # Increased from 10.0
    TP_ATR_MULTIPLIER = 200.0
    
    # Indicator settings
    UT_KEY_VALUE = 2.0
    UT_ATR_PERIOD = 1
    HMA_PERIOD = 50           # Increased from 31 for slower trend detection
    
    # Opening Range Breakout (Broker Server Time)
    ORB_START = "10:10"
    ORB_END = "10:15"
    
    # Operational settings
    POLL_SECONDS = 30
    USE_CUSTOM_PERIOD = False
    

    Next steps

    1. Verify Server Time: Check your MT5 Terminal Market Watch time to ensure the ORB_START matches your broker's session opening.
    2. Demo Test: Run the script using python scripts/mt5_bot.py on a demo account to observe the wider stop-loss behavior.
    3. MQL5 Sync: If you are using the Expert Advisor version, remember to update the InpLotSize, InpSLAtrMultiplier, and InpHMAPeriod inputs in the MT5 UI to match these settings.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Deploy an automated trading strategy for XAUUSD on MetaTrader 5 using a multi-factor signal approach. This skill manages the configuration, explanation, and setup of a bot that combines UT Bot trend signals, Hull Moving Average (HMA) filtering, and Opening Range Breakout (ORB) logic. It provides both a Python-based implementation for external execution and a native MQL5 Expert Advisor for internal terminal use.

    What it does

    • Multi-factor signals: Combines UT Bot ATR trailing stops with HMA direction and ORB time windows.
    • Automated execution: Handles order entry, position flipping, and exit logic for XAUUSD.
    • Risk management: Implements ATR-based stop-loss and take-profit levels with configurable multipliers.
    • Dual implementation: Provides the strategy in both Python (via official MT5 library) and native MQL5 code.
    • Backtest configuration: Restricts signals to specific date ranges for historical performance testing.

    How it works

    1. Environment setup: Install the MetaTrader5 package and configure broker server time for ORB windows.
    2. Configuration: Define LOT_SIZE, MAGIC_NUMBER, and ATR multipliers in the script or EA inputs.
    3. Execution: Run the Python bot to interface with the terminal or compile the MQL5 Expert Advisor.
    4. Monitoring: The bot polls for new candles, calculates indicators, and manages open positions.

    Frameworks & tools

    Python 3.9+, MetaTrader 5 Terminal, official MetaTrader5 library, pandas, and MQL5.

    Why this beats prompting it yourself

    Writing reliable execution logic for MetaTrader requires specific boilerplate for position tracking and signal reversals. This skill provides a tested structure for handling magic numbers and ATR-based volatility stops that won't fail during live market polling.

    Use cases

    • Deploying a trend-following gold strategy on MT5 demo accounts.
    • Converting Python-based trading logic into native MQL5 Expert Advisors.
    • Testing the impact of Opening Range Breakout windows on HMA-filtered trends.
    • Automating XAUUSD trades based on ATR-trailing stop signals.

    Known limitations

    Requires a Windows environment to run the MetaTrader 5 terminal. Does not support other brokers or platforms like MT4 or TradingView.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 13 days ago

    Software
    PythonGit

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Listed13 days ago
    Updated9 days ago

    What's inside

    Frequently Asked Questions

    The skill includes a pre-configured Python trading script using the official MT5 library and a native MQL5 Expert Advisor (EA), allowing you to choose between external control or internal terminal execution.

    While the logic is optimized for XAUUSD (Gold), the parameters like ATR multipliers and HMA periods are fully configurable, allowing you to adapt the strategy to other volatile pairs.

    You will need a Windows environment to host the MetaTrader 5 terminal, along with Python 3.9+ and the official 'MetaTrader5' and 'pandas' libraries installed.

    The bot uses ORB logic to restrict trading to specific time windows, ensuring you only enter positions during periods of high liquidity while avoiding choppy, low-volume sessions.

    No, this skill is purpose-built for the MetaTrader 5 (MT5) ecosystem and is not backwards compatible with MT4 or cross-compatible with TradingView.

    The bot includes built-in risk management that automatically calculates stop-loss and take-profit levels based on ATR volatility, alongside 'Magic Number' tracking to prevent interference with other strategies.

    New in Trading & Investing

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Trading & Investing.