Indicator · Pine Script v6 · On the chart

NVDA Trend Ribbon

by longsurf-ai

This indicator plots three exponential moving averages and ATR volatility envelopes on the price chart.

View on GitHub

GitHub stars277on the repository
Pine versionv6current
Lines of code36
Settings5inputs
LicenceMIT
Last updateyesterday27 Oct 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

36 lines of Pine Script v6 from app/src/app/trellis/workflows/pine-conversion/nvda-trend-ribbon.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

nvda-trend-ribbon.pine
//@version=6
indicator("NVDA Trend Ribbon", overlay = true)

// Three trend speeds and two volatility envelopes, all on the price chart.
fastLength = input.int(8, "Fast EMA", minval = 1)
basisLength = input.int(21, "Basis EMA", minval = 1)
slowLength = input.int(34, "Slow EMA", minval = 1)
atrLength = input.int(14, "ATR length", minval = 1)
bandWidth = input.float(1.5, "Band width", minval = 0.1)

fast = ta.ema(close, fastLength)
basis = ta.ema(close, basisLength)
slow = ta.ema(close, slowLength)
width = ta.atr(atrLength) * bandWidth
trendUp = fast >= slow
crossUp = ta.crossover(fast, slow)
crossDown = ta.crossunder(fast, slow)

// Stable colors preserve the same appearance when the script is converted.
pFast = plot(fast, "Fast EMA", color = #62D6BB, linewidth = 2)
pBasis = plot(basis, "Basis EMA", color = #EDC475, linewidth = 2)
pSlow = plot(slow, "Slow EMA", color = #B39DDB, linewidth = 2)
pUpper = plot(basis + width, "Upper band", color = #53BFA7)
pOuterUpper = plot(basis + width * 1.5, "Outer upper band", color = color.new(#53BFA7, 55))
pLower = plot(basis - width, "Lower band", color = #A38ACD)
pOuterLower = plot(basis - width * 1.5, "Outer lower band", color = color.new(#A38ACD, 55))

// Layered shades separate the trend ribbon from the outer volatility bands.
fill(pFast, pSlow, color = trendUp ? color.new(#62D6BB, 78) : color.new(#E68C98, 78), title = "Trend ribbon")
fill(pUpper, pOuterUpper, color = color.new(#53BFA7, 86), title = "Upper shade")
fill(pLower, pOuterLower, color = color.new(#A38ACD, 86), title = "Lower shade")
fill(pUpper, pLower, color = color.new(#8AA5C9, 96), title = "Inner shade")

// Annotate confirmed transitions only; a developing candle cannot confirm one.
plotshape(barstate.isconfirmed and crossUp, "Trend turns up", style = shape.triangleup, location = location.bottom, color = #62D6BB, text = "TREND UP", textcolor = #62D6BB, size = size.small, force_overlay = true)
plotshape(barstate.isconfirmed and crossDown, "Trend turns down", style = shape.triangledown, location = location.top, color = #E68C98, text = "TREND DOWN", textcolor = #E68C98, size = size.small, force_overlay = true)

Overview

NVDA Trend Ribbon compares the fast and slow EMAs to shade a trend ribbon and marks confirmed upward and downward crossovers with triangle labels. Settings change the three EMA lengths, the ATR period, and the band multiplier. Inner and outer bands sit above and below the basis EMA. Transition markers appear only after the bar closes, so a developing candle cannot confirm a turn.

Details

Published by

longsurf-ai on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Trend, Moving averages, Volatility & bands

Markets

Stocks

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.

Topics

aichartingagentagentic-traderchartscharts-jsharnessllmllm-agentspinescript

Settings

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

SettingTypeDefaultVariable
Fast EMAint8fastLength
Basis EMAint21basisLength
Slow EMAint34slowLength
ATR lengthint14atrLength
Band widthfloat1.5bandWidth
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

318 stars

This indicator plots four customizable moving averages directly on the main price chart using default lengths of 3, 8, 21, and 50 periods. It fills the space between adjacent averages in green or maroon depending on trend alignment. Additionally, it computes B

Indicator v5 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of Multiple Moving Averages

Bollinger Bands Force

by harryguiacorn
219 stars

This indicator modifies standard Bollinger Bands to measure directional trend force based on line alignment. It calculates a simple moving average basis along with upper and lower volatility bands. When all three lines move upward or downward simultaneously, i

Indicator v5 Volatility & bandsTrend
Updated 1 year ago · None stated GitHub repository of Bollinger Bands Force

Adaptive MA Slope

by capissimo
114 stars

This indicator calculates Kaufman's Adaptive Moving Average (KAMA) on a chosen price source and determines trend direction based on the slope across a configurable lookback window. Signals can be filtered by short-term volatility expansion using ATR comparison

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Adaptive MA Slope

Adaptive Price Zone

by mihakralj
99 stars

The Adaptive Price Zone indicator calculates volatility bands around a double-smoothed exponential moving average baseline directly on the price chart. It calculates internal smoothing factors using the square root of the user-specified period, double-smoothin

Indicator v6 Volatility & bandsTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Adaptive Price Zone

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