Orderflow
Sweep Detector
A study you add to a chart. Ready-made charts are in the chartbook shop.
Description
Sweep Detector marks where a large market order, or a group of them, trades through several prices in a row and all of the volume is on one side. A buy sweep is ask volume with the bid at 0. A sell sweep is bid volume with the ask at 0. That usually happens in one of two ways: the order is large enough to move the price many ticks, or the book is so thin that the order moves through many prices. Smaller runs are skipped by a volume filter, and the price has to travel a minimum number of price changes before a sweep is marked.
The arrows are not buy or sell signals. A green up arrow marks the location of a buy sweep, and a red down arrow marks the location of a sell sweep. Each arrow is drawn at the close of the last bar of that sweep, and only after both filters pass: the combined volume on the active side, and the distance from the first price of the run to the last.
Key Notes
- Any volume on the opposing side ends the run. The next one-sided bar can start a new one.
- The volume counted is only the active side, ask for a buy sweep and bid for a sell sweep, added across the bars in the run.
- The distance is the price travel from the first price of the run to the last, in ticks. On this chart each bar is one price change.
- The study reads bid and ask volume. It does not place orders.
Requirements
- The chart must be a 1 price change chart. In Sierra Chart: Chart >> Chart Settings >> Bar Period >> Bar Period Type: Price Changes Per Bar, set to 1. On any other bar period the study does not run, and a message is written to the Message Log.
- For that bar period, keep the chart to 1 or 2 days. Loading many days produces a very large number of bars and slows the chart.
Important Inputs
| Input | What it does |
|---|---|
| Minimum Sweep Size | The minimum combined volume of the sweep. It starts at 24. A run below this is not marked. The range is 1 to 100000000. |
| Minimum Sweep Distance | How far the price must travel, in ticks, from the first price of the sweep to the last. It starts at 5. The range is 1 to 10000. |
| Bars To Load (0 For All) | How many recent bars are scanned. It starts at 0, which uses every bar loaded on the chart. A number smaller than Minimum Sweep Distance is raised to that distance. |