All scripts
Pro · Invite-only on TradingView
Free · Open source
Trend Regime Meter
ADX, +DI and −DI in one clear state – so you know whether trend following or range trading is called for right now.
- Type
- Trend filter (separate pane)
- Replaces
- ADX · DMI
- Recommended
- Daily chart, 4h
- Price
- Free, open source
Trend Regime Meter turns the three lines of ADX and DMI into one clear answer: uptrend, downtrend, range, trend building or trend fading. The ADX line takes on the color of the state, a histogram shows which side has the upper hand, and a table sums it all up. You can use it on its own or as a filter for other tools. This page explains every feature – and above all, what you do with it and why.
Overview
At a glance
What does it do?
It assigns every candle a state – trend up or down, range, building or fading – and shows it as a color, as background shading and in a table.
What do I do with it?
You pick your tool based on the state: in a trend you trade with the direction, in a range you rather trade the return to the middle, while a trend is building you get ready.
Why?
The most common ADX mistake: a high ADX means “strong trend”, but not in which direction. Only together with +DI and −DI does it become a statement – and that’s exactly what the script does for you.
What do I get?
Less trend following in sideways phases, fewer range trades against strong trends – in other words, fewer trades in the wrong environment.
On your chart in 3 minutes
Quickstart
- 01
Open the script page
The button at the top of this page takes you to the script page on TradingView. The script is free and open source – you can read the code there too.
- 02
Add it to your favorites
On the script page, click Add to favorites (the star icon).
- 03
Add it to your chart
At the top of the chart, click Indicators, choose Favorites on the left and click Trend Regime Meter. Alternatively, search for “Indicatr” in the same window. The meter opens in its own pane below price.
- 04
Pick a market and timeframe
Start with a market that has clear phases, for example gold, the S&P 500 or Bitcoin, on the daily chart or on 4h. The defaults (DI 14, ADX 14, trend from 25, end below 20) are the classic values.
The chart explained
What you see on the chart
- 1Uptrend Dark green ADX line: trend up, trend strength rising.
- 2Fading Lighter color: the trend is still on, but ADX is falling.
- 3Trend building Amber line: no trend yet, but ADX is rising.
- 4Downtrend Red ADX line: trend down.
- 5Range Gray line: no trend.
- 6DI histogram +DI minus −DI: above zero buyers have the upper hand, below zero sellers.
- 7Trend thresholds Dashed at 25 (trend starts), dotted at 20 (trend ends).
- 8Table State, duration, ADX with its direction and both DI values.
Elements 1 to 5
The six states
Every candle gets exactly one state. Direction comes from +DI and −DI, strength from ADX and its slope.
| State | Color | What it means | What you do with it |
|---|---|---|---|
| Uptrend | Dark green | Trend up, ADX rising or steady. | Trend following long: buy pullbacks, no shorts against the trend. |
| Uptrend, fading | Light green | The uptrend is still on, but ADX is falling. | No late entries, protect profits. This isn’t a reversal yet. |
| Downtrend | Red | Trend down, ADX rising or steady. | Trend following short – or, as a long-only trader, wait. |
| Downtrend, fading | Light red | The downtrend is still on, but ADX is falling. | Protect shorts, no late shorts. |
| Trend building (up / down) | Amber | No trend yet, but ADX is rising and above 15 – with the likely direction. | Get ready: mark levels, set an alert. Not a confirmed trend yet. |
| Range | Gray | No trend, and ADX isn’t building up either. | Pause trend following, rather trade the return to the middle – or don’t trade at all. |
Element 6
The DI histogram: who has the upper hand?
The columns show +DI minus −DI. Above zero (green) upward pressure is greater, below zero (red) downward pressure. The taller the columns, the more clearly one side is ahead.
What does it do?
It shows direction as a single number instead of two lines that keep crossing.
What do I do with it?
You check whether the trend is carried by a clear majority. If ADX and the columns grow together, the trend is gaining strength.
Why?
A rising ADX with shrinking columns often means the move is getting more hectic, but not more one-sided.
What do I get?
You notice early when the other side gets stronger – even before the state changes.
Element 7
Two thresholds instead of one: trend on, trend off
A trend only starts when ADX rises above 25 (dashed line) and only ends when it falls below 20 (dotted line). In between, the last state stays in place.
The gap between the two thresholds protects against the typical flickering of ADX around a single value. You get fewer, but clearer state changes.
Element 8
Reading the table
| Row | What it tells you |
|---|---|
| Regime | The current state in words, in the color of the state. |
| Bars in regime | How many candles the state has lasted. If, for example, “Downtrend, fading” switches back to “Downtrend”, the count starts again. |
| ADX | Current ADX with its direction: rising, falling or flat – compared with the value a few candles earlier. |
| +DI / -DI | The two direction lines. Their difference is the histogram. |
In practice
How to work with the script
- 01
State on the higher timeframe
Put the meter on your market’s daily chart. It’s your frame for all smaller timeframes.
- 02
Pick your tool
Uptrend / Downtrend: trend following in that direction. Range: return to the middle, or pause. Trend building: get ready. Fading: no late entries.
- 03
Setup on your trading timeframe
You look for the entry with your own setup. The meter gives no entry signals – it tells you what kind of setup fits right now.
- 04
Check the context
Scheduled events (central banks, jobs data, inflation, earnings), major levels and related markets.
- 05
Set stop and size
Stop according to your setup, always the same risk per trade, for example 0.5 to 1% of the account.
- 06
Watch for state changes
An alert on Any regime change or Range started tells you when the environment changes.
Recommendations
Which markets fit – and which don’t
The meter only uses high, low and close – it doesn’t need volume. Technically it works on any market. The question is where states last long enough for you to act on them. And to be honest: on difficult markets the meter mostly just shows “Range”. What loses there isn’t the meter, it’s trend following.
| Market | Timeframe | Fit | Why |
|---|---|---|---|
| Gold | Daily, 4h | Long, macro-driven phases – trends and ranges last weeks to months. Easy-to-read transitions. | |
| S&P 500 / Nasdaq | Daily | Clear trend phases and corrections. On small timeframes, indices often revert to the middle. | |
| Bitcoin | Daily, 4h | Pronounced trends in both directions and long sideways phases in between – exactly what the meter is for. | |
| EUR/USD | Daily | Trends over weeks, but lots of range. The fact that the meter often shows “Range” is useful information. | |
| Large-cap stocks | Daily | Clean trends, but gaps after earnings: ADX only confirms days later. | |
| GBP/NZD | 4h, daily | Mostly “Range” – correctly identified. Useful as a filter, hardly any trend-following opportunities. | |
| All markets below 15 minutes | – | By the time a state is confirmed, the move is often over. Session opens distort the values. |
Assessment based on market characteristics and behavior on the chart, not a backtest. ●●● good fit, ●●○ with limitations, ●○○ difficult.
Good examples: gold and Bitcoin
Gold
Daily chart and 4h
- Long phases: gold often moves in one direction for months, driven by the dollar, real yields and central-bank buying – and then pauses for weeks. The meter clearly picks up both.
- Readable transitions: on the chart above you can see the whole cycle – building in September 2025, uptrend, fading, range, building again, later downtrends.
- High liquidity: clean candles, ADX isn’t distorted by thin trading.
Bitcoin
Daily chart and 4h
- Strong trends in both directions: clear phases for long and short alike.
- Long sideways phases in between: that’s exactly where the meter keeps you away from trend-following trades.
- Continuous trading without overnight gaps – the values build up evenly.
With limitations and difficult
GBP/NZD
4h and daily chart
- To be honest, the meter works correctly here: it mostly shows “Range” or a build-up that doesn’t get confirmed.
- Useful as a filter: it keeps you from trend following in this pair.
- But: two central banks and a commodity currency cause sudden spikes that trigger a short trend and end quickly. On top of that come wide spreads.
Very small timeframes (1 to 5 minutes)
all markets
- Lag: ADX smooths over many candles. By the time a trend is confirmed, the short move is often already over.
- Session opens and news create spikes that briefly push ADX up and produce build-up phases that lead nowhere.
- Noise: many state changes a day – the meter turns into a traffic light that keeps switching.
Which timeframe?
- Daily chart: the main use. States last for weeks – ideal as a frame for every decision.
- 4h: good for swing traders on liquid markets, ideally with the daily chart as a check.
- 1h: possible as a filter for intraday trades, but with more changes. Use the daily chart as the higher frame.
- Below 15 minutes: not recommended – the lag of ADX weighs too heavily.
Both directions
Long and short
The meter treats both directions the same: uptrend and downtrend, each with “fading”, plus trend building with the likely direction up or down. On the gold chart you can see both – the uptrend in autumn 2025 and several downtrends from March 2026.
The part that makes the difference
How to manage the trades
Before the entry
- Environment first, then the setup. If your setup doesn’t fit the state – trend following in a range, a mean-reversion trade against a strong trend – you skip it.
- Check the calendar. Before central-bank decisions, jobs and inflation data or earnings, you’d rather skip new trades.
- Check intermarket. Gold reacts to the dollar and real yields, tech stocks to bond yields, Bitcoin to risk sentiment in equity markets.
- Size the position from the stop. Always the same risk per trade.
While the trade is running
- “Fading” doesn’t mean “reversal”. The trend is losing strength. You protect your position, but you don’t automatically flip it.
- Switch to “Range”: manage running trend-following trades more tightly, skip new ones.
- “Trend building” is an early warning. Not every one of these phases gets confirmed. If you wait for “Uptrend” or “Downtrend”, you enter later, but with more confidence.
Over weeks and months
- Note the state for every trade. After 30 to 50 trades you’ll see in which environment your method really makes money – and in which you’re better off pausing.
Don’t miss a thing
Setting up alerts
- 01
Open the alert window
At the top of the chart, click Alert or press
Alt + A. - 02
Choose the condition
Under Condition, select “Regime Meter [Indicatr]” and below it the alert you want.
- 03
Trigger
Choose “Once per bar close” – the state can still change on the current candle.
- 04
Notification
Choose app, email or webhook and save.
| Alert | When it fires |
|---|---|
| Uptrend started | An uptrend begins. Doesn’t fire when a fading uptrend strengthens again. |
| Downtrend started | A downtrend begins – same logic. |
| Range started | A trend or build-up ends and the state switches to range. |
| Trend building | A trend may be building: ADX is rising although no trend is confirmed yet. |
| Trend fading | ADX is falling within a running trend. |
| Any regime change | Every change of state. |
Reference
All settings
Double-click the name “Regime Meter” at the top left of the meter’s pane to open the settings. Everything is on one page in three groups: ADX / DMI, Regime rules and Display.
ADX / DMI, regime rules and display
- DI lengthDefault: 14
- Period for +DI and −DI. Shorter = direction reacts faster but is noisier.
- ADX smoothingDefault: 14
- Smoothing of ADX. Shorter = states change earlier, but more often. Longer = calmer, but later.
- Trend starts when ADX rises aboveDefault: 25
- From this ADX level a trend begins (dashed line). Higher = fewer, but clearer trends.
- Trend ends when ADX falls belowDefault: 20
- Below this value a trend ends (dotted line). The gap to the start threshold prevents constant switching. If you set both values equal, this protection is gone.
- ADX slope lookback (bars)Default: 3
- How many candles back ADX is compared to determine “rising” or “falling”. Higher = slower, fewer switches between strong and “fading”.
- Minimum DI spread to change directionDefault: 2
- How far apart +DI and −DI must be for the direction to change. Higher = fewer direction changes on narrow crossings.
- Trend building: ADX at leastDefault: 15
- From which ADX level a rising ADX outside a trend counts as “Trend building”. Lower = earlier, but less reliable warnings.
- Show DI spread histogramDefault: on
- Show or hide the +DI minus −DI histogram.
- Shade pane by regimeDefault: on
- Color the pane background by state.
- Colour price bars by regimeDefault: off
- Colors the candles on the price chart by state – handy if you keep the meter’s pane small.
- Show regime tableDefault: on
- Show or hide the table at the top right.
- Uptrend · Downtrend · Range · Building / fadingDefault: Green / Red / Gray / Amber
- Colors of the states. “Fading” automatically uses a lighter version of the trend color – the “Building / fading” color only colors the build-up.
From practice
Common mistakes
- High ADX = buy signal. ADX measures strength, not direction. Direction comes from +DI and −DI – which is exactly what the meter combines.
- Reading “fading” as a reversal. A trend that’s losing strength can keep running for a long time.
- Trading “trend building” like a confirmed trend. Not every build-up becomes a trend.
- Using the meter as an entry signal. It describes the environment. Your setup provides the entry.
- Using it on very small timeframes. The lag eats every move there.
- Reacting on the current candle. The state is only fixed once the candle closes.
FAQ
Does the script repaint?
No. The state can still change on the current candle; once the candle closes, it’s fixed.
Why does the table show “Downtrend” although ADX is below 25?
Because a trend only ends below 20. Between 20 and 25 the last state stays in place – so the meter doesn’t flip on every small fluctuation.
How is it different from the built-in ADX and DMI?
The built-in indicators show three lines you have to combine yourself. The meter turns them into one state – with two thresholds against constant switching, a minimum spread for direction, separate states for building and fading, and a table.
Why is a trend confirmed so late?
ADX is a lagging indicator: it needs a few candles before a move becomes recognizable as a trend. “Trend building” is the earlier, but less certain warning.
Can I use it as a filter for other indicators?
Yes, that’s exactly what it’s for. For example: trend-following signals only in “Uptrend” or “Downtrend”, mean-reversion trades only in “Range”.
Is the script really free?
Yes. Trend Regime Meter is free and open source on TradingView. The button on this page takes you to the script page. After Add to favorites you’ll find it on the chart under Indicators → Favorites.
How do you like Trend Regime Meter?
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.
Trend Regime Meter
Turns ADX, +DI and −DI into one clear state: uptrend, downtrend, range, trend building or trend fading.
For educational and analytical purposes only. Not financial advice. States and marks are not recommendations to buy or sell. Past behavior is no guarantee of future results. Trading involves a risk of loss.