Market Structure Gold EA User Manual

Market Structure Gold EA User Manual

27 August 2026, 13:00
Reza Aghajanpour
0
14

*** Launch Discount: For one purchase is just $47, Price is 100$.

Market Structure Gold EA: https://www.mql5.com/en/market/product/190557

Contact me to send you instruction and add you in "Market Structure Gold EA group" for sharing or seeing experiences with other users.

Live signal: myfxbook.com/members/Rezaaghajanpoor/market-structure-gold-ea/12147327

Related product: Market Structure MT5

Market Structure Gold EA v1.5

Client User Manual

Automated Gold Trading System for MetaTrader 5

1. Introduction

Market Structure Gold EA v1.5 is an automated trading system designed for Gold (XAUUSD) on MetaTrader 5.

The EA provides:

  • Automated trading

  • Three independent trading strategies

  • Optional recovery/grid management

  • ATR market-condition filter

  • Basket-level Stop Loss and Take Profit

  • Emergency broker-side Stop Loss

  • Daily drawdown protection

  • Prop Firm / FTMO-style risk controls

  • Risk-based position sizing

  • Trading-session controls

  • Friday/weekend protection

  • Real-time monitoring panel

  • Custom chart themes

The EA is designed to operate automatically once installed and configured.

2. Installation

  • Open MetaTrader 5 on your computer.
  • Go to Tools > Options > Community tab.
  • Log in using your MQL5 account login (use your username, not your email address) and password.
  • Look at the Navigator window on the left side of the screen and find the Market folder.
  • Expand it and click on Purchases (or My Purchases ).
  • Find your purchased EA in the list that appears on the right side of the platform.
  • Click the Install button next to the EA to download and install it onto your terminal.  


  • 3. Recommended Symbol

    The EA is designed primarily for:

    XAUUSD / Gold

    Different brokers may use different names, for example:

    • XAUUSD

    • GOLD

    • XAUUSDm

    • XAUUSD.a

    • XAUUSD.pro

    Use the Gold symbol provided by your broker.

    Broker specifications such as spread, minimum lot, contract size and trading hours can affect EA behavior.


    4. General Settings

    Lot size

    Default: 0.01

    Defines the basic trading lot size when fixed-lot mode is being used.

    Example:

    • 0.01 = 0.01 lot

    • 0.10 = 0.10 lot

    • 1.00 = 1 lot

    If Prop Firm risk-based sizing is enabled, the EA can calculate the lot automatically instead.


    Magic number

    Default: 20260818

    A unique identifier used by the EA to identify its own trades.

    Normally, clients should leave this unchanged unless they have a specific reason to change it.


    Order comment

    Default: Market Structure Gold

    The comment attached to trades opened by the EA.


    Maximum spread

    Default: 100

    Defines the maximum spread allowed for opening new trades.

    If the current spread is above this value, the EA will wait and will not open a new position.

    The practical value depends on your broker's symbol specifications.


    Allow only one strategy at a time

    Default: Disabled

    When enabled, the EA prevents multiple strategies from operating simultaneously.

    When disabled, the enabled strategies can operate independently, subject to the other risk and position limits.


    5. Risk Management

    Maximum recovery levels per basket

    Default: Unlimited

    Controls how many positions can belong to one recovery basket.

    • 0 = Unlimited

    • 1 = No additional recovery position

    • 5 = Maximum 5 positions in a basket

    For safer operation, using a finite number of levels is generally preferable to unlimited recovery.


    Maximum basket loss, % of balance

    Default: 0 = Disabled

    Defines the maximum permitted loss for an individual basket as a percentage of account balance.

    Example:

    Account balance = $10,000
    Setting = 5%

    Maximum basket loss:

    $500

    When the limit is reached, the affected basket is closed.


    Maximum basket duration, hours

    Default: 0 = Disabled

    Defines the maximum time a basket can remain open.

    Example:

    24

    The EA will monitor the basket and close it when the configured maximum duration is reached.


    On timeout: wait for breakeven instead of closing in loss

    Default: Disabled

    When enabled, if a basket reaches its maximum duration while still losing, the EA can wait for the basket to recover toward breakeven instead of immediately closing it at a loss.


    Daily maximum drawdown, % of day-start equity

    Default: 0 = Disabled

    Defines the maximum daily drawdown based on the account's equity at the beginning of the trading day.

    Example:

    Day-start equity = $10,000
    Limit = 5%

    Maximum daily drawdown = $500

    When the limit is reached, the EA stops opening new trades for the remainder of the trading day.


    On daily drawdown limit: close all EA positions

    Default: Disabled

    When enabled, reaching the daily drawdown limit will also close the EA's open positions.

    When disabled, the EA stops new entries but existing EA positions may remain open.


    Broker-side emergency Stop Loss

    Default: Enabled

    Provides an additional Stop Loss directly on the broker side.

    This is an emergency protection layer designed to help protect positions if there is a terminal, VPS or connection problem.

    Recommended: Keep enabled.


    Emergency Stop Loss distance, %

    Default: 3.0%

    Defines the emergency Stop Loss distance from the position entry price.

    Example:

    Gold entry = 3,000
    Emergency SL = 3%

    The emergency protection is placed approximately 3% away from the entry price.


    6. Prop Firm / FTMO Settings

    The Prop Firm section is optional.

    Enable Prop Firm risk rules

    Default: Disabled

    Enables the additional Prop Firm / FTMO-style risk management system.

    When disabled, the Prop Firm-specific rules are not applied.

    If you are trading a prop-firm account, enable this section and configure it according to the exact rules of your prop firm.


    Account start balance

    Default: 0 = Automatic

    Defines the starting balance used for Prop Firm calculations.

    0 allows the EA to automatically detect and remember the starting balance.

    For a new challenge/account, it is recommended to verify that the detected value is correct.


    Daily reset hour, server time

    Default: 0

    Defines the hour at which the EA considers a new Prop Firm trading day to begin.

    The time is based on broker/server time, not necessarily your local time.


    Safety trigger, % of limit

    Default: 95%

    Defines how close the account can get to a loss limit before the EA takes action.

    Example:

    Maximum allowed loss = $1,000
    Safety trigger = 95%

    The EA can act at approximately:

    $950

    This provides a buffer for market movement and execution conditions.


    Pop-up alert when a rule is triggered

    Default: Enabled

    Displays an alert when a Prop Firm rule is triggered.


    Reset saved Prop Firm state

    Default: Disabled

    Used when starting a new challenge or a new Prop Firm phase and the previous saved risk state needs to be cleared.

    After using this option, return it to Disabled.

    Do not enable this setting unnecessarily on an active account.


    Show Prop Firm information on panel

    Default: Enabled

    Displays Prop Firm risk information on the EA's monitoring panel.


    7. Maximum Loss / Maximum Drawdown

    Maximum drawdown calculated from

    Default: Initial account balance

    Determines the reference used to calculate maximum total drawdown.

    Available choices:

    Initial account balance

    Drawdown is calculated from the starting account balance.

    Highest equity reached

    Drawdown follows the highest equity reached by the account.

    Highest closed balance

    Drawdown follows the highest closed account balance.

    Select the option that matches your Prop Firm's rules.


    Maximum total loss / drawdown, % of base

    Default: 10%

    Defines the maximum overall loss as a percentage of the selected reference.

    0 = Disabled


    Maximum total loss / drawdown, money

    Default: 0 = Disabled

    Defines the maximum overall loss as a fixed monetary amount.

    If both percentage and money limits are configured, the stricter limit is used.


    Action when maximum loss is reached

    Available options:

    Block new trades only

    Stops new EA entries.

    Close all EA trades + block

    Closes EA positions and stops new trading.

    Close all + block + remove EA

    Closes EA positions, blocks trading and removes the EA from the chart after the EA positions are closed.


    8. Maximum Daily Loss

    Daily loss calculated from

    Default: Day-start equity

    Available options:

    Day-start equity

    Includes floating profit/loss in the daily calculation.

    Day-start balance

    Uses the account balance at the start of the trading day.


    Maximum daily loss, % of base

    Default: 5%

    Defines the maximum permitted daily loss.

    0 = Disabled


    Maximum daily loss, money

    Default: 0 = Disabled

    Defines the maximum daily loss as a fixed monetary amount.

    If both percentage and money values are configured, the stricter limit is used.


    Action when daily loss is reached

    Available options:

    • Block new trades only

    • Close all EA trades + block

    • Close all + block + remove EA


    9. Profit Target

    Overall profit target, % of starting balance

    Default: 10%

    Defines the overall profit target relative to the starting account balance.

    0 = Disabled

    Example:

    Starting balance = $10,000
    Target = 10%

    Profit target = $1,000


    Overall profit target, money

    Default: 0 = Disabled

    Defines the overall profit target as a fixed monetary amount.

    If both percentage and money targets are configured, the stricter target is used.


    Action when overall profit target is reached

    Available options:

    • Block new trades only

    • Close all EA trades + block

    • Close all + block + remove EA


    10. Trade Limits

    Only one open EA trade at a time

    Default: Disabled

    When enabled, the EA allows only one open EA position at a time.

    This setting is useful for Prop Firm accounts that require strict position control.

    When this option is enabled, recovery/grid entries are effectively disabled because an additional recovery position would create a second open trade.


    Maximum open EA positions

    Default: Unlimited

    Defines the maximum number of EA positions that may be open simultaneously.

    0 = Unlimited

    Example:

    3

    The EA will not open more than 3 EA positions simultaneously.


    11. Risk Per Trade

    Position sizing mode

    Default: Fixed lot

    Available modes:

    Fixed lot

    Uses the configured lot size.

    Risk % of balance

    Calculates the lot size according to the selected percentage of account balance.

    Fixed monetary risk

    Calculates position size according to a fixed money amount.

    Percentage + money — use the smaller lot

    Uses both risk calculations and applies the more conservative result.


    Risk per trade, % of balance

    Default: 1.0%

    Used when percentage-based risk sizing is selected.

    Example:

    Balance = $10,000
    Risk = 1%

    Target risk amount = $100


    Risk per trade, money

    Default: $100

    Used when fixed monetary risk is selected.

    Example:

    100

    The EA attempts to size the trade around a $100 risk.


    Spread risk over maximum recovery levels

    Default: Enabled

    When enabled and a finite maximum number of recovery levels is configured, the risk budget can be distributed across those levels.

    This is useful when using risk-based sizing together with recovery.


    If calculated risk is below minimum lot: use minimum lot

    Default: Enabled

    If the calculated position size is smaller than the broker's minimum allowed lot:

    • Enabled: The EA can use the broker's minimum lot.

    • Disabled: The EA skips the trade.

    Using the minimum lot can result in actual risk being higher than the calculated risk.


    Maximum lot size per trade

    Default: 0 = Disabled

    Defines a hard maximum lot size.

    Example:

    0.50

    The EA will not exceed 0.50 lot per trade.


    12. Daily Profit Target

    Daily profit target, % of base

    Default: 0 = Disabled

    Defines the maximum daily profit target as a percentage of the selected daily reference.

    Example:

    Day-start equity = $10,000
    Daily target = 2%

    Daily target = $200

    When reached, the configured daily-target action is executed.


    Daily profit target, money

    Default: 0 = Disabled

    Defines the daily profit target as a fixed monetary amount.


    Action when daily profit target is reached

    Available options:

    • Block new trades only

    • Close all EA trades + block

    • Close all + block + remove EA


    13. Trading Hours

    Restrict trading to a time window

    Default: Disabled

    When enabled, the EA only opens new trades during the configured trading period.


    Trading start time

    Default: 00:00

    Defines the beginning of the trading window.

    Server time is used.


    Trading end time

    Default: 23:59

    Defines the end of the trading window.

    Server time is used.


    Close EA positions outside trading hours

    Default: Disabled

    When enabled, EA positions can be closed when the configured trading window ends.

    Use carefully because this can close an active basket before its normal exit.


    Block recovery positions outside trading hours

    Default: Disabled

    When enabled, recovery/grid positions are also blocked outside the configured trading window.


    14. Friday / Weekend Protection

    Close positions before the weekend

    Default: Disabled

    When enabled, the EA closes its positions at the configured Friday time and prevents further EA trading afterward.


    Friday close time

    Default: 20:00

    Defines the Friday time at which the EA goes flat.

    The time is based on broker/server time.


    15. Trading Days

    Each day can be enabled or disabled.

    Trade on Sunday

    Default: Enabled

    Trade on Monday

    Default: Enabled

    Trade on Tuesday

    Default: Enabled

    Trade on Wednesday

    Default: Enabled

    Trade on Thursday

    Default: Enabled

    Trade on Friday

    Default: Enabled

    Trade on Saturday

    Default: Enabled

    Disable any day on which you do not want the EA to open trades.


    16. Chart & Monitoring Panel

    Show monitoring panel

    Default: Enabled

    Displays the EA's information panel on the chart.

    The panel provides information such as:

    • Account equity

    • Account balance

    • Floating P/L

    • Daily drawdown

    • Recovery limit

    • Basket loss protection

    • Maximum basket age

    • Emergency SL status

    • Prop Firm limits

    • Trading session

    • Risk per trade

    • Open positions

    • Active baskets

    • Current spread

    • Current server time


    Panel corner

    Default: Top-left

    Determines which corner of the chart the panel is attached to.

    Available positions:

    • Top-left

    • Top-right

    • Bottom-left

    • Bottom-right


    Panel X offset

    Default: 14 px

    Moves the panel horizontally.


    Panel Y offset

    Default: 26 px

    Moves the panel vertically.


    Panel font size

    Default: 8

    Controls the size of the text displayed in the panel.


    Panel font

    Default: Segoe UI

    Font used for panel labels.


    Panel value font

    Default: Consolas

    Font used for numerical/value information.


    17. Chart Theme

    Apply chart theme

    Default: Enabled

    Allows the EA to apply its built-in chart appearance.


    Chart theme

    Available themes:

    Midnight Gold

    Dark theme with gold accents.

    Carbon Ember

    Dark theme with warm orange/red accents.

    Deep Ocean

    Dark blue/cyan appearance.

    Obsidian Mint

    Dark appearance with mint accents.

    Platinum Light

    Light chart appearance.


    Show chart grid

    Default: Disabled

    Displays the MetaTrader chart grid.


    Hollow bullish candles

    Default: Disabled

    Displays bullish candles using a hollow style.


    Restore chart colors when EA is removed

    Default: Enabled

    When enabled, the EA attempts to restore the previous chart appearance when it is removed.


    Show basket Average / TP / SL lines

    Default: Enabled

    Displays horizontal lines for active baskets.

    The chart can show:

    • AVG — basket average entry price

    • TP — basket Take Profit level

    • SL — basket Stop Loss level

    These lines are for visual monitoring.


    18. ATR Market Filter

    The EA includes an optional market-condition filter.

    ATR filter

    Default: Enabled

    When enabled, the EA checks the recent daily trading range before allowing new signals.

    This can prevent trading when the previous day's range is outside the configured range conditions.


    ATR period, days

    Default: 4

    Defines the number of recent daily ranges used for the market-condition calculation.


    Minimum yesterday range, % of ATR

    Default: 25%

    If yesterday's range is below this percentage of the calculated ATR reference, new signals can be filtered out.


    Maximum yesterday range, % of ATR

    Default: 150%

    If yesterday's range is above this percentage of the calculated ATR reference, new signals can be filtered out.


    19. Strategy Settings

    The EA contains three selectable trading strategies.

    Each strategy can be enabled or disabled independently.


    20. Strategy A — Level Breakout & Retest

    Enable Strategy A

    Default: Enabled

    Turns Strategy A on or off.


    Zone size, %

    Default: 0.13%

    Defines the price zone used by Strategy A around the relevant market level.


    Breakout distance, %

    Default: 0.25%

    Defines the required breakout distance used by Strategy A.


    Signal timeframe

    Default: M15

    Timeframe used for Strategy A signals.


    Recovery enabled

    Default: Enabled

    Allows Strategy A to use recovery positions.


    Recovery step, %

    Default: 0.34%

    Defines the price movement required before another recovery position can be considered.


    Take Profit, %

    Default: 0.15%

    Defines the basket Take Profit distance.


    Stop Loss, %

    Default: 1.50%

    Defines the basket Stop Loss distance.


    21. Strategy B — Level Retest & Breakout

    Enable Strategy B

    Default: Enabled

    Turns Strategy B on or off.


    Zone size, %

    Default: 0.31%

    Defines the zone used by Strategy B.


    Breakout distance, %

    Default: 0.40%

    Defines the required price movement used by Strategy B.


    Signal timeframe

    Default: M12

    Timeframe used for Strategy B signals.


    Recovery enabled

    Default: Enabled

    Allows Strategy B to use recovery positions.


    Recovery step, %

    Default: 0.01%

    Defines the recovery distance for Strategy B.


    Take Profit, %

    Default: 0.01%

    Defines the basket Take Profit distance.


    Stop Loss, %

    Default: 1.50%

    Defines the basket Stop Loss distance.


    22. Strategy C — Level Retest / Pullback / Retest

    Enable Strategy C

    Default: Enabled

    Turns Strategy C on or off.


    Zone size, %

    Default: 0.28%

    Defines the zone used by Strategy C.


    Pullback distance, %

    Default: 0.40%

    Defines the required pullback distance used by Strategy C.


    Signal timeframe

    Default: M6

    Timeframe used for Strategy C signals.


    Recovery enabled

    Default: Enabled

    Allows Strategy C to use recovery positions.


    Recovery step, %

    Default: 0.32%

    Defines the recovery distance for Strategy C.


    Take Profit, %

    Default: 0.06%

    Defines the basket Take Profit distance.


    Stop Loss, %

    Default: 1.50%

    Defines the basket Stop Loss distance.


    23. Understanding the Monitoring Panel

    The panel displays the current EA state.

    STATUS

    Possible statuses include:

    TRADING

    The EA is currently allowed to trade.

    OUT OF SESSION

    The current time is outside the configured trading window.

    FLAT - WEEKEND

    The EA has reached its Friday/weekend protection time.

    BLOCKED - DAILY DD

    The EA has reached its normal daily drawdown protection.

    DAY LOCK - LOSS / TARGET

    A daily Prop Firm loss limit or daily profit target has been reached.

    HALTED - MAX LOSS / TARGET

    An overall Prop Firm loss limit or overall profit target has been reached.


    24. Open Baskets

    The panel can display active baskets.

    For each basket you may see:

    • Strategy

    • Buy/Sell direction

    • Number of levels

    • Current P/L

    • Basket age

    For example:

    S1 BUY — 3/5 — +$42.00 — 2.5h

    means:

    • Strategy 1

    • Buy basket

    • 3 positions currently open

    • Maximum 5 positions allowed

    • Current floating P/L = +$42

    • Basket has been open for approximately 2.5 hours


    25. Important Relationship Between Settings

    Some settings work together.

    One trade at a time + Recovery

    If Only one open EA trade at a time is enabled, recovery positions cannot be added because recovery requires an additional position.

    Maximum recovery levels

    If a maximum recovery level is configured, the EA stops adding positions after that limit.

    Maximum basket loss

    This protects an individual basket.

    Daily drawdown

    This protects the account on a daily basis.

    Prop Firm maximum loss

    This provides account-level protection according to the selected Prop Firm rules.

    Emergency Stop Loss

    This provides an additional broker-side protection layer.

    These protections can therefore operate at different levels.


    26. Suggested Starting Configuration

    For a first test, the following approach is recommended:

    Basic

    • Lot size: 0.01

    • Maximum spread: 100

    • Maximum recovery levels: use a finite value

    • Emergency Stop Loss: Enabled

    • ATR filter: Enabled

    Strategies

    Start with the default strategy settings.

    If you want to evaluate individual strategies separately:

    Test Strategy A only, then:

    Test Strategy B only, then:

    Test Strategy C only

    Afterward, test the combined configuration.


    27. Prop Firm Configuration Example

    For a hypothetical $10,000 account:

    Overall maximum loss

    10%

    Maximum loss:

    $1,000

    Maximum daily loss

    5%

    Daily loss:

    $500

    Overall profit target

    10%

    Profit target:

    $1,000

    Safety trigger

    95%

    The EA begins taking protective action before the absolute configured loss limit is reached.

    These are only examples. Always enter the exact limits required by your Prop Firm.


    28. Before Running the EA on a Live Account

    Please verify:

    • Gold symbol is correct

    • Algo Trading is enabled

    • Broker spread is acceptable

    • Minimum and maximum lot sizes are understood

    • Account type is compatible with your intended setup

    • Emergency Stop Loss is enabled

    • Recovery level is appropriate

    • Basket loss limit has been reviewed

    • Daily drawdown limit has been reviewed

    • Trading hours are correct

    • Broker/server time is understood

    • Friday protection is configured if required

    • Prop Firm limits match the actual account rules

    • EA has been tested on demo

    • Sufficient historical data is available


    29. Important Risk Warning

    Market Structure Gold EA is an automated trading system.

    Trading Gold can involve significant volatility, especially during major economic events and periods of high market activity.

    Recovery/grid trading can increase total exposure when the market moves against an existing position.

    Risk controls reduce exposure but cannot eliminate trading risk.

    The user is responsible for:

    • Account risk

    • Lot size

    • Prop Firm compliance

    • Broker selection

    • Trading conditions

    • VPS/connection reliability

    • Final configuration

    Always test the EA before using it on a live account.


    30. Version

    Market Structure Gold EA v1.5

    Platform: MetaTrader 5
    Primary market: Gold / XAUUSD
    Type: Automated Expert Advisor

    © 2026 Reza Aghajanpour