XAU Cipher – Complete User Guide for Gold (XAUUSD) Trading

31 March 2026, 18:09
Antonio Simon Del Vecchio
0
64

Official User Guide for XAU Cipher

Official product page: View XAU Cipher on MQL5 Market

Official set files and updates channel: Official MQL5 Channel

In this channel I regularly publish set files and updates not only for XAU Cipher, but also for other Expert Advisors that I sell.

XAU CIPHER - USER GUIDE

1) INTRODUCTION AND TRADING CONCEPT

XAU Cipher is an Expert Advisor designed specifically for Gold (XAUUSD), a market known for sharp volatility, impulsive price behavior, and sudden changes in momentum.

This EA is not built around random entries or isolated signals. XAU Cipher works as a cycle-based execution engine, where entry, position management, and exit are part of one complete structure.

In practical terms, it can be described as a controlled reversal system with progressive position management, adapted to the behavior of Gold and supported by operational filters that help avoid unfavorable trading conditions.

The system looks for market contexts where price has shown expansion, rejection, and recovery. From there, it manages the full cycle instead of depending on one single perfect order.

  • It does not chase every price move
  • It does not enter without context
  • It does not rely on one isolated trade to perform well
  • It manages the position basket with a coherent global exit

2) RECOMMENDED USAGE

  • Recommended symbol: XAUUSD
  • Signal timeframe: M1
  • Recommended visualization timeframe: H1
  • Recommended account type: ECN or Raw Spread
  • Important note: fast execution and reasonable spread conditions are especially important when trading Gold

About spread: the EA spread parameter is not expressed in standard broker points. It is expressed in an internal system unit, so it should not be interpreted as traditional pips or points.

About Magic Number: if you run multiple EAs at the same time, or even the same EA on different charts or symbols, you should assign a different Magic Number to each instance. This ensures that each EA manages only its own positions.


3) INPUT PARAMETERS GUIDE

A. MAIN CONTROLS

Target profit per cycle (% balance)

Defines the profit target that the EA will attempt to reach for the entire trading cycle.

  • If you increase this value, the EA will target a larger cycle profit before closing. This usually makes the system more aggressive and increases market exposure time.
  • If you decrease this value, the EA will tend to close earlier. This usually reduces exposure, but also limits the profit per cycle.

Max allowed loss (% max balance)

This is one of the most important parameters in the EA. It defines the maximum allowed loss based on the highest account balance reached, not only on the initial balance.

In other words, the system keeps track of the highest balance level achieved, and then calculates the maximum tolerable loss from that reference point. If floating loss reaches that limit, the EA closes the cycle to stop further deterioration.

How to interpret it:

  • If you increase this value, the EA will tolerate a larger loss before closing. This gives more room for the cycle to recover, but it also increases risk.
  • If you decrease this value, the EA will cut losses earlier. This reduces drawdown tolerance, but it may also close cycles faster during adverse market conditions.

Simple example:

Suppose your account started at 1000 USD, but later the balance grew and the highest balance reached was 1500 USD.

If you set Max allowed loss (% max balance) = 20, the EA will allow a maximum loss equal to 20% of 1500 USD, which is 300 USD.

This means that if open trading activity causes the account to fall toward the equivalent of 1200 USD, the EA will understand that the configured loss limit has been reached and it will close the cycle.

That is why this parameter is so important: it adapts to balance growth and acts as a real risk boundary based on the highest balance your account has achieved.

Max positions per cycle

Defines the maximum number of positions that the EA can open inside one cycle.

  • If you increase this value, the system has more room to build recovery, but total exposure also becomes larger.
  • If you decrease this value, exposure becomes lower, but the system also has less flexibility to manage complex cycles.

B. POSITION SIZING

Profit projection distance (internal units)

This parameter helps project the operational distance used by the system to calculate lot size according to the cycle profit target.

  • If you increase this value, the EA assumes a wider operational distance and this usually produces a smaller lot size, making the system more conservative.
  • If you decrease this value, lot size tends to become larger, making the system more aggressive.

C. SIGNAL ENGINE

Trading direction

Allows you to define whether the EA will trade only buy positions, only sell positions, or both directions.

  • BUY ONLY: only buy trades
  • SELL ONLY: only sell trades
  • BOTH: both directions

Signal timeframe

Timeframe used to evaluate signal conditions.

  • A lower timeframe makes the system more sensitive and reactive.
  • A higher timeframe usually makes signal reading slower, but also more filtered.

The base configuration of XAU Cipher is designed to work on M1.

Range period

Period used to calculate an average reference of market movement.

  • If you increase this value, the reference becomes smoother and more stable, but less reactive.
  • If you decrease this value, the reference reacts faster to recent changes, but it can become more sensitive to noise.

Entry expansion strength

Measures how strong price expansion must be before the EA considers an entry opportunity.

  • If you increase this value, the EA becomes more selective and waits for stronger moves. There will usually be fewer trades, but more filtered ones.
  • If you decrease this value, the EA will detect expansion more easily and may enter more often, but with greater noise risk.

Wick rejection strength

Determines how clear price rejection must be through wick structure.

  • If you increase this value, the EA will demand a stronger rejection signal before considering an entry.
  • If you decrease this value, it becomes less strict and will accept weaker candle structures.

Recovery strength after expansion

Defines how much recovery price should show after expansion to validate the signal more strongly.

  • If you increase this value, the system will require stronger confirmation before entering.
  • If you decrease this value, the EA may enter earlier, but with less confirmation.

Noise tolerance (opposite wick)

Helps filter candles with weak structure or excessive noise on the opposite wick.

  • If you increase this value, the filter becomes more permissive.
  • If you decrease this value, the filter becomes stricter and rejects more candles.

Volatility threshold (panic)

Defines from which expansion level the market may be considered extreme or panic-like.

  • If you increase this value, the system becomes more tolerant of violent market movement.
  • If you decrease this value, the system will classify extreme conditions sooner.

Recovery strength in panic

Helps evaluate whether, even under extreme conditions, there is still enough recovery to avoid blocking recovery entries.

  • If you increase this value, the EA becomes more demanding inside extreme market conditions.
  • If you decrease this value, the EA becomes more permissive.

Minimum valid movement

Defines the minimum movement required for a candle or price move to be considered operationally relevant.

  • If you increase this value, the EA will ignore smaller movements and become more selective.
  • If you decrease this value, the system will accept smaller conditions and become more sensitive.

D. RECOVERY CONTROL

Distance to enable recovery (internal units)

Defines the minimum distance price must move away from the last entry before allowing a new position inside the cycle.

  • If you increase this value, entries will be spaced farther apart. This reduces density and is usually more conservative.
  • If you decrease this value, entries can occur closer to each other. This increases aggressiveness and exposure.

E. SAFETY FILTERS

Enable news filter

Activates or deactivates the news filter.

  • If enabled, the EA avoids opening trades within a time window around relevant news events.
  • If disabled, the system can trade without that additional protection.

Minutes before news

Minutes before a news event during which the EA will stop opening new trades.

  • If you increase this value, the pre-news protection window becomes wider and more conservative.
  • If you decrease this value, the EA may continue trading closer to the event.

Minutes after news

Minutes after a news event during which the EA will continue avoiding new trades.

  • If you increase this value, you give the market more time to stabilize.
  • If you decrease this value, the EA will resume trading sooner.

Max allowed spread (internal units)

Defines the maximum spread the EA will accept in order to open new trades. This value is not expressed in standard broker points, but in an internal system unit.

  • If you increase this value, the EA becomes more permissive and can trade under wider spread conditions.
  • If you decrease this value, the system becomes stricter and will trade only when execution conditions are cleaner.

F. SYSTEM SETTINGS

Magic number

Unique identifier used by the EA to recognize and manage its own positions.

  • If you run other robots or several charts, you should change this value to avoid interference.
  • It does not affect signal logic, but it is essential for correct order management.

4) OPTIMIZATION PROTOCOL

To optimize XAU Cipher professionally in MetaTrader 5, you can follow this workflow:

  • Select the XAUUSD symbol
  • Use a sufficiently wide period, preferably between 6 and 12 months
  • Use the 1 Minute OHLC model because it offers a good balance between speed and testing quality
  • Start by optimizing the most influential parameters first
  • Then validate the result on a different period to reduce overfitting risk

Key parameters recommended for optimization

Target profit per cycle (% balance)
Start: 0.10
Step: 0.10
Stop: 0.80

Max positions per cycle
Start: 4
Step: 2
Stop: 20

Profit projection distance (internal units)
Start: 50
Step: 25
Stop: 300

Entry expansion strength
Start: 1.20
Step: 0.20
Stop: 3.00

Wick rejection strength
Start: 0.80
Step: 0.20
Stop: 2.00

Recovery strength after expansion
Start: 0.20
Step: 0.10
Stop: 0.80

Distance to enable recovery (internal units)
Start: 25
Step: 25
Stop: 200

What should not be optimized too aggressively

Some parameters act more like structural stabilizers than performance accelerators. If you optimize them too aggressively, you may end up creating settings that are too tightly fitted to historical data.

  • Volatility threshold (panic)
  • Recovery strength in panic
  • Noise tolerance (opposite wick)
  • Minimum valid movement

Professional selection criteria

Do not select a configuration only because it shows the highest profit. Prioritize combinations that:

  • Keep drawdown at a reasonable level
  • Show a more stable equity curve
  • Generate a sufficient number of trades
  • Do not depend on one or two exceptional segments of the historical period

5) RISK MANAGEMENT AND EXPECTATIONS

XAU Cipher is a trading tool, not a profit guarantee. Gold can enter highly directional or extremely volatile phases, and in those conditions even a well-designed logic can go through difficult cycles.

That is why it is important to understand the following:

  • A more aggressive configuration may generate higher returns, but also deeper drawdowns
  • A more conservative configuration may reduce exposure, but also reduce growth speed
  • Broker conditions, spread, execution quality, and market context directly affect results

Good practices

  • Start on demo or with reduced risk
  • Use a broker with good execution on metals
  • Do not run multiple instances with the same Magic Number
  • Optimize with discipline and validate out of sample
  • Do not treat a strong backtest as a future guarantee

XAU Cipher was created to provide a more structured, configurable, and honest trading approach. Its value is in the way it organizes entry, recovery, and exit inside a complete cycle, not in pretending that risk can disappear.


6) OFFICIAL LINKS

EA on MQL5 Market: https://www.mql5.com/en/market/product/168697

Official set files and updates channel: https://www.mql5.com/es/channels/02ab1cc3d332dc01


XAU Cipher
Structure. Control. Cycle-based management.