The running average of price over time within a session — every bar counts equally, unlike VWAP where volume sets the weights.
TWAP (Time-Weighted Average Price) is the plain arithmetic average of price over a defined window, most often the current trading session: add up a price value (such as the bar's typical price) for every bar since the session began and divide by the number of bars. Its origin is execution benchmarking, not charting — institutional desks slice large orders evenly across time and measure their fills against TWAP to check execution quality. On a chart it appears as a smooth line anchored to the session open, similar in shape to VWAP but built without volume. The difference from VWAP is exactly one thing: TWAP weights every time interval equally, while VWAP weights each price by the volume traded there. On a low-activity bar, TWAP counts that bar's price fully; VWAP barely moves. Both are descriptive averages of what has already traded, not levels the market owes any respect to. This is educational material, not financial advice — no average line predicts future price, and trading involves risk of loss.
TWAP is a cumulative mean that resets at an anchor, usually the session or daily open. Each confirmed bar contributes one price observation — commonly the typical price (high + low + close) / 3, though close or hlc4 are also used. The formula is TWAP = (sum of price values since the anchor) / (number of bars since the anchor). Compare this with VWAP = (sum of price x volume) / (sum of volume) over the same window: structurally identical cumulative ratios, differing only in the weighting term. Because each new bar is one observation among an ever-growing count, TWAP becomes progressively harder to move as the session ages — a large price swing late in the day barely bends the line. Early in the session, with few bars accumulated, it tracks price closely. One honest subtlety: chart-based TWAP is an approximation of true TWAP, which is defined on continuous time; using one value per bar assumes each bar represents an equal slice of time, which breaks slightly around session gaps or missing bars. And because TWAP ignores volume entirely, it can sit far from VWAP on days where volume clustered at particular prices — that divergence is a description of how activity was distributed, not a signal.
The main choices are the price source (typical price hlc3 is common; close or ohlc4 also appear) and the anchor that resets the accumulation — usually the daily session open, though weekly or custom-session anchors are used. There are no length parameters to tune: TWAP is cumulative from its anchor by definition. Intraday timeframe affects granularity slightly (more bars approximate continuous time better), and execution desks typically compute TWAP over the specific interval an order works, rather than the whole session.
//@version=6
indicator("Session TWAP vs VWAP", overlay = true)
src = input.source(hlc3, "Price Source")
// Reset the cumulative time-average at each new daily session.
newDay = timeframe.change("D")
var float priceSum = 0.0
var int barCount = 0
if newDay
priceSum := 0.0
barCount := 0
priceSum := priceSum + src
barCount := barCount + 1
twapLine = priceSum / barCount
plot(twapLine, "Session TWAP", color = color.blue)
plot(ta.vwap(src), "Session VWAP (compare)", color = color.orange)Pro tip: Plot TWAP and VWAP together for a few sessions and study where they separate: the gap is a direct picture of how volume was distributed relative to time, which is more informative than either line alone. If your instrument has no trustworthy volume data (spot forex especially), be honest that VWAP there is built on broker-feed tick counts, and prefer TWAP for a defensible average. Educational context only, not financial advice — neither average predicts price, and trading involves risk of loss.
Educational only — not financial advice, not a recommendation to trade. No indicator is predictive; trading involves substantial risk of loss.