Indicator · Pine Script v5 · On the chart

TVT 3X Scale In Out

by namuan

This indicator plots three moving averages on the price chart alongside colored fills between the lines to visualize trend structure.

View on GitHub

GitHub stars318on the repository
Pine versionv5runs as is
Lines of code39
Settings9inputs
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

39 lines of Pine Script v5 from tv-scripts/tvt-3usl-strategy.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

tvt-3usl-strategy.pine
//@version=5
indicator(title="[TVT] 3X Scale In Out", shorttitle="TVT-3X", overlay=true, timeframe="", timeframe_gaps=true)

// === INPUTS ===
src = input(close)
use_ema = input(false, title="Use EMA over SMA?")
smoothK = input.int(3, "K", minval=1)
smoothD = input.int(3, "D", minval=1)
lengthRSI = input.int(14, "RSI Length", minval=1)
lengthStoch = input.int(14, "Stochastic Length", minval=1)

// Short Moving Averages
ma1   = input(25,title='Short MA-1')
ma2   = input(50,title='Short MA-2')
ma3   = input(75,title='Short MA-3')

blend_color = color.white

ma_series1 = use_ema ? ta.sma(src, ma1) : ta.ema(src, ma1)
ma_series2 = use_ema ? ta.sma(src, ma2) : ta.ema(src, ma2)
ma_series3 = use_ema ? ta.sma(src, ma3) : ta.ema(src, ma3)

//plot moving averages
p_ma1 = plot(ma_series1,title='MA-1',color=color.blue, linewidth=1)
p_ma2 = plot(ma_series2,title='MA-2',color=color.orange, linewidth=1)
p_ma3 = plot(ma_series3,title='MA-3',color=color.red, linewidth=2)

up_color = color.lime
down_color = color.maroon

fill(p_ma1, p_ma2, color=color.new(up_color, transp=90))
fill(p_ma2, p_ma3, color=color.new(down_color, transp=70))

rsi1 = ta.rsi(src, lengthRSI)
k = ta.sma(ta.stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = ta.sma(k, smoothD)

// highlight background if k > d and k > 10 and d < 10 (Oversold but going up)
bgcolor((k > d) and (k > 10) and (d < 10) ? color.new(color=color.lime, transp=70) : na)

Overview

Internally, it calculates a Stochastic RSI oscillator to detect oversold reversals. When the Stochastic %K line rises above 10 while crossing above the %D line below 10, the script highlights the background in lime green to signal an oversold bounce. Settings allow switching between simple and exponential moving averages, adjusting moving average periods, and customizing Stochastic RSI smoothing lengths.

Details

Published by

namuan on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Moving averages, Oscillators & momentum

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.

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
Use EMA over SMA?boolfalseuse_ema
Kint3smoothK
Dint3smoothD
RSI Lengthint14lengthRSI
Stochastic Lengthint14lengthStoch
Short MA-1int25ma1
Short MA-2int50ma2
Short MA-3int75ma3
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

948 stars

The Adaptive RSI Moving Average (ARSIMA) is an overlay indicator that dynamically adjusts its smoothing factor based on the Relative Strength Index (RSI). When the RSI moves toward extreme overbought or oversold conditions, the smoothing factor increases to ma

Indicator v4 Moving averagesOscillators & momentum
Updated 10 days ago · GPL-3.0 GitHub repository of Adaptive RSI Moving Average

This overlay indicator plots a Supertrend from an ATR length and factor, four exponential moving averages, and a selectable VWAP or TWAP taken from a chosen timeframe on the price chart. It also shows MACD and stochastic with adjustable lengths, smoothing, ver

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup: Vijay Thakare Option Buying Scalping Setup

This indicator plots trade entry and exit signals on the price chart by combining Bollinger Bands with optional filter conditions. It calculates standard Bollinger Bands along with RSI, Aroon, and moving average filters. Reversal signals trigger when price bre

Indicator v4 Volatility & bandsOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Bollinger Bands Winner IND [Alorse]
285 stars

Mean Reversion Study is an indicator that identifies trade setups combining exponential moving averages, RSI extremes, and engulfing candlestick patterns. It highlights bullish setups when a bullish engulfing candle forms below the EMA while RSI is oversold, a

Indicator v4 Mean reversionCandlestick patterns
Updated 3 years ago · None stated GitHub repository of Mean Reversion Study

Swoosh Indicator

by harryguiacorn
219 stars

Swoosh Indicator is an overlay that marks directional conditions on the price chart. It checks whether four simple moving averages are stacked in order and whether the MACD line is above or below its signal line. When both agree, it plots a green up arrow belo

Indicator v5 Moving averagesOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Swoosh Indicator

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