Strategy · Pine Script v5 · On the chart

VWAP + Volume

by muammeryldrm42

The VWAP + Volume strategy trades crossovers of the Volume Weighted Average Price confirmed by volume surges.

View on GitHub

GitHub stars7on the repository
Pine versionv5runs as is
Lines of code30
Settings2inputs
LicenceMIT
Last update3 months ago8 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 strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

30 lines of Pine Script v5 from public/code/indicators__vwap_volume.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

indicators__vwap_volume.pine
//@version=5
strategy("VWAP + Volume", overlay=true,
         default_qty_type=strategy.percent_of_equity, default_qty_value=10)

volMult = input.float(1.5, "Volume Mult")
slAtrMult = input.float(1.5, "SL ATR")

vwapV  = ta.vwap
atrV   = ta.atr(14)
avgVol = ta.sma(volume, 20)
volSpike = volume > avgVol * volMult

crossUp = ta.crossover(close, vwapV) and volSpike
crossDn = ta.crossunder(close, vwapV) and volSpike

if crossUp and strategy.position_size == 0
    sl = close - slAtrMult * atrV
    risk = close - sl
    strategy.entry("VW L", strategy.long)
    strategy.exit("X", "VW L", stop=sl, limit=close + risk * 2.5)

if crossDn and strategy.position_size == 0
    sl = close + slAtrMult * atrV
    risk = sl - close
    strategy.entry("VW S", strategy.short)
    strategy.exit("X", "VW S", stop=sl, limit=close - risk * 2.5)

plot(vwapV, "VWAP", color.orange, 2)
plotshape(crossUp, "L", shape.triangleup,   location.belowbar, color.lime)
plotshape(crossDn, "S", shape.triangledown, location.abovebar, color.red)

Overview

VWAP + Volume enters long or short positions when the closing price crosses above or below the VWAP line while volume exceeds its 20-period simple moving average by a configurable multiplier. Orders are placed only when flat, with risk defined by an Average True Range stop loss and a take profit set at 2.5 times the initial risk distance. It plots the VWAP line and signal markers directly on the price chart.

Details

Published by

muammeryldrm42 on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Volume, Breakout, Volatility & bands

Markets

Any symbol

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

cryptofuturessodexsosovaluestrategyvaluechain

Settings

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

SettingTypeDefaultVariable
Volume Multfloat1.5volMult
SL ATRfloat1.5slAtrMult
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

BB and KC Strategy

by hasnocool
106 stars

This strategy identifies breakout momentum by combining Bollinger Bands and Keltner Channels with volume confirmation. It opens long positions when the upper Keltner Channel crosses above the upper Bollinger Band and volume exceeds its moving average. Converse

Strategy v5 Volatility & bandsBreakout
Updated 2 years ago · GPL-3.0 GitHub repository of BB and KC Strategy

VOL/BBW/RSI/15 Strategy

by SammyEnigma
18 stars

This strategy overlays Bollinger Bands on the price chart and trades a long squeeze setup. It enters long when band width is below 0.022 and volume is at least the seven-bar average, using a stop order at the lower band. It places a short order when close cros

Strategy v4 Volatility & bandsVolume
Updated 6 years ago · None stated GitHub repository of VOL/BBW/RSI/15 Strategy
257 stars

This overlay strategy is built for ES futures on the one-minute chart. It plots a volume-weighted moving average of price opens and standard-deviation bands at Fibonacci ratios, plus a second longer volume-weighted average from a higher-timeframe open. Call an

Strategy v5 Volatility & bandsMoving averages
Updated 6 weeks ago · None stated GitHub repository of ES Futures 1M No Repaint
218 stars

This strategy detects price breakouts above rolling highest highs or below lowest lows over a customizable lookback period. It includes optional volume spike and ATR volatility threshold filters, along with bar confirmation rules. Positions are taken upon conf

Strategy v6 BreakoutVolatility & bands
Updated 3 months ago · None stated GitHub repository of Breakout Strategy Template

Bollinger Breakout

by hackingthemarkets
189 stars

This price-chart strategy plots a simple moving average and upper and lower bands built from the standard deviation of close, scaled by separate offset inputs. It enters a fixed quantity long when close crosses above the upper band and a fixed quantity short w

Strategy v4 Volatility & bandsBreakout
Updated 3 years ago · None stated GitHub repository of Bollinger Breakout

More strategys

Trade Your Charts With a Regulated Broker

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

Compare brokers