# Gold Breakout EA for XAUUSD H4

Buys when an H4 bar closes above the 20-bar high in an uptrend, with a 2 ATR stop and a 2R target.

Canonical: https://prismaticalgos.com/compendium/algo/4471-gold-breakout-ea-for-xauusd-h4
Record ID: 4471
Catalog rank: 62 (reading order, not performance)
Snapshot: 2026-10-31 15:46 UTC
Family: Trend Following & Directional (A)
Source: https://www.mql5.com/en/code/77691
Evidence label (unverified): backtest_shown

## Scope and limitations

These are machine-extracted research records, not verified trading systems. Catalog rank measures specification detail and claimed evidence, not profitability. The catalog extraction pipeline did not independently backtest these records. Its separate selected testing ledger does not validate the wider corpus. Rules, labels and parameters can be incomplete or wrong; consult the original source and its reuse terms.

No endorsement, ownership claim or source-code reuse permission is implied.

## Extraction warnings

No automated warnings recorded; this is not validation.

## Recorded profile

- symbols: XAUUSD
- timeframes: H4
- sessions: Not specified
- market_regime: trending

## Indicators

- 200 EMA: {"period": 200}; applied to: close

## Recorded long-entry rules

- Close of the H4 bar above the highest high of the previous 20 bars, and the bar before it did not close above it

## Recorded short-entry rules

- Not specified.

## Recorded exit rules

- 2 x ATR(20) below the fill price as stop, 2R above the fill price as target

## Recorded filters

- 200 EMA filter
- spread more than 10% of the stop cancels the position
- last 15 minutes before the trading session closes cancels the position

## Risk controls

- Stop loss: 2 x ATR(20) below the fill price
- Take profit: 2R above the fill price
- Position sizing: OrderCalcProfit() from the stop distance
