TradingView indicators

Williams Accumulation/Distribution: calculate WAD from price

Williams Accumulation/Distribution (WAD) adds a signed price contribution on each bar. The sign follows the change from the previous close; the size uses the current high or low extended to include that previous close. WAD does not use volume. In Pine Script v6, its built-in value is ta.wad.

The name does not mean this line measures money entering an asset or identifies institutional trades. The calculation below shows exactly what it measures, including gaps and unchanged closes.

The WAD formula

Let C be the current close, P the previous close, H the current high and L the current low. Set trueHigh = max(H, P) and trueLow = min(L, P). These are range boundaries, not an ATR average or a divisor.

WAD contribution rules by closing-price change
ConditionContributionEffect
C > PC - trueLowAdd a positive price amount
C < PC - trueHighAdd a negative price amount
C = P0Keep the cumulative total

WAD = previous WAD + contribution. A zero seed defines the baseline; the output is cumulative price units, not a percentage or an oscillator with fixed overbought levels. The current open is absent from the formula. TradingView documents these rules for ta.wad.

Five bars you can calculate by hand

This synthetic OHLC dataset starts both cumulative comparisons at zero after bar 0. Bar 0 supplies the previous close only. Volume is included solely to calculate the Chaikin column; changing it leaves every WAD value unchanged.

Synthetic OHLC example with WAD and Chaikin ADL contributions
BarOpenHighLowCloseVolumeTrue high / lowWAD changeWAD totalChaikin change
0: seed100102981001,000Not availableBaseline0Excluded
1: rise100105991041,000105 / 99104 - 99 = +55+666.67
2: gap down9710096991,200104 / 9699 - 104 = -50+600
3: equal close981039799900103 / 9700-300
4: gap up106108105107800108 / 99107 - 99 = +88+266.67

On bar 2, the close drops from 104 to 99. The true high is 104, although the current bar only reaches 100, so WAD adds -5. Chaikin ADL adds ((99 - 96) - (100 - 99)) / (100 - 96) × 1,200 = +600 because the close is above the midpoint of the new bar. The opposite signs follow from different inputs.

Bar 3 closes above its open but equals the previous close. WAD adds zero. On bar 4, the previous close of 99 extends the true low below the actual low of 105. WAD adds 8, not the close-minus-low value of 2.

The WAD contributions total 5 - 5 + 0 + 8 = 8. Chaikin contributions total approximately 1,233.33 volume units. Their scales are different, so comparing the heights of the two lines would not compare strength.

WAD, Chaikin ADL and Williams Variable A/D

Check the formula when a script is simply named A/D. Chaikin ADL accumulates ((C - L) - (H - C)) / (H - L) × volume. It uses the close within the current range and does not use the previous close. Its zero-range case needs a defined implementation policy because the displayed formula divides by H - L. See the official ADL calculation and the Chaikin ADL guide.

Williams Variable Accumulation/Distribution is another distinct series: ta.wvad uses (close - open) / (high - low) × volume. It must not replace ta.wad in this example. WAD needs no volume field and has no range division. A flat bar with H = L = C still contributes C - P when C differs from P; if C = P, it contributes zero.

Plot WAD in TradingView with Pine Script v6

Paste this into a new indicator in the Pine Editor, save it, then add it to the chart. Blue is the built-in series. Orange dots expose the explicit calculation. Read the bar contribution in the Data Window when checking a completed candle.

Pine Script v6 · Indicator, no orders
//@version=6
indicator("Williams AD: built-in and explicit calculation", overlay = false)

bool hasPrices = not na(high) and not na(low) and not na(close) and not na(close[1])
float trueHigh = math.max(high, close[1])
float trueLow = math.min(low, close[1])
float contribution = 0.0
if hasPrices
    if close > close[1]
        contribution := close - trueLow
    else if close < close[1]
        contribution := close - trueHigh

// Seed at zero. Skip unavailable comparisons; do not invent prices.
float explicitWad = ta.cum(contribution)
plot(ta.wad, "Built-in WAD", color = color.blue, linewidth = 2)
plot(hasPrices ? explicitWad : na, "Explicit WAD (skip missing)", color = color.orange, style = plot.style_circles)
plot(hasPrices ? contribution : na, "Bar contribution", display = display.data_window)
bgcolor(not hasPrices and not barstate.isfirst ? color.new(color.orange, 85) : na, title = "Unavailable price comparison")

The explicit accumulator starts at zero. It hides the first point because the prior close is unavailable. A later missing required price also hides the point and adds nothing; orange shading flags the unavailable comparison. If a close is missing, the following bar also lacks its immediately previous close. Accumulation resumes only when all required inputs exist. Skipped movement cannot be recovered from this script.

This missing-data policy is deliberate. Compare the explicit result with the built-in on complete standard OHLC data; do not assume identical handling of every malformed series. The code plots values and does not detect divergence, create alerts or backtest trades. Syntax validation cannot establish those behaviors.

What a WAD disagreement can and cannot tell you

  • Compare matching swing dates. A lower price low with a higher WAD low is a bullish divergence description; a higher price high with a lower WAD high is bearish divergence. Define the swing rule before examining its outcomes. Neither pattern supplies an entry, stop or exit by itself.
  • Confirm when information was available. A pivot requiring three bars to its right is known three bars later. Labeling the pivot retrospectively must not make a backtest enter at the earlier date.
  • Expect live values to move. High, low and close can change while a bar is open. Use completed bars for rules that require final OHLC. TradingView describes this behavior in its repainting documentation.
  • Keep the calculation start consistent. Adding older history can shift the cumulative baseline. Zero is an origin chosen by the dataset, not a universal buy or sell level. A daily reset would create a modified indicator.
  • Missing volume is not a WAD problem; missing or altered prices are. Session selection, feed differences and synthetic candles change the inputs. Removing volume from a formula cannot remove bad price data or prevent false trading signals.

Educational calculation, not investment advice. No timeframe, divergence rule or indicator combination here has a demonstrated win rate. Any trading test needs explicit execution rules, costs and a separate period for evaluation.

Specify a WAD modification before generating code

Pineify's Pine Script AI Coding Agent can help create or edit a script from your rules. Provide the formula, starting convention and missing-data policy; request a syntax check and compare the output with completed chart bars. Generated code still needs behavioral review.

Create a Pine v6 Williams A/D indicator using price only. Plot the built-in and an explicit calculation. Set equal-close contribution to zero, flag missing required prices, and explain the first-bar seed. Do not add trading signals. Check syntax.
Explore the Pine Script AI Coding Agent

WAD questions

Sources and related calculations

Sources checked October 17, 2026. The numeric dataset is illustrative, not market performance.

Continue with the Chaikin ADL calculation, Money Flow Index and its volume requirement, or the TradingView indicator library.