Indicators

TWAP (Time-Weighted Average Price): Formula, TWAP vs VWAP, and 25 Days of Execution on Bitcoin

The TWAP is the plain average of price over a period, every interval counting the same. The formula, how it differs from the VWAP, and what buying Bitcoin in 24 hourly slices would have cost against the day’s VWAP from October 4 to 28, 2026.

· Founder of PatternsWizard
Checked 7 min read
Session TWAP, (O + H + L + C) / 4, with session VWAP on Bitcoin, hourly, October 26, 2026, 12:00 UTC to October 28, 2026, 23:00 UTC. Illustration of how the indicator reads, not a backtest.
On this page
  1. TWAP formula
  2. TWAP vs VWAP
  3. Executing in 24 slices: TWAP against the day’s VWAP
  4. TWAP as an execution algorithm
  5. Does it work?
  6. Tested on our bench
  7. Frequently asked questions

Every pattern's results on one sheet

The only pattern cheat sheet with tested stats: 152 patterns, what the textbook says and what really happened on 6 markets. Free PDF, sent to your inbox.

The PDF by email, plus our newsletter: new tests and results that change. Unsubscribe anytime. Privacy.

The time-weighted average price, or TWAP, is the plain average of price over a period, every interval counting the same. It has two uses. As an indicator, it is a line that averages each bar’s price since the start of the session. As an execution method, it means splitting a large order into equal slices sent at regular intervals, so that the average fill lands near the period’s TWAP. Below: the formula, how it differs from the VWAP, and what executing in 24 hourly slices would have cost against the VWAP on 25 days of Bitcoin.

Session TWAP and VWAP on hourly Bitcoin

Session TWAP, (O + H + L + C) / 4, with session VWAP on Bitcoin, hourly, October 24, 2026, 00:00 UTC to October 28, 2026, 23:00 UTC. Illustration of how the indicator reads, not a backtest.
  • Price, hourly candles (hollow up, filled down)
  • TWAP, reset at 00:00 UTC each day (solid line)
  • VWAP, same reset (dashed line)
Session TWAP, (O + H + L + C) / 4, with session VWAP on Bitcoin, hourly, October 24, 2026, 00:00 UTC to October 28, 2026, 23:00 UTC. Illustration of how the indicator reads, not a backtest.

TWAP formula

TradingView’s built-in TWAP averages a price per bar from the start of each period, the “Anchor Period” that sets “how frequently the TWAP calculation will be reset.” For the price of each bar, “Traditionally, the bar’s average value is used as the source. By default, the source is ohlc4”, the average of open, high, low and close. The chart uses that default and resets at 00:00 UTC each day.

A note on that help page: its opening paragraph also says the TWAP “is calculated by dividing the total value of a security traded over a specific period of time by the total number of shares traded during that period.” That is the definition of the VWAP, a volume-weighted average. The settings it then describes, an average of each bar’s price, are those of a TWAP, and that is what we compute.

TWAP vs VWAP

Splitting an order by the clock or by the volume

Splitting an order by the clock or by the volume: top: market volume through the day, uneven from one interval to the next. Middle: a TWAP plan sends the same slice in every interval. Bottom: a VWAP plan sizes each slice to the expected volume, larger in busy intervals and smaller in quiet ones. Both plans buy the same total quantity.
Schematic, not market data.
TWAPVWAP
Weight of each barThe sameIts volume
Price per barUsually (O + H + L + C) / 4Usually the typical price (H + L + C) / 3
Needs volume dataNoYes
As an execution methodEqual slices at equal intervalsSlices sized to the expected volume of each interval

The two lines part when volume is uneven through the day. On our hourly Bitcoin bars from October 4 to October 28, 2026, the three hours from 12:00 to 15:00 UTC carried 18.8% of the volume, the largest block in the chart below, against 12.5% for any three hours if volume were spread evenly. A TWAP gives those hours 3 of 24 shares of the order; a VWAP gives them their volume. The chart splits the day into eight blocks of three hours.

Share of the day's Bitcoin volume by three-hour block, UTC

Share of the day's Bitcoin volume by three-hour block, UTC. 00:00 to 03:00: 13.4%; 03:00 to 06:00: 9.6%; 06:00 to 09:00: 12.8%; 09:00 to 12:00: 10.6%; 12:00 to 15:00: 18.8%; 15:00 to 18:00: 15.6%; 18:00 to 21:00: 9.6%; 21:00 to 24:00: 9.6%. Our computation; the inputs and the method are in the text.
Our computation; the inputs and the method are in the text.Hourly bars from October 4 to October 28, 2026, volume of one exchange. An even spread would give each block 12.5%.

Executing in 24 slices: TWAP against the day’s VWAP

Suppose a trader buys the same quantity of Bitcoin every hour of a UTC day, 24 slices, and each slice fills at its hour’s (O + H + L + C) / 4. The average price paid is that day’s TWAP. We compared it with the day’s VWAP, the usual benchmark for an execution, over the 25 complete days of our hourly data.

The five largest daily gaps, TWAP minus VWAP, in basis points

The five largest daily gaps, TWAP minus VWAP, in basis points. October 4, 2026 (day +2.10%): −30.8; October 8, 2026 (day −1.88%): +29.2; October 21, 2026 (day +1.28%): −27.8; October 24, 2026 (day −0.37%): +22.7; October 15, 2026 (day +0.69%): +20.6. Our computation; the inputs and the method are in the text.
Our computation; the inputs and the method are in the text.TWAP: average of the 24 hourly (O + H + L + C) / 4. VWAP: hourly (H + L + C) / 3 weighted by volume. Below zero, buying by the clock cost less than the VWAP. In brackets, the change from the day's open to its close.

On October 4, the TWAP was 85,268.79 and the VWAP 85,532.31; on October 8, 82,323.12 and 82,083.83. Over the 25 days, the TWAP was above the VWAP on 14 days, meaning the buyer paid more than the benchmark, and below it on 11. The average gap, in absolute value, was 9.5 basis points, the median 5.6 and the largest 30.8: on October 4, buying by the clock cost 0.31% less than the day’s VWAP; on October 8, 0.29% more. A gap of 10 basis points on a 1,000,000 dollar order is 1,000 dollars. Part of the gap comes from the price of each bar, not the weighting: our VWAP prices each hour at (H + L + C) / 3; with (O + H + L + C) / 4 on both sides, the average gap is 8.5 basis points and the largest 27.2, still on October 4.

TradingView presents the method this way: “TWAP is most commonly used to facilitate execution of bigger orders without excessive impact on the market price. The order is split into separate smaller orders which are executed with a delay between them to ensure that the size of the orders does not affect the market negatively.”

TWAP as an execution algorithm

A fixed TWAP schedule and a varied one

A fixed TWAP schedule and a varied one: top: an order split into eight equal slices at equal intervals, a regular pattern that others can spot in the trades. Bottom: the same total quantity in eight slices whose sizes and timing vary around the schedule, harder to read.
Schematic, not market data.

As a strategy, a TWAP order fixes three things: the total quantity, the time window and the interval. The slice is the quantity divided by the number of intervals. In the example above, 24 hourly slices over a UTC day. The schedule needs no volume forecast, which makes it simple and usable on markets where volume data is poor, but it keeps trading at the same pace in quiet hours, when each slice is a larger share of what trades. A fixed size at a fixed interval is also easy to spot in the trades it leaves; varying the size or the timing of the slices makes it harder to read. Like any slicing method, it does not promise a fill at the TWAP itself: each slice still pays the spread and moves the price it trades at.

Does it work?

The TWAP is above all an execution benchmark. Read as a trading signal, a close crossing the session TWAP lagged the market in both directions when our bench tested it across markets after costs; the results are in the section below (see our methodology). What the 25 days show is the size of the difference between the two benchmarks on Bitcoin: usually a few basis points, up to about 0.3% on a day. Which one an execution should be judged against depends on whether the trader wants to follow the clock or the volume.

Related pages: the session VWAP, the anchored VWAP, the volume-weighted moving average, day trading indicators and the list of technical indicators.

Data from our test bench

Tested on our bench

We coded the 2 strategies taught on this page, buy and sell side, and ran them on forex and crypto. With all markets pooled (daily bars, hourly for intraday rules): 2 did worse than the market.

Close crosses the session TWAP, bullishLagged the market

Entry: Hourly close crosses above the TWAP of the UTC day (mean of (O+H+L+C)/4 since 00:00 UTC; not on the session's first bar). Exit: Opposite cross or the last bar of the session.

In detail, all markets pooled

On 1-hour bars, the rule fired 1,453,678 times on 614 assets (currency pairs and crypto pairs) between 2012 and 2026, about once every 12 bars on each asset.

The average trade returned −0.002% before costs and the median trade −0.35%; 27% of trades made money, and the gains added up to only 1.00 times the losses.

A trade lasted 3 bars at the median, half of them between 1 and 6 bars.

Over exactly the same bars, compared with an equal-weight basket of the other assets of the same market, the trades ended −0.23% per trade after costs (95% interval −0.24% to −0.22%).

Signals
1,453,678614 assets, 2012 to 2026
Average trade
−0.002%before costs; median −0.35%
Winning trades
27%profit factor 1.00
Median hold
3 barshalf between 1 and 6
Vs the market, after costs
−0.23%95% interval −0.24% to −0.22%

After the signal, bar by bar

Share of signals where the price had moved in the signal’s direction after N bars, against the same assets at random dates (before costs).

Bars after1351020
After the signal45.9%46.9%47.4%47.8%48.1%
Random dates48.1%48.5%48.6%48.5%48.2%

Over time

The history cut into three periods with the same number of signals: gap per trade against the rest of the market, before costs.

PeriodSignalsVs market, before costs
2012 to 2022484,576−0.06%
2022 to 2024484,552−0.05%
2024 to 2026484,550−0.05%

Stress tests

The same trades, measured again under harsher assumptions (vs market, after costs).

VariantVs marketResult
As tested: entry at the signal close, standard costs−0.23%
Entry at the next bar's open−0.23%Holds
Trading costs doubled−0.41%Holds
1% most extreme trades trimmed on each side−0.29%Holds

With the trade we run on chart patterns instead (stop at 2 ATR, target at twice the risk, entry at the signal close), 33% of 1,452,768 trades hit the target first, for +0.02 R per trade on average against +0.01 R for the same trade at random dates of the same assets: no measurable difference from random dates.

Worst single trade of the whole test: −69.5% on CHESS/USDT, signal of 2026-02-06.

Real trades from the test

Taken from the test itself on well-known assets: the indicator lines are the values the bench computed for that signal, the shaded zone is the time in the trade, from the signal close to the exit. Best and worst are chosen among these assets, not over the whole test.

Close crosses the session TWAP, bullish: real trade on ATOM/USDT, 2026-10-27 23:00, 1-hour chart
Most recentATOM 2026-10-27 23:00 1-hour chartBought at the close of 2026-10-27 23:00 (1.63), sold 5 bars later, when the exit rule fired (1.64): +0.7% before costs.Against the other crypto pairs over the same bars, after costs: +0.5%.TWAP
Close crosses the session TWAP, bullish: real trade on TRX/USDT, 2024-12-03 02:00, 1-hour chart
Best tradeTRX 2024-12-03 02:00 1-hour chartBought at the close of 2024-12-03 02:00 (0.2236), sold 21 bars later, when the exit rule fired (0.4334): +93.8% before costs.Against the other crypto pairs over the same bars, after costs: +81.5%.TWAP
Close crosses the session TWAP, bullish: real trade on LTC/USDT, 2021-09-13 13:00, 1-hour chart
Worst tradeLTC 2021-09-13 13:00 1-hour chartBought at the close of 2021-09-13 13:00 (217.4), sold 1 bar later, when the exit rule fired (178.3): −18.0% before costs.Against the other crypto pairs over the same bars, after costs: −13.9%.TWAP
Close crosses the session TWAP, bullish: real trade on USD/CAD, 2022-04-08 04:00, 1-hour chart
Typical tradeUSD/CAD 2022-04-08 04:00 1-hour chartBought at the close of 2022-04-08 04:00 (1.26), sold 1 bar later, when the exit rule fired (1.26): −0.1% before costs.Against the other currency pairs over the same bars, after costs: −0.1%.TWAP

Market by market

MarketBarsSignalsAvg tradeWinnersVs market, after costsResult
Forex1-hour184,492−0.005%27%−0.03%Lagged the market
Crypto1-hour1,269,186−0.001%26%−0.26%Lagged the market
Close crosses the session TWAP, bearishLagged the market

Entry: Close crosses below the session TWAP. Exit: Opposite cross or the last bar of the session.

In detail, all markets pooled

On 1-hour bars, the rule fired 1,445,474 times on 614 assets (currency pairs and crypto pairs) between 2012 and 2026, about once every 12 bars on each asset.

The average trade returned −0.05% before costs and the median trade −0.35%; 27% of trades made money, and the gains added up to only 0.94 times the losses. For this sell signal, a trade gains when the price falls (a short sale).

A trade lasted 3 bars at the median, half of them between 1 and 7 bars.

Over exactly the same bars, compared with an equal-weight basket of the other assets of the same market, the trades ended −0.22% per trade after costs (95% interval −0.23% to −0.21%). For a sell signal, a positive number means the asset did worse than the others, as the signal announced.

Signals
1,445,474614 assets, 2012 to 2026
Average trade
−0.05%before costs; median −0.35%
Winning trades
27%profit factor 0.94
Median hold
3 barshalf between 1 and 7
Vs the market, after costs
−0.22%95% interval −0.23% to −0.21%

After the signal, bar by bar

Share of signals where the price had moved in the signal’s direction after N bars, against the same assets at random dates (before costs).

Bars after1351020
After the signal46.3%47.7%48.4%49.7%50.7%
Random dates48.7%49.6%50.0%50.5%51.2%

Over time

The history cut into three periods with the same number of signals: gap per trade against the rest of the market, before costs.

PeriodSignalsVs market, before costs
2012 to 2022481,886−0.05%
2022 to 2024481,860−0.05%
2024 to 2026481,728−0.04%

Stress tests

The same trades, measured again under harsher assumptions (vs market, after costs).

VariantVs marketResult
As tested: entry at the signal close, standard costs−0.22%
Entry at the next bar's open−0.22%Holds
Trading costs doubled−0.40%Holds
1% most extreme trades trimmed on each side−0.22%Holds

With the trade we run on chart patterns instead (stop at 2 ATR, target at twice the risk, entry at the signal close), 32% of 1,444,598 trades hit the target first, for +0.01 R per trade on average against +0.01 R for the same trade at random dates of the same assets: no measurable difference from random dates.

Worst single trade of the whole test: −147.3% on NU/USDT, signal of 2021-10-15.

Real trades from the test

Taken from the test itself on well-known assets: the indicator lines are the values the bench computed for that signal, the shaded zone is the time in the trade, from the signal close to the exit. Best and worst are chosen among these assets, not over the whole test.

Close crosses the session TWAP, bearish: real trade on UNI/USDT, 2026-10-27 20:00, 1-hour chart
Most recentUNI 2026-10-27 20:00 1-hour chartSold short at the close of 2026-10-27 20:00 (7.07), bought back 1 bar later, when the exit rule fired (7.09): −0.3% before costs.Against the other crypto pairs over the same bars, after costs: −0.3%.TWAP
Close crosses the session TWAP, bearish: real trade on SOL/USDT, 2021-05-19 01:00, 1-hour chart
Best tradeSOL 2021-05-19 01:00 1-hour chartSold short at the close of 2021-05-19 01:00 (53.52), bought back 22 bars later, when the exit rule fired (34.99): +34.6% before costs.Against the other crypto pairs over the same bars, after costs: +5.3%.TWAP
Close crosses the session TWAP, bearish: real trade on LINK/USDT, 2019-06-13 15:00, 1-hour chart
Worst tradeLINK 2019-06-13 15:00 1-hour chartSold short at the close of 2019-06-13 15:00 (1.13), bought back 2 bars later, when the exit rule fired (1.74): −54.4% before costs.Against the other crypto pairs over the same bars, after costs: −56.3%.TWAP
Close crosses the session TWAP, bearish: real trade on GBP/CHF, 2013-07-24 07:00, 1-hour chart
Typical tradeGBP/CHF 2013-07-24 07:00 1-hour chartSold short at the close of 2013-07-24 07:00 (1.44), bought back 1 bar later, when the exit rule fired (1.44): −0.1% before costs.Against the other currency pairs over the same bars, after costs: 0.0%.TWAP

Market by market

MarketBarsSignalsAvg tradeWinnersVs market, after costsResult
Forex1-hour184,493−0.004%27%−0.03%Lagged the market
Crypto1-hour1,260,981−0.05%27%−0.25%Lagged the market

Each strategy enters at the close of the signal bar and exits at the exit it teaches, without a stop. The test compares the asset with an equal-weight basket of the other assets of its market over exactly the same bars, net of trading costs; for a sell signal, beating the market means the asset did worse than the others. A result is shown as beating or lagging the market only when it survives a correction for the number of tests and holds in both halves of the history; it is marked fragile when entering at the next open, doubling costs or trimming extreme trades removes it. Daily index bars are not compared with other indices, because their closes fall at different hours; “Not measured” also covers samples too small to test. Rules were fixed before any result was seen. How we test

Frequently asked questions

What is TWAP?

The time-weighted average price: the plain average of price over a period, each interval weighted the same. It is also an execution method that splits a large order into equal slices at equal intervals.

How do you calculate TWAP?

Take a price for each bar, usually (open + high + low + close) / 4, add them up from the start of the period and divide by the number of bars. The average resets at the start of each period.

What’s the difference between VWAP and TWAP?

The VWAP weights each bar by its volume, the TWAP gives every bar the same weight. On 25 days of hourly Bitcoin bars, the two daily averages differed by 9.5 basis points on average and by 30.8 at most.

What is a TWAP strategy?

An execution plan that splits a large order into equal slices sent at equal time intervals over a chosen window, so that the average fill lands near the period's TWAP. It decides how to split the order over time, not whether to buy or sell, and it aims to limit market impact, not to make a profit.

Sources

  1. TradingView Help Center, Time Weighted Average Price
  2. StockCharts ChartSchool, Volume Weighted Average Price (VWAP)
, Founder of PatternsWizard

Passionate about finance, quantitative trading and data analysis. Amaury built the PatternsWizard test bench, which detects each pattern on full price history and measures what happened next against random entries.

PatternsWizard tests chart and candlestick patterns on full market history, against random entries. How we test patterns.

179 patterns testedRandom-walk self-test passed

All indicators articles