Indicator · Pine Script v5 · On the chart

TVT Short Term (1h)

by namuan

This indicator calculates and plots two moving averages, which can be configured as either exponential or simple, along with a shaded fill between them to highlight trend direction.

View on GitHub

GitHub stars318on the repository
Pine versionv5runs as is
Lines of code27
Settings5inputs
LicenceMIT
Last update2 months ago18 Aug 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

27 lines of Pine Script v5 from tv-scripts/tvt-short-term-ma.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

tvt-short-term-ma.pine
//@version=5
indicator(title="[TVT] Short Term (1h)", shorttitle="TVT-DT", overlay=true, timeframe="", timeframe_gaps=true)

src = input(close)
exponential = input(true, title="Exponential MA")
bb_mult = input.float(defval = 2.0, minval=0.001, maxval=50, title="BB Oversold/Overbought deviation")
ma1_in = input(40,title='MA-1')
ma2_in = input(60,title='MA-2')

ma1 = exponential ? ta.ema(src, ma1_in) : ta.sma(src, ma1_in)
ma2 = exponential ? ta.ema(src, ma2_in) : ta.sma(src, ma2_in)

p_ma1 = plot(ma1, color=color.green,  title="MMA1", linewidth=1)
p_ma2 = plot(ma2, color=color.red, title="MMA2", linewidth=1)

up_color = color.lime
down_color = color.maroon

fill(p_ma1, p_ma2, color=ma1 > ma2 ? color.new(up_color, transp=70) : color.new(down_color, transp=70))

// BB Expansion
bb_stdev = bb_mult * ta.stdev(src, ma1_in)
bb_upper = ma2 + bb_stdev
bb_lower = ma2 - bb_stdev

plot(bb_upper, color=color.new(color.blue, 50), title="BB Upper", linewidth=1)
plot(bb_lower, color=color.new(color.blue, 50) , title="BB Lower", linewidth=1)

Overview

TVT Short Term (1h) also derives and plots upper and lower deviation levels using a customizable standard deviation multiplier. Settings allow users to modify the source data, toggle exponential calculation, adjust the deviation multiplier, and change the periods for both moving averages. The tool draws directly on the price chart. As an indicator, it contains no explicit entry, exit, or stop loss rules.

Details

Published by

namuan on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Moving averages, Trend, Volatility & bands

Markets

Stocks

Timeframes

M15-H1

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

trading-strategiesmarket-analysisdtalestock-market-analysistelegram-botearnings-calendaroptions-trading

Settings

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

SettingTypeDefaultVariable
srcsourceclosesrc
Exponential MAbooltrueexponential
BB Oversold/Overbought deviationfloat2.0bb_mult
MA-1int40ma1_in
MA-2int60ma2_in
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

NVDA Trend Ribbon

by longsurf-ai
277 stars

This indicator plots three exponential moving averages and ATR volatility envelopes on the price chart. It compares the fast and slow EMAs to shade a trend ribbon and marks confirmed upward and downward crossovers with triangle labels. Settings change the thre

Indicator v6 TrendMoving averages
Updated yesterday · MIT GitHub repository of NVDA Trend Ribbon

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