Indicator · Pine Script v5 · Own pane

Stella's Trend Strength

by stella-entry

This indicator calculates and plots ADX values on a separate pane to gauge overall trend strength from 0 to 100.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code58
Settings4inputs
LicenceMIT
Last update8 months ago22 Feb 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

58 lines of Pine Script v5 from indicators/trend-strength.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

trend-strength.pine
//@version=5
indicator("Stella's Trend Strength", shorttitle="TREND", overlay=false)

// Trend Strength Indicator (ADX-based)
// Shows trend strength 0-100 regardless of direction

// Settings
adx_len = input(14, "ADX Length")
di_len = input(14, "DI Length")
strong_trend = input(25, "Strong Trend Level")
weak_trend = input(20, "Weak Trend Level")

// Calculate ADX
[di_plus, di_minus, adx] = ta.dmi(di_len, adx_len)

// Trend Direction
trend_up = di_plus > di_minus
trend_down = di_minus > di_plus
trend_neutral = di_plus == di_minus

// Trend Strength Classification
strength_label = adx >= strong_trend ? "Strong" : adx >= weak_trend ? "Moderate" : "Weak"
strength_color = adx >= strong_trend ? color.green : adx >= weak_trend ? color.yellow : color.red

// Combined Direction + Strength
bull_trend = trend_up and adx >= weak_trend
bear_trend = trend_down and adx >= weak_trend
no_trend = adx < weak_trend

// Plot ADX
plot(adx, "Trend Strength", color=color.blue, linewidth=2)
hline(strong_trend, "Strong Trend", color=color.green, linestyle=hline.style_dashed)
hline(weak_trend, "Weak Trend", color=color.red, linestyle=hline.style_dashed)

// Direction indicator
plotshape(bull_trend and not bull_trend[1], "Bull Trend Start", shape.triangleup, location.bottom, color.green, size=size.small)
plotshape(bear_trend and not bear_trend[1], "Bear Trend Start", shape.triangledown, location.top, color.red, size=size.small)

// Background color for trend
bgcolor(bull_trend ? color.new(color.green, 85) : bear_trend ? color.new(color.red, 85) : na)

// Table with info
var table info = table.new(position.top_right, 2, 3)
if barstate.islast
    table.cell(info, 0, 0, "Strength", bgcolor=color.gray, text_color=color.white)
    table.cell(info, 1, 0, str.tostring(adx, "#.#"), bgcolor=strength_color, text_color=color.white)
    table.cell(info, 0, 1, "Direction", bgcolor=color.gray, text_color=color.white)
    table.cell(info, 1, 1, trend_up ? "BULL" : trend_down ? "BEAR" : "NEUTRAL",
               bgcolor=trend_up ? color.green : trend_down ? color.red : color.gray,
               text_color=color.white)
    table.cell(info, 0, 2, "Label", bgcolor=color.gray, text_color=color.white)
    table.cell(info, 1, 2, strength_label, bgcolor=strength_color, text_color=color.white)

// Alerts
alertcondition(ta.crossover(adx, strong_trend), "Strong Trend Forming", "ADX crossed above strong trend level")
alertcondition(ta.crossunder(adx, weak_trend), "Trend Weakening", "ADX fell below weak trend level")
alertcondition(bull_trend and not bull_trend[1], "Bull Trend Start", "Bullish trend started")
alertcondition(bear_trend and not bear_trend[1], "Bear Trend Start", "Bearish trend started")

Overview

Stella's Trend Strength combines ADX with DI+ and DI- to classify trends as Strong, Moderate, or Weak based on input thresholds. The script identifies bullish and bearish trend directions and applies background coloring accordingly. A dynamic table displays real-time strength, direction, and label information. Alerts fire on trend direction changes and strength threshold crossings. Settings control ADX and DI lengths plus strong and weak trend levels. The indicator draws trend strength data in a separate pane and provides no trade entries or exits.

Details

Published by

stella-entry on GitHub

Type

Indicator, Pine Script v5

Draws

Separate pane below the chart

Category

Trend

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
ADX Lengthint14adx_len
DI Lengthint14di_len
Strong Trend Levelint25strong_trend
Weak Trend Levelint20weak_trend
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

Schaff Trend Cycle

by everget
948 stars

This indicator plots the Schaff Trend Cycle in a separate pane. It subtracts a slow exponential moving average from a fast one, applies a stochastic cycle twice, and smooths each result to form a 0–100 oscillator. Line color follows the slope, or the upper and

Indicator v4 Oscillators & momentumTrend
Updated 10 days ago · GPL-3.0 GitHub repository of Schaff Trend Cycle

This indicator plots a Supertrend-based trend-following setup in a separate pane and skips conditions it treats as a sideways market. A volatility range is built from an ATR value, with RMA, SMA, EMA, or WMA smoothing, or from a fixed point distance. Optional

Indicator v5 TrendVolatility & bands
Updated 1 year ago · MPL-2.0 GitHub repository of Trend Following Setup - Sideways Market Skipper

Beep Boop

by magic8bot
409 stars

This indicator calculates a modified MACD oscillator and signal line alongside a trend EMA filter, plotting the output as a stylized column histogram in a separate pane. Instead of plotting true MACD distance, it quantifies positive and negative histogram mome

Indicator v4 Oscillators & momentumTrend
Updated 3 years ago · MIT GitHub repository of Beep Boop

[RS]Standardized Trend Map

by ricardosantos79
261 stars

Standardized Trend Map calculates series momentum relative to active price range across 40 distinct lookback periods ranging from 2 to 80 bars on an exponential moving average source. Each standardized calculation rounds to an integer values of -1, 0, or 1 to

Indicator v4 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of [RS]Standardized Trend Map

ADX Histogram

by harryguiacorn
219 stars

This indicator calculates and displays the Average Directional Index (ADX) as a column histogram in a separate pane. It evaluates market trend strength by calculating directional movement metrics based on specified smoothing and DI length inputs. When the ADX

Indicator v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of ADX Histogram

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers