OPEN-SOURCE SCRIPT

Trend Engine

406
The Trend Engine: What It's Actually Doing

Most indicators give you one opinion. This one gives you five, then makes them argue it out across four different time horizons before handing you a single verdict.

The core idea is confluence. No single signal - not a moving average, not an oscillator, not volume - is reliable enough to trade on its own. But when five different kinds of evidence all point the same direction at once, that agreement means something. The Trend Engine's whole job is to collect that evidence, weigh it, and show you at a glance whether the market's various signals are singing in harmony or talking over each other.

The five witnesses

Each one is trying to answer the same question - "is this bullish or bearish?" - from a different angle, so their occasional disagreements are informative:

The EMA stack (21/50/200) asks the oldest question in technical analysis: is price properly stacked above its short, medium, and long-term averages, the way a healthy uptrend should be? This is your structural read.

The Supertrend is fast and reactive - an ATR-based line that flips relatively quickly when price reverses. Think of it as the tactical scout: first to notice, first to be wrong sometimes too.

The Vol Stop is the slower, wider cousin - a Chandelier-style ATR trailing stop (20-period, 3.25x multiplier) that doesn't flip nearly as often. It's less about catching every wiggle and more about confirming the durable trend, and it doubles as an actual stop-loss reference level.

OBV (On-Balance Volume) checks whether volume is actually backing the move - is money flowing in on the way up, or is this a rally nobody's actually buying?

The Heikin-Ashi candle is a noise filter. Its smoothed color tells you, at the most basic level, whether the last bar of price action itself was constructive or not - a simple gut check against the more complex signals above it.

Each of those casts a vote of +1 or -1 (the EMA stack can go to +/-2 for full alignment), and they get added together into a single confluence score.

Reading across time, not just across signals

Here's the second layer: the same five-vote process runs independently on four timeframes - 1-hour, Daily, Weekly, and Monthly - with Daily and Weekly counted double, since those tend to matter more for positioning than an hourly blip or a slow-moving monthly trend. That weighted sum becomes the Net Score, expressed as a percentage of its theoretical maximum, so you can see whether the whole structure - not just one timeframe - is pulling in one direction.

Volatility as a confidence check, not just a data point

Markets don't behave the same way in calm conditions as they do in chaotic ones, so the Trend Engine also measures where current volatility (via ATR) sits relative to its own recent history - Low, Normal, Elevated, or Extreme. Rather than just displaying that as trivia, it actually discounts the confluence score during high-volatility regimes. A "perfect" 5-signal alignment during an Extreme volatility spike gets treated with more skepticism than the same alignment during a calm, Low-volatility grind - because whipsaws and false signals cluster in turbulent conditions. Daily and Weekly volatility get their own discount applied independently, so a calm Weekly trend isn't penalized just because the Daily chart is having a rough week.

The scoreboard

All of this rolls up into a table that sits on the chart: each timeframe's Regime (Strong Bull down to Strong Bear), a Strength bar, the Net Score percentage, and - most useful day to day - a Net Score percentile, which tells you how today's reading stacks up against the last 100 bars of its own history. That last one matters because the theoretical maximum score is almost never actually reached in real markets; knowing that today is more extreme (or more tepid) than 90% of recent readings is a far more actionable fact than knowing you're at "62% of a ceiling nobody ever touches."

The honest caveat

This is a confluence tool, not an oracle. Three of the five components (Supertrend, Vol Stop, Heikin-Ashi) are all fundamentally trend-following price-action tools, so in a strongly trending market they'll tend to agree with each other simply because they're measuring similar things - that's not five independent opinions converging, that's three cousins nodding along. The real diversification in the model comes from EMA structure and OBV, which are measuring genuinely different things (positioning and participation, respectively). Worth keeping in mind when the Regime row reads "Strong Bull" across the board - ask whether that's broad agreement or just correlated trend-followers all catching the same wave.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。