[r]MT5 ROBOT LABCONFIGURABLE STRATEGIES

Sweep & Pinbar Strategy – Previous-Candle Rejection

EA LAB / PRICE ACTION / EA016

Sweep & Pinbar

The wick takes the level.
The close tells the story.

A previous-candle sweep, a confirmed rejection and a next-bar entry. A clear price-action framework with an optional completed-timeframe EMA filter.

EA016 Sweep & Pinbar strategy artwork

THE DECISION SEQUENCE

SWEEP → RECLAIM → CONFIRM

Wait for the candle to close. Validate its shape. Check the context. Define the initial risk. Execute only when the complete rule set agrees.

What is a sweep-and-rejection setup?

Price briefly extends beyond a reference high or low, then closes back through that level. The long rejection wick can reveal a failed continuation attempt. Traders often describe this pattern as a liquidity sweep or stop hunt, but a candle chart does not prove who traded or whether stops caused the move.

The EA016 implementation uses the immediately previous candle as its reference. It does not automatically search for multi-candle swing liquidity, equal lows, session ranges or institutional order flow.

01 / BUY

Sweep the previous low

  1. Last closed candle low is below the preceding candle low by more than the configured sweep threshold.
  2. Its close is above that preceding low plus the reclaim threshold.
  3. Its bullish rejection shape passes the configured body, tail, close-location and opposite-wick tests.
  4. If enabled, its close is above the completed-source-timeframe EMA.
  5. The robot checks entry restrictions and sends a market order on the next signal bar.

02 / SELL

Sweep the previous high

  1. Last closed candle high exceeds the preceding candle high plus the sweep threshold.
  2. Its close is below that preceding high minus the reclaim threshold.
  3. A bearish rejection shape passes the mirrored checks.
  4. If enabled, its close is below the completed-source-timeframe EMA.
  5. The next signal bar provides market-entry timing, subject to execution checks.

The numbers behind the pinbar

MeasurementMeaning
Tail-to-body ratioDominant rejection wick divided by absolute candle body.
Body as a percentage of rangeControls how small the body must be compared with high minus low.
Close locationBUY close must be near the top; SELL close near the bottom.
Opposite wickLimits the wick on the side opposite the rejection tail.
Minimum bodyRejects undersized bodies independently of the optional shape filter.

Pinbar shape enabled also requires a bullish BUY candle or bearish SELL candle. Sweep and reclaim thresholds use strict comparisons. A visually attractive candle can fail the numerical rules; a wick break without the required closing reclaim is insufficient.

Worked rule example

Illustrative SELL: previous high 200.00; point size 0.01; sweep/reclaim thresholds 10 points. Trigger candle O=199.60, H=200.80, L=199.15, C=199.20. Its high sweeps 200.10 and the close reclaims below 199.90. Upper tail/body is 3.0, body/range 24.24%, close location from the high 96.97% and opposite wick 3.03%.

These shape values pass ratio 1.25, body maximum 35%, close minimum 80% and opposite wick maximum 45%. The body is only 40 points: it fails the supplied GOLD preset’s minimum body of 200 points. This is a teaching example, not a historical trade or a preset recommendation.

Context without repainting completed EMA values

The optional trend filter supports H1, H4 or D1. A signal compares its close with the last completed source-timeframe EMA. The supplied GOLD H1 example uses D1 EMA30. The visible yellow stair-step line follows those completed values; it does not display the future final value of the current daily candle.

The filter is a price-versus-EMA check. It does not require slope, crossover or a particular EMA distance. Valid filtered trades can still lose.

Initial risk and exits

Every entry has an initial hard SL: signal extreme plus buffer, closed signal-TF ATR distance or fixed points. Broker stop constraints and tick-size rounding can change the final distance. Percentage-risk sizing uses account balance and that resulting initial SL; fixed lot is an alternative.

Exit choiceTrade management
Fixed RRA broker TP based on initial stop distance. Optional trailing can close earlier.
Opposite signalA qualified opposite signal closes the own position; no fixed TP.
Trailing onlyInitial hard SL plus completed-candle trailing, without fixed TP.

Why the inside-bar pause matters

Candle trailing reads 1-4 completed M30, H1 or H4 candles. BUY uses the lowest low minus buffer; SELL the highest high plus buffer. It only tightens protection. With inside-bar pause enabled, a contained candle freezes stop advancement until a later candle closes outside the remembered mother range. A wick alone does not release the pause.

Real trade lessons from the supplied report

TradeEntry / original SL / exitAchieved price R
BUY, 28 Jan 20252741.42 / 2733.83 / 2759.35; trailing SL exit+2.36R
BUY, 29 Jan 2025 15:002758.79 / 2751.30 / 2751.50; SL exit-0.97R
SELL, 16 May 20253215.24 / 3232.26 / 3155.66; TP exit+3.50R
SELL, 19 May 20253231.68 / 3240.87 / 3235.99; SL exit-0.47R

An SL label identifies the broker execution reason. A trailing SL can realize positive R. Achieved R is measured against the original stop distance and excludes fees and swap; it is not net account return.

Actual MT5 trade examples

Original GOLD.pro H1 screenshots from the supplied v1.06 historical test. Click any chart to open the full-size image. Both winners and losses are included. Labels show achieved price R against the original stop, excluding fees and swap.

EA016 GOLD H1 actual trade example 1 — 28–30 January 2025 · BUY sequence: trailing SL +2.36R, losing SL −0.97R, then TP +3.50R. A trailing SL can realize a profit.
28–30 January 2025 · BUY sequence: trailing SL +2.36R, losing SL −0.97R, then TP +3.50R. A trailing SL can realize a profit.
EA016 GOLD H1 actual trade example 2 — 10–11 February 2025 · BUY to TP. The screenshot shows achieved price R of +3.51R; realized execution can differ slightly from the configured 3.5R target.
10–11 February 2025 · BUY to TP. The screenshot shows achieved price R of +3.51R; realized execution can differ slightly from the configured 3.5R target.
EA016 GOLD H1 actual trade example 3 — 7–10 April 2025 · A losing BUY at −1.00R followed by a winning BUY at +3.50R. The yellow line shows completed D1 EMA context.
7–10 April 2025 · A losing BUY at −1.00R followed by a winning BUY at +3.50R. The yellow line shows completed D1 EMA context.
EA016 GOLD H1 actual trade example 4 — 16–19 May 2025 · SELL examples: TP +3.50R, followed by an SL exit at −0.47R. Entry, exit and deal paths are visible.
16–19 May 2025 · SELL examples: TP +3.50R, followed by an SL exit at −0.47R. Entry, exit and deal paths are visible.
EA016 GOLD H1 actual trade example 5 — 15–16 October 2025 · BUY continuation example closed at TP +3.50R. This is an original MT5 visual-test screenshot.
15–16 October 2025 · BUY continuation example closed at TP +3.50R. This is an original MT5 visual-test screenshot.

The supplied configuration

GOLD.pro H1, D1 EMA30, 08:00-22:00 broker-server entry hours, signal-extreme SL plus 100 points, 3.5R fixed TP and H1 trailing using three candles with an 80-point buffer and inside-bar pause. The example selects 3% balance risk. These are broker-specific research settings, not universal instructions.

The example differs from the code defaults, which use trailing-only mode and have the EMA/hour filters off. Historical results must be attributed to the exact supplied SET, not every possible configuration.

How to research the idea

  1. Test the exact rules on your broker history with realistic spread, swap and execution assumptions.
  2. Use a limited parameter search and keep risk settings fixed while comparing signals.
  3. Reserve unused periods for validation; inspect neighbouring values instead of selecting a single isolated peak.
  4. Review the losing examples, gaps and periods without trades as carefully as the winners.

Educational description of the EA016 v1.06 implementation. Historical results do not guarantee future returns. Software automation does not remove trading risk. ea-lab.dev / ea@ea-lab.dev

Read the illustrated manual (PDF)   Original MT5 report

Withdraw from contract here · Paid adaptation purchase terms