
Volume Weighted Average Price (VWAP) is one of the most reliable tools for intraday traders, especially in the Indian stock market where volatility can be high and liquidity varies throughout the session. Unlike simple moving averages, VWAP incorporates volume data, giving it a unique advantage in identifying true price levels where institutional traders have accumulated positions.
In this guide, we’ll build a complete VWAP-based trading strategy in Pine Script v5, with entry and exit rules optimized for Indian market hours (9:15 AM to 3:30 PM). Need a custom Pine Script solution? Jayadev Rana builds professional indicators and strategies for traders.
What Is VWAP and Why Intraday Traders Rely on It
VWAP calculates the average price a security has traded at, weighted by volume at each price level. The formula is straightforward: sum of (price × volume) divided by total volume. What makes this powerful is that it reflects where smart money has actually traded.
When price is above VWAP, it signals bullish sentiment. When it’s below, bearish pressure dominates. For intraday traders in India’s NSE and BSE, this becomes a critical reference level. During the opening hour (9:15-10:15 AM), price action relative to VWAP often sets the tone for the entire trading session.
Key reasons intraday traders use VWAP include institutional activity detection (VWAP shows where large blocks traded), dynamic support and resistance, trend confirmation, logical stop-loss placement, and reduced false signals since volume-weighted data filters out low-volume noise spikes.
Understanding VWAP Bands and Entry Points
A basic VWAP line is useful, but adding standard deviation bands creates a complete trading framework. These bands act like dynamic support and resistance, tightening during calm markets and expanding during volatile periods. The upper band (VWAP + 2 SD) marks the extreme bullish zone, the middle line represents fair value, and the lower band (VWAP – 2 SD) signals oversold conditions.
For intraday trading in liquid stocks like TCS, HDFC Bank, or Infosys, the bands provide excellent breakout signals. When price breaks above the upper band on high volume, it often indicates institutional buying.
Coding a VWAP Strategy in Pine Script

//@version=5
indicator("VWAP Strategy", overlay=true, max_bars_back=5000)
// VWAP calculation
vwap_value = ta.vwap(close)
// Standard deviation bands
dev = ta.stdev(close, 20) * 2
upper_band = vwap_value + dev
lower_band = vwap_value - dev
// Plot VWAP and bands
plot(vwap_value, "VWAP", color=color.blue, linewidth=2)
plot(upper_band, "Upper Band", color=color.red, linewidth=1, style=plot.style_dashed)
plot(lower_band, "Lower Band", color=color.green, linewidth=1, style=plot.style_dashed)
// Trading logic
long_signal = close > vwap_value and close > open and volume > ta.sma(volume, 20)
short_signal = close < vwap_value and close < open and volume > ta.sma(volume, 20)
// Alerts
alertcondition(long_signal, title="VWAP Long", message="{{ticker}} above VWAP with volume confirmation")
alertcondition(short_signal, title="VWAP Short", message="{{ticker}} below VWAP with volume confirmation")
This code uses TradingView’s built-in VWAP function, which automatically calculates volume-weighted price from the start of the trading session. The strategy enters long when price closes above VWAP with bullish candles and above-average volume.
Optimized Entry and Exit Rules for Indian Markets
Entry Rules
Enter long only when close is above VWAP with volume exceeding the 20-period SMA. Apply a time filter to avoid the first 15 minutes (gap noise) and last 30 minutes (volatility spikes). Use ATR to avoid trading during low-liquidity periods. Stronger signals occur when price breaks beyond the 1-SD band.
Exit Rules
Take 60% off at +1% to +2% profit and let the rest run. Place stop-loss at VWAP or the lower/upper band depending on direction. Use a 7-10 period ATR trailing stop for trend trades. Close all intraday positions 30 minutes before market close (3:00 PM IST) to avoid settlement issues.
If building this yourself feels overwhelming, you can connect with a Pine Script expert on WhatsApp for a custom solution tailored to your trading style.
Best Indian Stocks for VWAP Trading
VWAP works best on highly liquid instruments. Top NSE stocks for VWAP trading include TCS (extremely liquid, tight spreads), HDFC Bank (institutional favorite, predictable VWAP bounces), Infosys (large intraday volume, reliable bands), ITC (high daily turnover), and Reliance (best for breakout trades off VWAP).
On 5-minute and 15-minute charts of these stocks, VWAP bands often provide 3-5 high-probability setups per trading session. The key is waiting for volume confirmation rather than trading every touch. Check our guide on best TradingView indicators for intraday for more setup ideas.
Common VWAP Mistakes to Avoid
Trading at market open is the most common mistake—the first 15 minutes have gap noise and opening volatility. Wait for VWAP to stabilize. Ignoring volume is another pitfall: a VWAP touch without volume increase is often a fake-out. Holding through close destroys profits as intraday liquidity drops rapidly after 3:15 PM IST. Using tight stops also fails because VWAP bands are dynamic—use band width as a guide for stop placement, not fixed points.
FAQ: VWAP Strategy Questions
Q: What timeframe is best for VWAP intraday trading?
A: 5-minute and 15-minute charts work best. On 1-minute charts, VWAP is too noisy. On 30-minute+, you miss too many intraday moves.
Q: Should I use VWAP alone or combine with other indicators?
A: VWAP works alone but benefits from volume confirmation. RSI can confirm overbought/oversold at VWAP bands. See our Supertrend guide for combination ideas.
Q: Why does my VWAP reset each day?
A: That’s correct behavior. VWAP resets at market open (9:15 AM IST) because it’s calculated from session start. This is actually an advantage—you get a fresh reference level daily.
Q: Can I use VWAP for swing trading?
A: Not effectively. VWAP resets daily, making it unsuitable for multi-day trades. Use moving averages or pivot points for swing trading instead.
Need a Custom Pine Script Solution?
Jayadev Rana is a professional Pine Script developer who builds custom indicators, strategies, and automated trading systems for TradingView.