# Sequences: setups that happen in steps

> Sweep, reclaim, retest, inside a bar limit.

Source: https://algobarsx.com/docs/sequences/

A `sequence` waits for its steps in order, within a number of bars. Later steps can refer to the bar where an earlier step happened, such as `sweep.high`. `reset_if` abandons the attempt. The sequence gives you `.completed`.

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

Examples: [Sweep and Reclaim](https://algobarsx.com/docs/ex-04-sweep-and-reclaim/), [Renko Pullback](https://algobarsx.com/docs/ex-21-renko-pullback/), [State Machine Momentum](https://algobarsx.com/docs/ex-60-state-machine-momentum/).
