Indicator · Pine Script v6 · On the chart

Signal Overlay

by insomniac-asif

A chart overlay with three exponential moving averages of 9, 21 and 50 bars, plus manual marker toggles for long, short, entry, stop hit and target hit on the latest bar.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code140
Settings12inputs
LicenceMIT
Last update2 months ago20 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

140 lines of Pine Script v6 from pine/signal_overlay.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

signal_overlay.pine
//@version=6
indicator("Signal Overlay — Futures Signal Engine", overlay=true, max_labels_count=500)

// ── Manual signal marking tool ──────────────────────────────────────────────
// Use TradingView's built-in alert conditions to trigger these markers.
// Or manually add signals by toggling the inputs for each bar.
//
// This indicator provides visual markers and a tracking table for
// manually marking signals during live trading.

// ── Inputs ──────────────────────────────────────────────────────────────────
markLong     = input.bool(false, "Mark Long Signal (current bar)")
markShort    = input.bool(false, "Mark Short Signal (current bar)")
markEntry    = input.bool(false, "Mark Entry Executed")
markStopHit  = input.bool(false, "Mark Stop Hit")
markTargetHit = input.bool(false, "Mark Target Hit")
setupLabel   = input.string("ORB", "Setup Type", options=["ORB", "VWAP", "LEVEL", "EMA_PB", "DIV"])
scoreLabel   = input.float(3.5, "Conviction Score", minval=1.0, maxval=5.0, step=0.1)

// ── EMA overlay for quick reference ─────────────────────────────────────────
showEMAs = input.bool(true, "Show EMAs")
ema9  = ta.ema(close, 9)
ema21 = ta.ema(close, 21)
ema50 = ta.ema(close, 50)

plot(showEMAs ? ema9  : na, "EMA 9",  color=color.new(color.aqua, 30),  linewidth=1)
plot(showEMAs ? ema21 : na, "EMA 21", color=color.new(color.orange, 30), linewidth=1)
plot(showEMAs ? ema50 : na, "EMA 50", color=color.new(color.gray, 30),   linewidth=2)

// ── Signal markers on current bar ───────────────────────────────────────────
if markLong and barstate.islast
    label.new(
        bar_index, low,
        "▲ " + setupLabel + " " + str.tostring(scoreLabel, "#.#"),
        style=label.style_label_up,
        color=color.new(color.green, 20),
        textcolor=color.white,
        size=size.small
    )

if markShort and barstate.islast
    label.new(
        bar_index, high,
        "▼ " + setupLabel + " " + str.tostring(scoreLabel, "#.#"),
        style=label.style_label_down,
        color=color.new(color.red, 20),
        textcolor=color.white,
        size=size.small
    )

if markEntry and barstate.islast
    label.new(
        bar_index, close,
        "●",
        style=label.style_none,
        textcolor=color.blue,
        size=size.normal
    )

if markStopHit and barstate.islast
    label.new(
        bar_index, close,
        "✗",
        style=label.style_none,
        textcolor=color.red,
        size=size.normal
    )

if markTargetHit and barstate.islast
    label.new(
        bar_index, close,
        "✓",
        style=label.style_none,
        textcolor=color.green,
        size=size.normal
    )

// ── Auto-detection: ORB breakout alerts ─────────────────────────────────────
orPeriod   = input.int(15, "OR Period (minutes)", minval=5, maxval=60, group="Auto Signals")
showAutoOR = input.bool(true, "Show ORB Break Signals", group="Auto Signals")

nyHour   = hour(time, "America/New_York")
nyMinute = minute(time, "America/New_York")

var float autoORH = na
var float autoORL = na
var bool  autoORDone = false
var bool  longFired  = false
var bool  shortFired = false

isOpen = nyHour == 9 and nyMinute == 30
if isOpen
    autoORH   := high
    autoORL   := low
    autoORDone := false
    longFired  := false
    shortFired := false

orEndMin = 30 + orPeriod
inAutoOR = nyHour == 9 and nyMinute >= 30 and nyMinute < orEndMin
if inAutoOR and not isOpen
    autoORH := math.max(nz(autoORH, high), high)
    autoORL := math.min(nz(autoORL, low), low)

if nyMinute >= orEndMin and nyHour == 9 or nyHour >= 10
    autoORDone := true

// Plot OR levels after period closes
plot(showAutoOR and autoORDone ? autoORH : na, "OR High", color=color.yellow, linewidth=2, style=plot.style_circles)
plot(showAutoOR and autoORDone ? autoORL : na, "OR Low", color=color.yellow, linewidth=2, style=plot.style_circles)

// Signal arrows on breakout
orbLong  = showAutoOR and autoORDone and close > autoORH and not longFired
orbShort = showAutoOR and autoORDone and close < autoORL and not shortFired

if orbLong
    longFired := true

if orbShort
    shortFired := true

plotshape(orbLong, "ORB Long", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(orbShort, "ORB Short", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)

// ── Alerts ──────────────────────────────────────────────────────────────────
alertcondition(orbLong, "ORB Long Breakout", "ORB Long: Price broke above Opening Range High")
alertcondition(orbShort, "ORB Short Breakout", "ORB Short: Price broke below Opening Range Low")

// ── VWAP distance alert ────────────────────────────────────────────────────
showVWAPAlert = input.bool(true, "Show VWAP Extension Alert", group="Auto Signals")
vwapATRThresh = input.float(1.5, "VWAP Extension Threshold (ATR)", group="Auto Signals")

vwapVal  = ta.vwap(hlc3)
atrVal   = ta.atr(14)
vwapDist = math.abs(close - vwapVal) / atrVal

vwapExtended = showVWAPAlert and vwapDist >= vwapATRThresh

bgcolor(vwapExtended ? color.new(color.purple, 92) : na, title="VWAP Extended")
alertcondition(vwapExtended, "VWAP Extended", "Price extended > " + str.tostring(vwapATRThresh) + " ATR from VWAP")

Overview

The setup type and a conviction score are typed in by the user and shown in the label. It also offers opening range breakout signals and a VWAP extension alert measured in ATR units. Settings control the range minutes and threshold. It draws on the price chart.

Details

Published by

insomniac-asif on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Sessions & time, Moving averages, Breakout

Markets

Indices, Oil & commodities

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.

Settings

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

SettingTypeDefaultVariable
Mark Long Signal (current bar)boolfalsemarkLong
Mark Short Signal (current bar)boolfalsemarkShort
Mark Entry ExecutedboolfalsemarkEntry
Mark Stop HitboolfalsemarkStopHit
Mark Target HitboolfalsemarkTargetHit
Setup TypestringORBsetupLabel
Conviction Scorefloat3.5scoreLabel
Show EMAsbooltrueshowEMAs
OR Period (minutes)int15orPeriod
Show ORB Break SignalsbooltrueshowAutoOR
Show VWAP Extension AlertbooltrueshowVWAPAlert
VWAP Extension Threshold (ATR)float1.5vwapATRThresh
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

1 stars

This indicator assists intraday breakout execution on KLSE stocks. It plots VWAP, EMA 9, EMA 21 on the price chart along with an opening range from the first 30 minutes of the session and a buy zone band above the daily pivot price. Settings control the pivot

Indicator v5 Moving averagesSupport & resistance
Updated 4 months ago · None stated GitHub repository of KLSE Intraday Execution Helper
257 stars

Donald SPX - Options Trading is an overlay indicator designed for intraday SPX analysis. It plots a 200-period Weighted Moving Average (WMA) on the price chart while evaluating multi-timeframe market structure across Daily, 15-minute, 5-minute, and 2-minute ba

Indicator v5 Moving averagesTrend Repaints
Updated 6 weeks ago · None stated GitHub repository of Donald SPX - Options Trading

Midnight VWAP

by TradersPost
218 stars

The Midnight VWAP indicator calculates and overlays two distinct Volume Weighted Average Price (VWAP) lines on the price chart based on customizable session timeframes. It tracks an overnight or pre-market session alongside regular trading hours, resetting cal

Indicator v6 Moving averagesSessions & time
Updated 3 months ago · None stated GitHub repository of Midnight VWAP

Acceleration Bands

by capissimo
114 stars

Acceleration Bands is an overlay indicator that plots a volatility envelope around a central simple moving average. It calculates upper and lower boundary bands scaled by the high-to-low bar range relative to the midpoint price, smoothed by an SMA over a user-

Indicator v4 Volatility & bandsMoving averages
Updated 1 year ago · None stated GitHub repository of Acceleration Bands

Moon Dev GEX Walls & Trap

by moondevonyt
92 stars

This indicator estimates gamma exposure levels and intraday context for index instruments like SPY and ES. It calculates VWAP with standard deviation bands as a gamma flip proxy, highlighting market regimes through background colors. It plots prior day high, l

Indicator v5 Support & resistanceSessions & time
Updated 2 months ago · Custom licence GitHub repository of Moon Dev GEX Walls & Trap

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