EA Pattern Scanner XAUUSD — Complete Trading Logic
➡️ https://www.mql5.com/en/market/product/211211?source=Site+Profile+Seller
Important information for everyone.
Settings here - https://eaquantumlab.net/ea-settings
Live signal 1 here - https://www.mql5.com/en/signals/
Live signal 2 here - https://www.mql5.com/en/signals/2
Important community information here - https://t.me/EAQuantumLab
Community chat here - https://t.me/Chat_EA_Quantum_Lab_Technologies
Recommendations - Instrument: XAUUSD
- Timeframe: H1 - M30
- Minimum deposit: $1,000; $10,000+ is recommended for accurate risk-based lot sizing
- Account type: ECN / Raw (low spread) Link
- VPS usage is recommended Link
- Test the EA on a demo account before trading with real funds
- Instrument: XAUUSD
- Timeframe: H1 - M30
- Minimum deposit: $1,000; $10,000+ is recommended for accurate risk-based lot sizing
- Account type: ECN / Raw (low spread) Link
- VPS usage is recommended Link
- Test the EA on a demo account before trading with real funds
1. Identifying Pivot Points
- Pivot maximum: A candle’s High is higher than the Highs of the 5 candles to its left and the 5 candles to its right. A pivot minimum is defined similarly, using the Lows.
- A pivot is confirmed only after the 5 candles to its right have closed; there is no repainting.
- Analysis is performed exclusively using the closed candles of the current timeframe, covering a history of 1,000 bars.
2. General filters for all shapes
- "Equal" levels: the difference is no more than 1 ATR (or 1% of the price when using percentage mode).
- Pattern height: at least 0.5 ATR.
- Pattern width: between 10 and 200 bars.
- Risk/reward (R:R) ratio: at least 0.8.
- Pause between signals: 10 bars.
- Breakout: the candle must close beyond the neckline, extending at least 0.05 ATR past it, with its body.
- Optional: volume must be higher than the 20-bar average multiplied by 1.2 (disabled by default).

3. Figures (8 pieces)
| Figure | How it is determined | Neckline (opening) | Signal |
|---|---|---|---|
| Double top | 2 equal maxima, with a minimum between them | minimum between the vertices | SELL |
| Double bottom | 2 equal minima, with a maximum between them | maximum between the bottoms | BUY |
| Triple Top | 3 equal maxima | the lower of the 2 minimums | SELL |
| Triple bottom | 3 equal lows | the higher of the 2 maximums | BUY |
| Head and shoulders | the middle high is 1 ATR above the outer highs; the shoulders are equal | the average of two minima | SELL |
| Inverted H&S | the middle minimum is lower than the outer ones; the shoulders are equal | the average of two maxima | BUY |
| Rising wedge | 3 rising highs and 3 rising lows, with the range having contracted by at least 30% | most recent low | SELL |
| Descending wedge | 3 declining highs and lows, contraction ≥30% | latest maximum | BUY |
If multiple patterns in the same direction are triggered on a single candle, they are combined into a single signal.
4. Deal levels
- Entry — breakout of the neckline.
- Retest — an additional level, 0.25 ATR away from the entry point (below it for a BUY, above it for a SELL).
- Stop Loss — beyond the pattern’s extreme point + 0.25 ATR.
- TP1 — the height of the pattern, measured from the neckline (for a wedge, this is the initial width of the wedge).
- TP2 — 1.618 × the height.
- The signal remains active for up to 100 bars, until TP1, TP2, or SL is hit, or the time expires.
5. Execution
- A new signal closes opposing positions and pending orders.
- Maximum of 1–3 positions per direction.
- A signal is skipped if the price is already beyond the stop-loss level, the spread is too wide, or a time filter has been triggered.
- Lot size: 1% of the account balance risked over the distance to the stop-loss level.
- Averaging (basket): 3 orders placed evenly within the zone leading up to the stop-loss level; a combined take-profit (TP) set 500 points from the average price, and a combined stop-loss set 300 points beyond the final order.
6. Support
- Breakeven: once a profit of 200 points is reached, the stop-loss is moved to +20 points.
- Trailing stop: starts at 300 points, with a distance of 200 points and a step of 50 points.
- The stop-loss is only adjusted in the direction of the trade; it is never moved further away.






