1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
69 lines of Pine Script v5 from VSA_Advanced_Indicator.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.
VSA_Advanced_Indicator.pine
//@version=5
indicator("VSA Volume Spread Analysis [Advanced]", overlay=true, max_bars_back=500)
// === INPUTS ===
length = input.int(20, "Volume SMA Length")
volMultiplierHigh = input.float(1.5, "High Volume Multiplier", step=0.1)
volMultiplierLow = input.float(0.5, "Low Volume Multiplier", step=0.1)
// === CALCULATIONS ===
volSMA = ta.sma(volume, length)
volHigh = volume > volSMA * volMultiplierHigh
volLow = volume < volSMA * volMultiplierLow
spread = high - low
body = math.abs(close - open)
clv = close == high and close == low ? 0 : (2 * close - high - low) / (high - low) // Close Location Value
// === LOGIC ===
// Upthrust: Wide spread up, closes low, high volume
upthrust = volHigh and close < open and close <= low + spread * 0.3 and spread > ta.sma(spread, length)
plotshape(upthrust, style=shape.labeldown, location=location.abovebar, color=color.red, text="Upthrust", textcolor=color.white)
// No Demand: Small spread up bar, low volume, closes in upper third
noDemand = volLow and close > open and close >= high - spread * 0.3 and spread < ta.sma(spread, length)
plotshape(noDemand, style=shape.triangledown, location=location.abovebar, color=color.orange, text="No Demand", textcolor=color.white)
// Stopping Volume: Down bar on ultra-high volume, closes off low
stoppingVolume = close < open and volHigh and close > low + spread * 0.3
plotshape(stoppingVolume, style=shape.labelup, location=location.belowbar, color=color.green, text="Stopping Vol", textcolor=color.white)
// Test Bar: Down bar on low volume, closes in top 1/3
testBar = close < open and volLow and close >= high - spread * 0.3
plotshape(testBar, style=shape.triangleup, location=location.belowbar, color=color.lime, text="Test", textcolor=color.black)
// Buying Climax: Very high volume, wide spread up, but close off highs
buyingClimax = close > open and volHigh and close < high - spread * 0.3 and spread > ta.sma(spread, length)
plotshape(buyingClimax, style=shape.xcross, location=location.abovebar, color=color.fuchsia, text="BC", textcolor=color.white)
// No Supply: Small down bar on low volume, closes in bottom third
noSupply = volLow and close < open and close <= low + spread * 0.3 and spread < ta.sma(spread, length)
plotshape(noSupply, style=shape.triangleup, location=location.belowbar, color=color.blue, text="No Supply", textcolor=color.white)
// Effort to Rise: Wide spread up on high volume, closes high
effortToRise = close > open and volHigh and close >= high - spread * 0.2 and spread > ta.sma(spread, length)
plotshape(effortToRise, style=shape.circle, location=location.belowbar, color=color.teal, text="ETR", textcolor=color.white)
// Effort to Fall: Wide spread down on high volume, closes low
effortToFall = close < open and volHigh and close <= low + spread * 0.2 and spread > ta.sma(spread, length)
plotshape(effortToFall, style=shape.circle, location=location.abovebar, color=color.maroon, text="ETF", textcolor=color.white)
// Trap Up Move: Breakout above recent high but closes weak on high volume
trapUp = high > ta.highest(high[1], 10) and close < high - spread * 0.3 and volHigh
plotshape(trapUp, style=shape.labeldown, location=location.abovebar, color=color.red, text="Trap Up", textcolor=color.white)
// Trap Down Move: Break below recent low but closes strong on high volume
trapDown = low < ta.lowest(low[1], 10) and close > low + spread * 0.3 and volHigh
plotshape(trapDown, style=shape.labelup, location=location.belowbar, color=color.green, text="Trap Down", textcolor=color.white)
// === COLORING BARS ===
barcolor( upthrust ? color.red :stoppingVolume ? color.green : testBar ? color.lime : noDemand ? color.orange : noSupply ? color.blue : buyingClimax ? color.fuchsia :effortToRise ? color.teal : effortToFall ? color.maroon :trapUp ? color.red :trapDown ? color.green : na)
// === Optional Alerts ===
alertcondition(upthrust, title="Upthrust", message="Upthrust detected")
alertcondition(testBar, title="Test Bar", message="Test Bar detected")
alertcondition(stoppingVolume, title="Stopping Volume", message="Stopping Volume detected")
alertcondition(buyingClimax, title="Buying Climax", message="Buying Climax detected")
alertcondition(trapUp, title="Trap Up Move", message="Trap Up Move detected")
alertcondition(trapDown, title="Trap Down Move", message="Trap Down Move detected")
Overview
VSA Volume Spread Analysis calculates volume moving averages, bar spread, and close location values to categorize individual candlestick behavior relative to average trading activity. When specific conditions are met, it plots labeled shapes identifying patterns such as upthrusts, buying climaxes, tests, stopping volume, effort moves, and fakeouts. User settings allow customization of the volume moving average length and the multipliers used to define high and low volume thresholds.
Wyckoff Volume Spread Analysis pattern detection
Identification of upthrusts, climaxes, tests, and absorption bars
Configurable high and low volume SMA multipliers
Direct on-chart pattern labeling with distinct visual shapes
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Volume SMA Length
int
20
length
High Volume Multiplier
float
1.5
volMultiplierHigh
Low Volume Multiplier
float
0.5
volMultiplierLow
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.
Vector Candles is an overlay indicator that recolors price candles using PVSRA volume rules taken from the Traders Reality concept. It compares each bar's volume with the average of the previous ten bars and also checks the product of spread and volume against
Point-Clip Unified Indicator plots breakout and directional labels on the price chart. It scores volume spikes against a volume average, range or opening-range breaks, optional VWAP or session-anchored VWAP, fast and slow EMA trend, and a higher-timeframe EMA
This indicator identifies unusually large candles and high trading volume directly on the price chart. It checks whether the current bar range exceeds the maximum high-low range over a specified lookback period. If the range breaks the record with volume below
This indicator recolors price candles from recent volume and range. It marks climax bars when current volume times range exceeds the prior ten-bar peak or volume is at least twice a ten-bar average, and rising bars at one and a half times that average. Bullish
This overlay indicator draws rounded psychological price levels and optional PVSRA vector candle colors on the price chart. It plots quarter, half, and whole levels from a user-set rounding value, with separate color, line style, and width for each. Vector col
This indicator detects institutional or large-scale market activity using candle body size and trading volume. It compares current candle bodies against a 20-period simple moving average and checks for volume spikes above an adjustable moving average filter. I