Most strategies are secretly two strategies: one that works when the market trends, and one that works when it ranges. A trend meter on your TradingView chart tells you which regime you're in — so you can fire the right setup, avoid the wrong one, and see whether your strategies hand off to each other cleanly as the market shifts.
A trend meter reads the market's regime — is price moving directionally (a trend) or oscillating inside a band (a range)? It doesn't predict; it classifies what's happening right now. That one signal changes how you should trade:
Breakouts, pullback-continuations and momentum entries tend to work. Mean-reversion gets run over.
Fade the edges, mean-reversion and support/resistance bounces tend to work. Breakouts mostly fail (false breaks).
Run the wrong style in the wrong regime and even a good setup bleeds. The meter is how you stop doing that.
You don't need anything exotic — any of these, on TradingView, gives you a clean trend/range read. Pick one and stay consistent:
Add it to your chart the same way you add any indicator: Indicators → search the name → add. Put it in a separate pane so you can read it at a glance next to price.
The highest-value use: let the meter decide whether your strategy is even allowed to fire. In a Pine strategy, read the regime and only send the alert when it matches. Example with ADX:
//@version=5
strategy("Trend-gated example", overlay=true)
// --- Trend meter: ADX ---
[diPlus, diMinus, adx] = ta.dmi(14, 14)
isTrend = adx > 25 // trending market
isRange = adx < 20 // ranging market
// --- your entry logic ---
fast = ta.sma(close, 9), slow = ta.sma(close, 21)
longSig = ta.crossover(fast, slow)
// Only fire the trend setup when the meter says "trend".
// msg() builds the alert JSON — see the Connect TradingView page.
if longSig and isTrend
strategy.entry("L", strategy.long, alert_message = msg("LONG", "TREND"))Now your alerts only reach TradeLayer when the regime is right. Same idea inverted for a range strategy (isRange, fade-the-edge entries).
Even if you don't gate, it's worth stamping each alert with the regime it fired in. TradeLayer keeps every field of your alert, so you can carry the meter's read through to your journal and review — and later see your win rate in trend vs range. Add it to the alert JSON (build the rest with Connect TradingView):
{
"secret": "YOUR_SECRET",
"event": "ALERT",
"strategy": "My Strategy",
"market": "FOREX",
"asset": "{{ticker}}",
"direction": "LONG",
"order_type": "MARKET",
"price": {{close}},
"regime": "TREND", // or "RANGE" — your meter's read
"adx": {{plot_0}} // optional: the raw ADX value
}Once each of your strategies is gated to a regime, you can run them as a pair: a trend strategy that only fires when the meter reads trend, and a range strategy that only fires when it reads range. As the market shifts, one goes quiet and the other wakes up — a clean hand-off instead of both fighting the same chart.
What you're checking, in TradeLayer's metrics, is whether that hand-off actually helps: does the pair together have a smoother equity curve and a shallower drawdown than either alone? If the trend book bleeds exactly when the range book earns (and vice-versa), they're complementing each other — that's the whole point of measuring the regime.