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.

On this page
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

- Price, hourly candles (hollow up, filled down)
- TWAP, reset at 00:00 UTC each day (solid line)
- VWAP, same reset (dashed line)
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

| TWAP | VWAP | |
|---|---|---|
| Weight of each bar | The same | Its volume |
| Price per bar | Usually (O + H + L + C) / 4 | Usually the typical price (H + L + C) / 3 |
| Needs volume data | No | Yes |
| As an execution method | Equal slices at equal intervals | Slices 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

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

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

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 after | 1 | 3 | 5 | 10 | 20 |
|---|---|---|---|---|---|
| After the signal | 45.9% | 46.9% | 47.4% | 47.8% | 48.1% |
| Random dates | 48.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.
| Period | Signals | Vs market, before costs |
|---|---|---|
| 2012 to 2022 | 484,576 | −0.06% |
| 2022 to 2024 | 484,552 | −0.05% |
| 2024 to 2026 | 484,550 | −0.05% |
Stress tests
The same trades, measured again under harsher assumptions (vs market, after costs).
| Variant | Vs market | Result |
|---|---|---|
| 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.




Market by market
| Market | Bars | Signals | Avg trade | Winners | Vs market, after costs | Result |
|---|---|---|---|---|---|---|
| Forex | 1-hour | 184,492 | −0.005% | 27% | −0.03% | Lagged the market |
| Crypto | 1-hour | 1,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 after | 1 | 3 | 5 | 10 | 20 |
|---|---|---|---|---|---|
| After the signal | 46.3% | 47.7% | 48.4% | 49.7% | 50.7% |
| Random dates | 48.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.
| Period | Signals | Vs market, before costs |
|---|---|---|
| 2012 to 2022 | 481,886 | −0.05% |
| 2022 to 2024 | 481,860 | −0.05% |
| 2024 to 2026 | 481,728 | −0.04% |
Stress tests
The same trades, measured again under harsher assumptions (vs market, after costs).
| Variant | Vs market | Result |
|---|---|---|
| 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.




Market by market
| Market | Bars | Signals | Avg trade | Winners | Vs market, after costs | Result |
|---|---|---|---|---|---|---|
| Forex | 1-hour | 184,493 | −0.004% | 27% | −0.03% | Lagged the market |
| Crypto | 1-hour | 1,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.
