Indicator · Pine Script v5 · On the chart

SystemticQuant VWAP + Supertrend Intraday Scalp

by systemic-quant

The SystemticQuant VWAP + Supertrend Intraday Scalp indicator combines an anchored VWAP calculation with a higher-timeframe Supertrend to generate intraday trend-following signals.

View on GitHub

GitHub stars18on the repository
Pine versionv5runs as is
Lines of code168
Settings14inputs
LicenceGPL-3.0
Last update4 months ago26 Jul 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

168 lines of Pine Script v5 from indicator_v1.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.

indicator_v1.pine
//@version=5
indicator("SystemticQuant Vwap + Supertrend Intraday Scalp)", overlay=true, max_lines_count=100, max_labels_count=100)

// ————— Group: Session & Execution Guardrails —————
max_signals_per_day = input.int(3, "Max Signals Per Session", minval=1, maxval=10, group="Session Guardrails", tooltip="Hard cap on total signals per intraday session")

// ————— Group: Quant Metric Filters —————
vol_mult_thresh     = input.float(1.2, "Min Volume Threshold (x 20-SMA)", minval=0.5, step=0.1, group="Quant Quality Metrics", tooltip="Candle volume must be at least this factor of its 20-SMA")
min_body_pct        = input.float(50.0, "Min Candle Body % of Range", minval=10.0, maxval=90.0, step=5.0, group="Quant Quality Metrics", tooltip="Filters out Dojis and weak spin-top wicks")

// ————— Group: VWAP & MTF Supertrend Setup —————
vwap_anchor         = input.string("Session", "VWAP Anchor Period", options=["Session", "Week", "Month"], group="Indicator Core")
htf_timeframe       = input.timeframe("15", "HTF Supertrend Timeframe", group="Indicator Core")
atr_period          = input.int(10, "ATR Period", minval=1, group="Indicator Core")
atr_multiplier      = input.float(3.0, "ATR Multiplier", minval=0.1, step=0.1, group="Indicator Core")

// ————— Group: UI & Visuals —————
show_signals        = input.bool(true, "Show Entry Signal Labels", group="Visual Engine")
show_ribbon         = input.bool(true, "Show Trend-Ribbon Fill", group="Visual Engine")
show_hud            = input.bool(true, "Show Scalper Analytics HUD", group="Visual Engine")
hud_pos_input       = input.string("Top Right", "HUD Position", options=["Top Right", "Top Left", "Bottom Right", "Bottom Left"], group="Visual Engine")

// ————— Color Palette —————
bull_color          = input.color(#00E676, "Bullish Color", group="Color Palette")
bear_color          = input.color(#FF5252, "Bearish Color", group="Color Palette")
vwap_color          = input.color(#00E5FF, "VWAP Color", group="Color Palette")

// ————— Anchored VWAP Logic —————
bool new_day_session = ta.change(time("D")) != 0

bool new_anchor = switch vwap_anchor
    "Session" => new_day_session
    "Week"    => ta.change(time("W")) != 0
    "Month"   => ta.change(time("M")) != 0
    => false

var float vwap_sum   = 0.0
var float volume_sum = 0.0

if new_anchor
    vwap_sum   := 0.0
    volume_sum := 0.0

vwap_sum   += hlc3 * volume
volume_sum += volume

float vwap_value = volume_sum > 0 ? vwap_sum / volume_sum : hlc3

// ————— Session Signal Counter Reset —————
var int session_signal_count = 0

if new_day_session
    session_signal_count := 0

// ————— Non-Repainting MTF Supertrend Security Call —————
f_supertrend(_mult, _period) =>
    [st_line, st_dir] = ta.supertrend(_mult, _period)
    [st_line[1], st_dir[1]]

[htf_supertrend, htf_direction] = request.security(
     syminfo.tickerid, 
     htf_timeframe, 
     f_supertrend(atr_multiplier, atr_period), 
     gaps=barmerge.gaps_off, 
     lookahead=barmerge.lookahead_off)

bool htf_is_bullish = htf_direction < 0
bool htf_is_bearish = htf_direction > 0

// ————— Quality Metric Qualification Filters —————
float volume_sma_20 = ta.sma(volume, 20)
float rel_vol       = volume_sma_20 > 0 ? volume / volume_sma_20 : 1.0
bool vol_qualified  = rel_vol >= vol_mult_thresh

float candle_range  = high - low
float candle_body   = math.abs(close - open)
float body_pct      = candle_range > 0 ? (candle_body / candle_range) * 100.0 : 0.0
bool body_qualified = body_pct >= min_body_pct

// ————— Master Signal Engine & State Transition —————
bool price_above_vwap = close > vwap_value
bool price_below_vwap = close < vwap_value

bool raw_buy_cond  = price_above_vwap and htf_is_bullish and vol_qualified and body_qualified and (close > open)
bool raw_sell_cond = price_below_vwap and htf_is_bearish and vol_qualified and body_qualified and (close < open)

// State Tracking to prevent duplicate consecutive signals
var string current_trend_state = "NONE"

bool buy_signal  = false
bool sell_signal = false

bool within_session_limit = session_signal_count < max_signals_per_day

if raw_buy_cond and current_trend_state != "BULLISH" and within_session_limit
    current_trend_state := "BULLISH"
    buy_signal := true
    session_signal_count += 1

else if raw_sell_cond and current_trend_state != "BEARISH" and within_session_limit
    current_trend_state := "BEARISH"
    sell_signal := true
    session_signal_count += 1

else if not price_above_vwap and not price_below_vwap
    current_trend_state := "NEUTRAL"

// ————— Chart Plotting —————
p_vwap  = plot(vwap_value, "VWAP Line", color=vwap_color, linewidth=2)
p_st    = plot(htf_supertrend, "HTF Supertrend", color=htf_is_bullish ? bull_color : bear_color, linewidth=2)
p_close = plot(close, "Price Close Anchor", display=display.none)

fill(p_close, p_st, color=show_ribbon ? (htf_is_bullish ? color.new(bull_color, 88) : color.new(bear_color, 88)) : na, title="Trend Ribbon Fill")

// Execution Shape Signals
plotshape(
     show_signals and buy_signal and barstate.isconfirmed,
     title="BUY Scalp Signal",
     style=shape.labelup,
     location=location.belowbar,
     color=bull_color,
     text="BUY",
     textcolor=color.black,
     size=size.small)

plotshape(
     show_signals and sell_signal and barstate.isconfirmed,
     title="SELL Scalp Signal",
     style=shape.labeldown,
     location=location.abovebar,
     color=bear_color,
     text="SELL",
     textcolor=color.white,
     size=size.small)

// ————— Real-Time Analytics HUD Dashboard —————
string hud_pos = hud_pos_input == "Top Right" ? position.top_right : 
                 hud_pos_input == "Top Left" ? position.top_left : 
                 hud_pos_input == "Bottom Right" ? position.bottom_right : position.bottom_left

var table hud = table.new(hud_pos, 2, 6, bgcolor=color.new(#131722, 10), border_width=1, border_color=color.new(#363A45, 0))

if show_hud and barstate.islast
    color header_bg = current_trend_state == "BULLISH" ? color.new(bull_color, 20) : current_trend_state == "BEARISH" ? color.new(bear_color, 20) : color.new(#2A2E39, 0)
    
    table.cell(hud, 0, 0, "SCALPER HUD", text_color=color.white, bgcolor=header_bg, text_size=size.small)
    table.cell(hud, 1, 0, htf_timeframe + " HTF", text_color=color.white, bgcolor=header_bg, text_size=size.small, text_halign=text.align_right)
    
    table.cell(hud, 0, 1, "Session Trades", text_color=color.gray, text_size=size.small)
    table.cell(hud, 1, 1, str.tostring(session_signal_count) + " / " + str.tostring(max_signals_per_day), text_color=session_signal_count >= max_signals_per_day ? #FF5252 : #00E676, text_size=size.small, text_halign=text.align_right)
    
    table.cell(hud, 0, 2, "Price vs VWAP", text_color=color.gray, text_size=size.small)
    table.cell(hud, 1, 2, price_above_vwap ? "ABOVE (+)" : "BELOW (-)", text_color=price_above_vwap ? bull_color : bear_color, text_size=size.small, text_halign=text.align_right)
    
    table.cell(hud, 0, 3, "Volume Spike", text_color=color.gray, text_size=size.small)
    table.cell(hud, 1, 3, vol_qualified ? "PASSED (" + str.tostring(rel_vol, "#.##") + "x)" : "LOW VOL", text_color=vol_qualified ? bull_color : #FFB74D, text_size=size.small, text_halign=text.align_right)

    table.cell(hud, 0, 4, "Candle Conviction", text_color=color.gray, text_size=size.small)
    table.cell(hud, 1, 4, body_qualified ? "PASSED (" + str.tostring(body_pct, "#.#") + "%)" : "WEAK BODY", text_color=body_qualified ? bull_color : #FFB74D, text_size=size.small, text_halign=text.align_right)
    
    string engine_status = session_signal_count >= max_signals_per_day ? "LIMIT REACHED" : current_trend_state == "BULLISH" ? "BULLISH READY" : current_trend_state == "BEARISH" ? "BEARISH READY" : "WAITING ALIGNMENT"
    color engine_col     = session_signal_count >= max_signals_per_day ? #FF5252 : current_trend_state == "BULLISH" ? bull_color : current_trend_state == "BEARISH" ? bear_color : #FFB74D
    table.cell(hud, 0, 5, "Engine Status", text_color=color.gray, text_size=size.small)
    table.cell(hud, 1, 5, engine_status, text_color=engine_col, text_size=size.small, text_halign=text.align_right)

// ————— Non-Repainting Alerts —————
alertcondition(buy_signal and barstate.isconfirmed, title="BUY Scalp Alert", message="VWAP Scalper: Qualified BUY Signal Confirmed on {{ticker}} at {{close}}")
alertcondition(sell_signal and barstate.isconfirmed, title="SELL Scalp Alert", message="VWAP Scalper: Qualified SELL Signal Confirmed on {{ticker}} at {{close}}")

Overview

Entries require alignment across indicators, alongside volume surge criteria relative to a 20-period moving average and minimum candle body percentage filters. The script tracks and limits the total number of signals fired per daily session to prevent overtrading. Key settings adjust the VWAP anchor, higher-timeframe period, ATR parameters, volume thresholds, and daily signal caps. Signals and an analytics HUD plot directly on the main chart.

Details

Published by

systemic-quant on GitHub

Draws

On the price chart

Markets

Any symbol

Timeframes

M1-M5, 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

pinescriptpinescript-algorithmspinescript-guidespinescript-indicatorspinescript-strategiespinescript-trickspinescript-v5pinescript-v6

Settings

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

SettingTypeDefaultVariable
Max Signals Per Sessionint3max_signals_per_day
Min Volume Threshold (x 20-SMA)float1.2vol_mult_thresh
Min Candle Body % of Rangefloat50.0min_body_pct
VWAP Anchor PeriodstringSessionvwap_anchor
HTF Supertrend Timeframetimeframe15htf_timeframe
ATR Periodint10atr_period
ATR Multiplierfloat3.0atr_multiplier
Show Entry Signal Labelsbooltrueshow_signals
Show Trend-Ribbon Fillbooltrueshow_ribbon
Show Scalper Analytics HUDbooltrueshow_hud
HUD PositionstringTop Righthud_pos_input
Bullish Colorcolor#00E676bull_color
Show all 14 settings
SettingTypeDefaultVariable
Bearish Colorcolor#FF5252bear_color
VWAP Colorcolor#00E5FFvwap_color
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

This indicator plots an adaptive SuperTrend line, ribbon fill, and trend duration prediction boxes directly on the price chart. It scores signal quality using volume momentum and volatility, checks multi-timeframe confluence, and tracks support and resistance

Indicator v6 TrendVolatility & bands
Updated 2 weeks ago · MIT GitHub repository of Luxy Super-Duper SuperTrend Predictor Engine

Equity Intraday Analyst

by chris-c-thomas
13 stars

Equity Intraday Analyst is a comprehensive intraday overlay indicator for US equities and ETFs. It evaluates multi-EMA ribbons, session-anchored VWAP bands, OBV trends, momentum oscillators, TTM Squeeze, and optional market breadth indicators like NYSE TICK an

Indicator v6 TrendVolume
Updated 7 months ago · MIT GitHub repository of Equity Intraday Analyst

Momentum Checklist

by eddiebelaval
7 stars

This overlay indicator calculates ADX, DI+ and DI- from directional movement and true range, and a Money Flow Index from typical price and volume. It classifies bias as long when DI+ exceeds 25 and DI- stays under 20, short under the opposite condition, and ne

Indicator v6 Oscillators & momentumTrend
Updated 4 months ago · None stated GitHub repository of Momentum Checklist

Snagprofit WMA MA

by dearvn
4 stars

Snagprofit WMA MA calculates and plots weighted moving averages across multiple timeframes (1-minute, 5-minute, 15-minute, and 1-hour) alongside a chart-period simple moving average. It evaluates directional alignment between these moving averages and checks f

Indicator v5 Moving averagesTrend Repaints
Updated 4 years ago · None stated GitHub repository of Snagprofit WMA MA

This indicator evaluates multiple technical trading strategies and strategy combinations across various timeframes to identify the top-performing setup for Turkish stocks and other assets. Depending on whether the active chart is intraday or higher timeframe,

Indicator v5 Screeners & dashboardsTrend
Updated 2 weeks ago · None stated GitHub repository of Otomatik En İyi Strateji - BIST

Stats Table

by degenview
3 stars

Displays a statistical summary table pinned to the top right of the price chart. It calculates key metrics including ATR percentage relative to price, high-low range percentage over a configurable bar count, relative volume compared to its simple moving averag

Indicator v6 Screeners & dashboardsTrend
Updated 3 weeks ago · GPL-3.0 GitHub repository of Stats Table

More Trend scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers