ProIndicatr Pro: 4 Pro indicators
indicator.trading
All scripts

Free Β· Open source

Range-Filtered Momentum

Momentum crosses only when the market is really trending.

Type
Momentum with range filter
Replaces
MACD Β· TSI Β· TRIX Β· AO
Recommended
4h and daily chart
Price
Free, open source
Open chart on TradingView
Range-Filtered Momentum with ATR-normalized MACD and ADX filter below a gold 4h chart, with gray range phases and marked crosses
Range-Filtered Momentum with ATR-normalized MACD and ADX filter below a gold 4h chart, with gray range phases and marked crosses

Range-Filtered Momentum takes a momentum indicator such as the MACD and mutes it during sideways phases: the line and histogram turn gray, and no crosses are marked. Only when the market is trending do bullish and bearish crosses appear. On top of that, the value can be divided by the ATR – so a MACD of 1 on gold means the same as on Bitcoin or EUR/USD. You can choose from seven momentum sources. This page explains every element – and above all, what you do with it and why.

Overview

At a glance

What does it do?

It shows momentum like a MACD – and grays everything out as long as the market is moving sideways. Crosses are only marked in trend phases.

What do I do with it?

You only read crosses when they’re colored and deliberately skip the gray phases.

Why?

In sideways phases, the momentum and signal lines cross all the time. Those crosses carry little information but cost money.

What do I get?

Less noise, clearer signals – and values you can compare across markets and timeframes.

On your chart in 2 minutes

Quickstart

  1. 01

    Open the script page

    The TradingView button at the top of this page takes you straight to the script page. The script is free and open source.

  2. 02

    Add it to your favorites

    On the script page, click Add to favorites (the star icon).

  3. 03

    Add it to your chart

    At the top of the chart, click Indicators, choose Favorites on the left and click Range-Filtered Momentum. Alternatively, search for β€œIndicatr” in the Indicators window.

  4. 04

    Pick a market and timeframe

    Start with a market with clear trend phases, for example gold, the S&P 500 or Bitcoin, on 4h or the daily chart. The default – MACD 12/26/9, ATR-normalized, with an ADX filter – is fine to begin with.

The chart explained

What you see on the chart

Gold, 4h, MACD ATR-normalized with ADX filter. The numbers belong to the list below.Open chart on TradingView
All elements of Range-Filtered Momentum below a gold 4h chart, numbered
All elements of Range-Filtered Momentum below a gold 4h chart, numbered
  1. 1Momentum and signal line The thick line is green above and red below the gray signal line.
  2. 2Histogram The distance between the two lines. Strong color: the distance is growing. Pale color: it’s shrinking.
  3. 3Range phase Gray background, gray line and histogram: the filter reports a sideways market.
  4. 4Bullish cross Green triangle at the bottom: the momentum line crosses above the signal line while the market is trending.
  5. 5Bearish cross Red triangle at the top: the momentum line crosses below the signal line while the market is trending.

Elements 1 and 2

Momentum line, signal line and histogram

What does it do?

The momentum line measures how forcefully price is moving. The signal line is its smoothed average. The histogram shows the distance between the two.

What do I do with it?

You read whether momentum is building or fading. When the histogram turns paler, the move is losing steam – often before the lines cross.

Why?

Moves rarely end abruptly. Usually the momentum fades first, then price turns. The histogram makes that transition visible.

What do I get?

You recognize early whether a trend still has strength or is getting tired – and can review your trade accordingly.

Histogram colorMeaning
Strong greenAbove zero and growing: bullish momentum is increasing.
Pale greenAbove zero but shrinking: the upward momentum is fading.
Strong redBelow zero and falling: bearish momentum is increasing.
Pale redBelow zero but rising: the downward momentum is fading.
GrayRange phase: the filter reports no trend.

Element 3

The range filter

Gold, 4h, September/October detail. In the gray phases the lines cross several times – the script marks none of them.Open chart on TradingView
Gold 4h detail: gray range phases in which the lines cross without a triangle appearing
Gold 4h detail: gray range phases in which the lines cross without a triangle appearing

The filter decides for every candle: trend or range? You can choose the ADX (default: above 20 counts as a trend), the Choppiness Index (below 61.8 counts as a trend) or both together. In range phases, the background turns gray, the line and histogram turn gray, and crosses aren’t marked.

Elements 4 and 5

Crosses in trend phases

A bullish cross (green triangle at the bottom) forms when the momentum line crosses above the signal line while the filter reports a trend. A bearish cross (red triangle at the top) forms the mirrored way. In gray phases the lines still cross – just without a mark.

Before you take a cross

  • Does the cross point in the direction of the bigger trend – or against it?
  • Where is it relative to the zero line? Early in the move or late after a long run?
  • Are there important events coming up? Central banks, jobs data, inflation, earnings for stocks.
  • Is there a major level right ahead of you – an old high or low, a round number?
  • What are the related markets doing? For gold the dollar and real yields, for stocks bond yields, for Bitcoin risk sentiment.

Seven to choose from

Momentum sources and ATR normalization

SourceWhat it measuresCharacter
MACDDistance between a fast and a slow EMA.The classic. A good default.
TSIDouble-smoothed price change relative to its fluctuation.Calm, fixed scale, few spikes.
TRIXChange of a triple-smoothed EMA.Very calm, filters out small moves, reacts later.
Awesome OscillatorDistance between two averages of the candle midpoint (5 and 34).Fixed standard lengths, strong swings.
ROCPercentage change compared with N candles ago.Direct and fast, rather jagged.
MomentumPrice difference compared with N candles ago.The simplest form, fast and restless.
Elder RayBull Power + Bear Power: high and low relative to the EMA.Shows how far buyers and sellers push price away from the EMA.

All sources use their standard formulas. Don’t keep switching until the past looks good – stick with one and learn how it behaves on your market.

Why ATR normalization?

MACD, Awesome Oscillator, Momentum and Elder Ray are measured in price units. A MACD of 50 is tiny on Bitcoin and impossible on EUR/USD. With Normalize price-based sources by ATR (on by default), the script divides these values by the ATR, the average candle range. A value of 1 then roughly means: the momentum is as large as a typical candle.

Step by step

How to work with it

  1. 01

    Determine the direction

    Set the direction yourself – on the price chart, with a long-term average like the EMA 200 or on the higher timeframe. Range-Filtered Momentum only tells you whether the market is moving.

  2. 02

    Skip the gray phases

    As long as the pane is gray, there’s nothing to do. Use the time to mark levels.

  3. 03

    Wait for a cross in the trend direction

    In an uptrend you care about the green triangles, in a downtrend about the red ones. Wait until the candle has closed.

  4. 04

    Check the price chart

    Is the cross at a meaningful level? Has the move already run a long way?

  5. 05

    Set stop and size

    Place the stop beyond the last swing low (for a short, beyond the swing high) and calculate the position size from it – always the same risk per trade.

  6. 06

    Watch the momentum

    When the histogram turns pale or a cross appears against your trade, that’s the moment to actively review it.

Recommendations

Which markets fit – and which don’t

Momentum crosses work best in markets that move in clear legs: move, pause, next move. The more jagged a market is, the more often the crosses alternate – even in phases the filter recognizes as a trend.

Gold

4h and daily chart

Good fit
  • Pronounced legs: gold moves in distinct waves, driven by the dollar, real yields and central-bank buying. The filter recognizes these phases well.
  • The bearish cross at the high at the end of August (see the chart above) came in a trend phase – shortly before the downtrend began.
  • Tip: gold often jumps before US inflation data and central-bank dates – better to wait there.

S&P 500, Nasdaq and large-cap stocks

Daily chart

Good fit
  • Very liquid, with persistent trends and orderly pullbacks.
  • On the daily chart the legs are clean and the noise is low.
  • Careful: earnings create gaps that flip momentum instantly.

Bitcoin

4h and daily chart

Good fit
  • Strong trend phases in both directions, traded around the clock, no overnight gaps.
  • In between, long sideways phases – exactly where the filter shows its strength.

Bad example: GBP/NZD

GBP/NZD, 4h. Price rises slowly but jaggedly. The filter often reports a trend, and the crosses alternate at short intervals – many red triangles against the main direction.Open chart on TradingView
Range-Filtered Momentum below a GBP/NZD 4h chart: slow rise, many alternating crosses in trend phases
Range-Filtered Momentum below a GBP/NZD 4h chart: slow rise, many alternating crosses in trend phases

GBP/NZD

4h

Poor fit
  • Jagged instead of moving in legs: the pair often rises or falls in small, irregular waves. The ADX reports a trend, yet momentum turns every few days.
  • Two central banks and a commodity currency pull in different directions – short spikes without follow-through.
  • Thin and expensive: with many crosses, wide spreads eat a large part of the result.
  • The lesson: the filter hides sideways phases, but not jagged market behavior within a trend.

EUR/USD and major forex pairs

Daily chart

Use with care
  • Very liquid, but trends form over weeks. Lots of back and forth on 4h.
  • Much calmer on the daily chart. ATR normalization makes the values comparable with other markets here.

Which timeframe?

  • Daily chart: few, calm crosses, big moves. Costs hardly matter.
  • 4h: a good compromise for gold, Bitcoin and indices. More crosses, but earlier.
  • 1h and below: many crosses, even in trend phases. Spread and fees weigh heavily. Only with a clear direction from the higher timeframe.

Both directions

Long and short

Range-Filtered Momentum marks crosses in both directions by the same rules. In the gold example you see both: the bearish cross at the high at the end of August, shortly before the downtrend, and bullish crosses in the bounces afterwards. Which of them you trade depends on the direction you set beforehand.

The part that makes the difference

Practical tips

  • Direction first, cross second. The cross is the timing, not the reason for the trade.
  • If the triangles keep alternating, the market is jagged – even if the filter reports a trend. Better to pause or move to a higher timeframe.
  • Take a pale histogram seriously. Shrinking momentum is often the first warning before the lines cross.
  • Filter more strictly if needed. With Both (ADX and Choppiness) or a higher ADX value, trend phases become rarer but clearer.
  • Calculate position size from the stop – always the same risk per trade.

Don’t miss a thing

Setting up alerts

  1. 01

    Open the alert window

    At the top of the chart, click Alert or press Alt + A.

  2. 02

    Choose the condition

    Under Condition, select Range-Filtered Momentum and below it the alert you want.

  3. 03

    Trigger

    Choose β€œOnce per bar close” so the alert only fires on the finished candle.

  4. 04

    Notification

    Choose app, email or webhook and save.

AlertWhen it fires
Bullish cross in trendBullish cross while the filter reports a trend (green triangle).
Bearish cross in trendBearish cross while the filter reports a trend (red triangle).
Trend phase startsThe filter switches from range to trend – the gray phase ends.

Reference

All settings

Double-click the name β€œRFM [Indicatr]” at the top left of the indicator pane to open the settings. They are split into three groups. The defaults are enough to get started.

1 Β· Momentum source

Settings group 1: Momentum source
Settings group 1: Momentum source
SourceDefault: MACD
Which of the seven momentum sources is shown.
Fast length (MACD / TSI short)Default: 12
Fast length for the MACD, short smoothing for the TSI. Smaller = earlier but more restless.
Slow length (MACD / TSI long)Default: 26
Slow length for the MACD, long smoothing for the TSI. Larger = calmer and later.
Signal lengthDefault: 9
Smoothing of the signal line for all sources. Smaller = more crosses, larger = fewer but later.
Length (TRIX / ROC / Momentum / Elder EMA)Default: 14
Lookback for these four sources. The Awesome Oscillator always uses its standard lengths 5 and 34.
Normalize price-based sources by ATRDefault: on
Divides MACD, Awesome Oscillator, Momentum and Elder Ray by the ATR. Makes the values comparable across markets and timeframes. Turn it off if you want to see the classic price values.
ATR lengthDefault: 14
Lookback of the ATR used for normalization.

2 Β· Range filter

Settings group 2: Range filter
Settings group 2: Range filter
FilterDefault: ADX
ADX: trend when the ADX is above the threshold. Choppiness Index: trend when the market isn’t chopping back and forth much. Both: both have to report a trend – stricter, fewer crosses.
ADX lengthDefault: 14
Lookback of the ADX.
ADX: trending aboveDefault: 20
From this value on, the market counts as trending. Higher = fewer but stronger trend phases.
Choppiness lengthDefault: 14
Lookback of the Choppiness Index.
Choppiness: ranging aboveDefault: 61.8
Above this value, the market counts as sideways. Lower = stricter, more gray phases.

3 Β· Display

Settings group 3: Display
Settings group 3: Display
Bullish / Bearish / Range (muted)Default: Green / Red / Gray
Colors for the line, histogram, triangles and range phases.
Show crosses (trend phases only)Default: on
The triangles for crosses in trend phases.
Shade range phasesDefault: on
Gray background in range phases. Turn it off if it feels too busy – the line and histogram still turn gray.

From practice

Common mistakes

  • Taking every triangle as an entry. The filter knows no direction – without your own decision on direction, you trade half of the crosses against the trend.
  • Thinking the filter is infallible. It hides sideways phases, but not jagged trends.
  • Trading crosses on the open candle. Until the candle closes, everything can still change.
  • Chasing late crosses. A cross far from the zero line often comes when the move has already run.
  • Turning off ATR normalization and comparing markets. Without normalization, MACD values of different markets aren’t comparable.
  • Optimizing settings on the past. What looks perfect in hindsight is often chance.

FAQ

Does Range-Filtered Momentum repaint?

Not on closed candles. On the current, still open candle, lines, colors and triangles can change until it closes. That’s why you should use β€œOnce per bar close” for alerts.

Why don’t I see a cross even though the lines cross?

Because the filter is reporting a range phase (gray). Crosses are deliberately not marked there.

Why are there red triangles in an uptrend?

Because ADX and Choppiness only measure whether the market is moving directionally, not where. In an uptrend, a red triangle is often a pullback. You determine the direction yourself.

What do the numbers on the scale mean?

With ATR normalization, MACD, Awesome Oscillator, Momentum and Elder Ray are shown in ATR units: 1 roughly means one average candle range. TSI, TRIX and ROC keep their own scale.

ADX or Choppiness – which is better?

The ADX is the more widely used standard. The Choppiness Index measures more how much the market chops back and forth. Both is the strictest. Check on your market which filter recognizes the sideways phases more cleanly.

What does the script cost?

Nothing. Range-Filtered Momentum is free and open source on TradingView. You can look at the code and learn how it works.

How do you like Range-Filtered Momentum?

Your vote tells us what to work on next.

Support

Report a problem or share feedback

Something off with the script, unclear in the docs, or you have an idea? Write to us. We reply by email.

Helps us check access or settings.

Only used to reply to you.

What is it about?

By sending, you agree that we use your details to handle your request. More in our privacy policy.

Range-Filtered Momentum

Greys out range phases and marks crosses only while the market trends. ATR normalisation makes values comparable across markets.

Open on TradingView

For educational and analytical purposes only. Not financial advice. Marks and signals are not recommendations to buy or sell. Past behavior is no guarantee of the future. Trading involves a risk of loss.

Range-Filtered Momentum – Documentation & Guide | indicator.trading