Indicator · Pine Script v5 · On the chart

Snag - Best Futures Color Trend

by dearvn· code credited to binancash

This overlay indicator rebuilds a synthetic candle from the current open and the previous three opens.

View on GitHub

GitHub stars257on the repository
Pine versionv5runs as is
Lines of code28
Settings0inputs
LicenceNone statedfile: MPL-2.0
Last update6 weeks ago11 Sep 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

28 lines of Pine Script v5 from color-trend-lite.txt, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

color-trend-lite.txt
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © binancash

//@version=5
indicator("Snag - Best Futures Color Trend", overlay=true)


o_h = math.max(open[3], open[2], open[1])
o_l = math.min(open[3], open[2], open[1])
o_o = open[1]
o_c = open

src(_src)  => 
    Close  = (o_h + o_l + o_o + o_c)/4
    Open  = (o_o + o_c) / 2
    High   = math.max(o_h, math.max(Open, Close))
    Low    = math.min(o_l,  math.min(Open, Close))
    HL2    = math.avg(High, Low) 
    HLC3   = math.avg(High, Low, Close) 
    OHLC4  = math.avg(Open, High, Low, Close)
    Price  = _src == 'close' ? Close : _src == 'open' ? Open : _src == 'high' ? High : _src == 'low' ? Low : _src == 'hl2' ? HL2 : _src == 'hlc3' ? HLC3 : OHLC4  
    Source = math.round(Price / syminfo.mintick) * syminfo.mintick  // PineCoders method for aligning Pine prices with chart instrument prices

// === PLOTTING ===
bar_up   = src('close') < src('open')

barColor   = src('close') < src('open') ? color.blue : color.red  // series color
plotcandle(src('open'), src('high'), src('low'), src('close'), title = "", color = barColor, wickcolor = barColor, bordercolor = barColor)  // plot bars

Overview

Snag - Best Futures Color Trend treats the highest and lowest of those earlier opens as the range, the prior open as the synthetic open, and the current open as the synthetic close. From those values it derives high, low, and common price sources, then rounds them to the instrument tick. It plots the reconstructed candle on the price chart, coloring it blue when the synthetic close is below the synthetic open and red otherwise. There are no user inputs, alerts, or trading rules.

Details

Published by

dearvn on GitHub

Code credit

binancash, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Trend, Candlestick patterns

Markets

Indices

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

futures-markettradingviewtradovatetrading-futureses1best-indicator-tradingviewnq1trading-futurerus-stock-market

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

All Candlestick Patterns

by shunjizhan
292 stars

All Candlestick Patterns detects and highlights a wide range of bullish, bearish, and neutral candlestick patterns directly on the price chart. It features optional trend filtering using either a 50-period simple moving average or a combination of 50-period an

Indicator v4 Candlestick patternsTrend
Updated 3 years ago · None stated GitHub repository of All Candlestick Patterns

Five-in-one Strategy

by capissimo
114 stars

Five-in-one Strategy combines five analytical tools into a single price chart overlay: the Dual Thrust Trading Algorithm (DTTA), Semafore, HalfTrend, Nick Rypock Trailing Reverse, and Tweezer or Kangaroo Tail candlestick patterns. It generates trade signals us

Indicator v4 TrendBreakout Repaints
Updated 1 year ago · None stated GitHub repository of Five-in-one Strategy

HA: Heikin-Ashi

by mihakralj
99 stars

This indicator calculates and plots Heikin-Ashi smoothed candlesticks directly on the price chart. It derives the smoothed close from standard price averages and recursively computes the open, high, and low values. The script does not issue trade signals or al

Indicator v6 Candlestick patternsTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of HA: Heikin-Ashi
55 stars

This indicator overlays on the price chart and provides trend and momentum analysis. It calculates and plots three exponential moving averages with fixed periods of 20, 50, and 200 using yellow, orange, and blue colors respectively. The script also computes th

Indicator v6 TrendOscillators & momentum
Updated 6 months ago · Apache-2.0 GitHub repository of Trend & Momentum Analysis

Confluence Suite

by TamaraKGreen
46 stars

The Confluence Suite indicator draws multiple trading signals and tools directly on the price chart. It generates entry and exit signals based on selected modes and filters, with an AI signal classifier rating quality from 1-4. Additional features include smar

Indicator v5 TrendSMC / ICT / price action
Updated 7 weeks ago · None stated GitHub repository of Confluence Suite

Abandoned Baby - Bullish

by TWODS-CAPITAL
37 stars

This indicator identifies the Bullish Abandoned Baby candlestick pattern directly on the price chart. The three-bar reversal pattern consists of a strong down candle during an established downtrend, followed by a lower gapping doji candle, and completed by an

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Abandoned Baby - Bullish

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