TWAP
Calculate TWAP instantly with the exact formula and a worked example.
TWAP
TWAP, the time-weighted average price, is the average price of an asset over a period in which every equal slice of time counts the same. Enter up to six interval prices to get the TWAP, the range and how far the latest price sits from it.
How the calculation works
The formula is TWAP = (P₁ + P₂ + … + Pₙ) ÷ N, where Pᵢ is the price for interval i and all intervals have the same length — every 5 minutes, every hour and so on. With equal intervals, time weighting reduces to a plain arithmetic mean.
Set the number of intervals N (1–6) and fill in P₁…P₆. Only the first N prices are used; the rest are ignored. For each interval traders usually take the bar’s close or its typical price — just be consistent.
Besides TWAP you get the minimum and maximum of the selected prices and the deviation of the last used price Pₙ from TWAP in percent: positive means the latest price is above the average, negative below.
Worked example
Defaults: N = 6 with prices 100, 101, 102, 101.5, 103 and 102.5. The sum is 610, so TWAP = 610 ÷ 6 ≈ 101.67. Low 100, high 103. The last price, 102.5, is (102.5 ÷ 101.67 − 1) × 100 ≈ 0.82% above TWAP. Set N = 4 and only the first four prices count: TWAP = 101.125, with the fourth price (101.5) 0.37% above it.
Things to keep in mind
- TWAP ignores volume. When activity varies a lot through the session, VWAP is usually the fairer execution benchmark.
- Intervals must be equal. With uneven gaps, weight each price by its duration or the result will be skewed.
- A TWAP execution algorithm splits a large order into equal slices over time; to judge it, compare your average fill price with the market TWAP over the same window.
- Six points is a quick sanity check. For longer windows, compute TWAP across all bars in a spreadsheet or your platform.
More about: TWAP
What it calculates
The “TWAP” calculator computes TWAP from 7 parameters: intervals n (the first n prices are used), p₁, p₂, p₃, p₄, p₅, p₆.
Used by investors to estimate returns, project savings, and analyze a portfolio.
Example calculation
With parameters Intervals N (the first N prices are used) = 6, P₁ = 100, P₂ = 101, P₃ = 102, P₄ = 101.5, P₅ = 103, P₆ = 102.5 the result is 101.67.
How to use
- Enter intervals n (the first n prices are used), p₁, p₂, p₃, p₄, p₅ and p₆ — each field above is adjustable with a slider.
- TWAP is calculated automatically as you type.
- Check the worked example below to see the formula applied to real numbers.
- Copy the result or bookmark this calculator.
Related calculators
FAQ
What is the difference between TWAP and VWAP?
Where is TWAP used?
Which price should I use for each bar?
What does a negative deviation mean?
More calculators in this category
Explore related free tools