# Sweep and Reclaim

> Sweep and Reclaim is a strategy that trades XAUUSD on 20-tick range bars.

Source: https://algobarsx.com/docs/ex-04-sweep-and-reclaim/

```algobarsx
strategy "Sweep and Reclaim"
    market: XAUUSD
    bars: range(20)

sequence grab within 25 bars:
    step sweep: low < lowest(low, 30)[1]
    step reclaim: close > sweep.high
    step retest: low <= reclaim.close and close > reclaim.close
    reset_if: close < sweep.low

when grab.completed:
    buy risk: 1%, stop: grab.sweep.low - 3 points, target: 2.5R
```
What this script says

Sweep and Reclaim is a strategy that trades XAUUSD on 20-tick range bars.

`grab` completes when these steps happen in order within 25 bars: `sweep`, when the low is below the previous bar's lowest low of the last 30 bars; then `reclaim`, when the close is above `sweep.high`; then `retest`, when the low is at or below `reclaim.close` and the close is above `reclaim.close`. It starts over if the close is below `sweep.low`.

When `grab` completes, it buys at market, risking 1% of the balance, with a stop at the low of the `sweep` step minus 3 points and with a target 2.5R from the entry.
