TL;DR. A line that follows price only when price moves further than a smoothed measure of its own bar-to-bar movement. In a trend it steps along behind price; in chop it goes flat. Its direction is a clean trend gate, and its buy and sell signals alternate.
What it measures
- Whether a move is bigger than the usual noise. The filter ignores any move smaller than the smoothed range, so small back-and-forth bars leave it where it is.
- The trend's side. The direction output reads 1 after the filter last rose and -1 after it last fell, and holds through flat bars.
- How far price must go to move the line. The upper and lower targets sit one smoothed range either side of the filter.
Formula
Inputs in AlgoLift
| Setting | Default | Range | Notes |
|---|---|---|---|
| Sampling Period | 100 | 2 to 500 | Bars in the range average. The widely copied community setting is 100; the original listing is quoted as 15. |
| Range Multiplier | 3 | 0.1 to 20 | How many smoothed ranges price must move before the line follows. |
| Source | Close | Close, Open, High, Low, HL2, HLC3, OHLC4 | Which value of each bar the filter follows. |
Outputs in AlgoLift
| Handle | Type | Plotted | Notes |
|---|---|---|---|
| Filter | Numeric | Always | The filter line, in price units. |
| Upper Target | Numeric | Always | The filter plus one smoothed range. |
| Lower Target | Numeric | Always | The filter less one smoothed range. |
| Direction | Numeric | On select | 1 after the filter last rose, -1 after it last fell, 0 before its first move. |
| Signal | Numeric | Always | +1 on a buy, -1 on a sell, 0 elsewhere. Drawn as markers on the chart. The first state taken is not a signal. |
How to read it
- Direction 1 and price above the filter: an up state. The line will keep stepping up as long as price keeps moving more than the range.
- A flat filter: price is moving less than its usual range, the market is ranging, and the line is waiting.
- A buy (+1): the first bar price pushes the filter up after a sell. A sell (-1) is the mirror. Signals always alternate, so two buys never come in a row.
- Wide targets: a large range means volatile bars; the filter needs a bigger move before it follows.
Best in, worst in
Best in markets that trend in clear legs, where the flat stretches keep you out of the chop between them.
Worst in sharp reversals: the filter needs a full range of movement the other way before it turns, so it gives back part of the move. On very short periods it follows price closely and flips often.
Three setups
1. Trade the buy and sell signals
Wire Signal into a Comparison greater than 0 for the long Entry, and less than 0 for the short entry. The signals alternate, so the strategy flips side on each one.
2. Direction as a trend gate
Compare Direction equal to 1 and AND it into another entry, for example an RSI pullback. Longs only while the filter last rose, shorts only while it last fell.
3. The filter as a trailing exit
Hold a long while price stays above Filter, and exit through Set Exit Condition when the close falls below it. The line does not move in chop, so the exit only tightens when price makes progress.
Common mistakes
- Forgetting the warmup. At the default period the line needs 298 bars before its first value; on daily bars that is more than a year of history.
- Reading direction as a signal. Direction is a state that holds for many bars. Use Signal when you want one trade per turn, or a Crossover on direction.
- Tuning the multiplier finely. A rule that works at 2.8 and fails at 2.6 and 3.0 has found noise (overfitting in trading).
The Range Filter moves only on moves bigger than its own smoothed range: a trend gate that stays flat in chop, with alternating buy and sell signals.