Gold Retest 24
- Experts
-
Morito Chinen
BB Quant Lab
Algorithmic trading research and EA development focused on quantitative systems for MetaTrader 5.
Developer of Relief Wave XAUUSD. - Versione: 1.2
Gold Retest 24 is a long-only Expert Advisor developed for Gold on the M15 timeframe. It identifies a confirmed breakout above a recent price range and waits for the first valid retest before opening a position.
All entry decisions use completed candles. The EA combines an M15 breakout and retest structure with a completed D1 trend filter. It does not use martingale, grid recovery, averaging down or external indicators.
Strategy logic
The EA follows a defined sequence:
-
A completed M15 candle closes above the highest price of the previous 64 candles.
-
The breakout candle must meet the minimum body-strength condition.
-
The EA waits for the first valid retest of the breakout level for up to 24 M15 candles.
-
The completed daily trend must remain positive.
-
A buy position is opened at market when all conditions are satisfied.
The strategy is long-only and is intended for Gold symbols such as GOLD or XAUUSD. Broker symbol suffixes are supported because the EA operates on the chart symbol.
Position management
-
Stop Loss: 8 times the M15 rolling Average True Range
-
Take Profit: 3 times the initial Stop Loss distance
-
Maximum holding period: 576 M15 candles
-
Maximum simultaneous positions: one position for the current symbol and Magic Number
-
Entry and management decisions: completed candles
Stop Loss and Take Profit are placed with the order. A time-based exit is used if neither level is reached within the maximum holding period.
Risk and account protection
When FixedLot is set to 0, position volume is calculated from the selected percentage of current account equity. OrderCalcProfit is used so that the estimated Stop Loss amount is converted into the account deposit currency.
The EA includes the following protections:
-
no forced rounding up when calculated volume is below the broker minimum;
-
equity floor for stopping new entries;
-
minimum margin-level requirement;
-
free-margin reserve before sending an order;
-
symbol volume-limit check;
-
spread and broker stop-level checks;
-
insufficient-funds check before order submission.
Existing positions continue to be managed if new entries are disabled by an account-protection condition.
Default setup
-
Platform: MetaTrader 5
-
Intended symbol: Gold / XAUUSD
-
Strategy timeframe: M15
-
Testing model: Every tick based on real ticks
-
Session filter: disabled by default
-
RiskPercent: 3.0
-
FixedLot: 0.0
Attach the EA to the broker's Gold chart. The internal strategy timeframe is M15.
Inputs
Money Management
-
FixedLot: fixed volume override. Set to 0 to enable percentage-risk sizing.
-
RiskPercent: target risk per trade as a percentage of current equity.
-
EquityFloorPct: stops new entries when equity falls below this percentage of equity recorded when the EA was started.
-
MinMarginLevelPct: stops new entries below the selected margin level.
-
MarginReservePct: percentage of current free margin kept unused when checking a new order.
Execution
-
MaxSpreadPrice: maximum allowed spread expressed in Gold price units.
-
MaxDeviationPrice: maximum order deviation expressed in Gold price units.
-
MagicNumber: identifier used to separate the EA's position from other trading activity.
Optional Session Filter
-
UseSessionFilter: enables or disables the broker-server-hour filter.
-
SessionStartHour: first allowed broker server hour.
-
SessionEndHour: first excluded broker server hour.
Testing notes
Backtest screenshots show Strategy Tester results and are not live trading results. Historical results can change with the broker's price history, spread, execution settings, swaps, commissions, contract specification and account currency.
The EA does not guarantee profit. Test the product with the intended broker symbol and account conditions before use.
