Home › Guides › Anchored VWAP

WHY BOTS FAILFREENO ACCOUNTAUTOMATED TRADE BOTSAnchored VWAPThe arithmetic of how bots failEDUCATION ONLY | NO SIGNALSEXAMPLE NUMBERS ARE LABELLEDAUTOMATED TRADE BOTSautomatedtradebots.com
A free page on anchored vwap. Education only, with example numbers labelled.
WHY BOTS FAIL

Anchored VWAP

Short answer

Anchored VWAP is the average price paid since a chosen starting bar, with each bar weighted by its volume. Ordinary VWAP restarts at the session open. The anchored version restarts where you say.

Anchored VWAP is the volume weighted average price counted from a bar you pick, not from the session open. The sum is simple. Choosing the bar is not.

The page explains the idea in plain words, works through the arithmetic with a table, and shows how it hits grid, martingale and DCA bots, then tells you what to check before you run one.

  • A worked example with real arithmetic
  • How it hits grid, martingale and DCA bots
  • How to check for it before you run a bot
  • No advice, no signals, no profit promises

Last reviewed 28 October 2026. Education only, not advice.

Free, no account Runs in your browser Worked numbers shown Not advice Examples labelled

Ready to go further

Next: see how plain VWAP works

Start with the VWAP indicator guide, which covers the session version and the same arithmetic.

Read the VWAP guideFree, no account
Reading time7 minutes
Worked exampleExact arithmetic
Tools linked0 on this page
Reviewed28 Oct 2026

What is included

  • What it is, in plain words
  • The formula or mechanism, with exact arithmetic
  • How it hits grid, martingale and DCA bots
  • A check you can run before you switch a bot on

Who it is for

  • People who run or plan to run a trading bot
  • Anyone reading a backtest or a bot sales page
  • Readers who want the numbers, not the pitch
  • Not advice, and not a signal service
Three anchored VWAPs on the same made-up bars47495115812Bar numberGrey: price. Blue: anchored at bar 1. Green: bar 5. Orange: bar 8. Made-up data, calculated by us on 31 Oct 2026, exact.
The picture for this page. Example numbers are made up unless the page says they were calculated.

Key facts

  • Anchored VWAP is the average price paid since a chosen starting bar, with each bar weighted by its volume. Ordinary VWAP restarts at the session open. The anchored version restarts where you say.
  • The formula is the sum of price x volume divided by the sum of volume, counted from the anchor bar to the current bar.
  • In the made-up example below, the same 12 bars give a VWAP of 49.16 from bar 1, 49.35 from bar 5 and 50.18 from bar 8 (calculated by us on 31 Oct 2026, exact). The choice of anchor changed the answer.
  • There is no correct anchor. Picking one is a judgement made with hindsight, which is a trap when a bot is tested on past data.
  • It describes what has already traded. It is not a forecast, and a price below or above it is not a signal.

What anchored VWAP is

VWAP stands for volume weighted average price. It answers one question: what was the average price paid so far, counting busy bars more than quiet ones? The plain version is explained in the VWAP indicator guide. It usually restarts at the start of each trading session.

Anchored VWAP changes one thing. You choose the bar where the count starts. Everything from that bar to now goes into the average, and everything before it is ignored. The line begins at the anchor and then moves with each new bar. The further it runs from the anchor, the more bars it holds and the slower it moves.

The idea behind it is simple. Some bars are events that people may care about: a swing low, a gap, a big news bar, the day a company reported. The anchored line shows the average price paid by everyone who traded since that event. It is a record of the cost of that group, nothing more.

The formula

For each bar, take a typical price. Many tools use the high plus the low plus the close, divided by 3. Some use the close alone. Multiply it by the bar volume. Then add up from the anchor bar:

Anchored VWAP = (sum of price x volume) / (sum of volume)
both sums run from the anchor bar to the current bar
Each new bar adds its price x volume to the top and its volume to the bottom

Because the sums are running totals, a bot does not need to loop over all the bars each time. It keeps two numbers, the running price x volume and the running volume, and updates them on each bar. Guard the division: if the running volume is zero, there is no VWAP yet.

A worked example

These are made-up bars. Each has a typical price and a volume, shown in the table. We anchor at bar 5, the lowest price in the set. The table shows the first five bars from the anchor.

BarPriceVolumePrice x volumeRunning price x volumeRunning volumeVWAP
547.50400190001900040047.50
648.50250121253112565047.88
749.50300148504597595048.39
850.502001010056075115048.76
951.00150765063725130049.02

At bar 5 the VWAP is just the price, 47.50, because only one bar has traded. At bar 6 the running price x volume is 31125 and the running volume is 650, so VWAP = 31125 / 650 = 47.88. By bar 9 it is 49.02. By bar 12 it has settled at 49.35, after 8 bars. The last price is 50.50.

Volume weighting matters. A plain average of the same 8 prices is 49.63, while the VWAP is 49.35. The difference comes from the bars with large volume, which pull the VWAP toward their prices.

Same bars, three anchors, three VWAPs at bar 12 (made-up)49.16Anchor bar 1VWAP at bar 1249.35Anchor bar 5VWAP at bar 1250.18Anchor bar 8VWAP at bar 12Only the starting bar changes. Highest minus lowest is 1.03. Made-up data, calculated by us on 31 Oct 2026, exact.
Anchors at bar 1, bar 5 and bar 8 on the same made-up bars. Highest minus lowest is 1.03. The line you see depends on the bar you chose.

Which anchor to pick, and why it is a judgement

Traders use many anchor points. None of them is the right one in any measured sense. Each answers a different question.

  • A swing low or swing high. The average price paid since the turn. It depends on which turn you call the swing, and that is only clear later.
  • A gap or a news bar. The average since the event. The event is easy to see, but how much it mattered is a guess.
  • The start of the week, month or year. A calendar anchor that needs no judgement about the chart. It also has no link to anything that happened in the market.
  • A large-volume bar. You can find it with the volume indicator. A bar can be big for many reasons, and volume alone does not say who was buying.
  • The start of a trade. For a bot that holds a position, the average price weighted by size since entry is a cost basis. This is closest to arithmetic and furthest from opinion.

The example shows the effect. With the same data, the end values are 49.16, 49.35 and 50.18. A person looking at the chart in hindsight can always find an anchor where price seemed to respect the line. With enough anchors to try, some line will look good. That is the same trap described in overfitting: the anchor is a setting, and a setting tuned on past data fits noise.

Limits for a bot

  • The anchor must be chosen by a rule, not by eye. A bot cannot say "the obvious low". It needs a written rule, for example "the lowest low of the last 20 bars", and that rule is a setting to test. A swing low is only known after later bars confirm it, so a test that anchors at it on the bar it happened uses information the bot did not have. This is look-ahead bias.
  • It slows down. After many bars the line barely moves, since one new bar is a small part of a large total. A rule that waits for price to cross a flat line behaves differently from one tested earlier, when the line was young.
  • Volume differs by market. Some markets report real traded volume. Others report tick counts or the volume of one venue, which is only a part of the whole. The line is only as good as the volume behind it.
  • A crossing is not an edge. Price spends time on both sides of any average. A bot that buys above and sells below pays the spread on each trade, and the line gives no reason the next move continues.
  • Many anchors, one result. If a bot tries dozens of anchors and keeps the best, it has done a search, and the best result of a search is optimistic.
  • Gaps and sessions. If data skips overnight or has thin bars, the sums include them. Check how your data source handles them.

How to check a rule that uses it

Write the anchor rule down before testing. Run it on data where the anchor can only use bars that had closed. Test in a range, an uptrend and a downtrend. Count the trades, the cost per trade and the largest losing run. Then keep a part of the data back and test once, as in backtesting. If the result needs one particular anchor to work, it is probably fitted.

Compared with a volume profile

Anchored VWAP gives one price, the average. A volume profile shows how much traded at each price level over a period. Both use volume, but they answer different questions: one gives an average, the other a shape. Neither says what happens next.

What it does not tell you

It does not say that price will return to the line, bounce from it or break it. It summarises prices already traded, from a start you chose. This page is education about a calculation, not a signal.

FAQ

Frequently Asked Questions

What is anchored VWAP?

It is the volume weighted average price counted from a bar you choose instead of from the session open. Every bar from the anchor to the current bar is included.

How is anchored VWAP calculated?

Add up price x volume for each bar from the anchor, add up the volume, and divide the first total by the second. Each new bar adds to both running totals.

Which bar should I anchor to?

There is no correct bar. Swing points, gaps, news bars and calendar dates are all used, and each answers a different question. A bot needs a written rule for the anchor and must test that rule.

Why does the anchor change the result?

Only the bars after the anchor count. A different start means a different set of prices and volumes, so the average differs, as the made-up example shows.

Can a bot use anchored VWAP?

Yes, it keeps two running totals. The hard part is choosing the anchor by rule without using later information, and showing the rule works on data it has not seen.

Are the numbers on this page real?

Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.

Can I use this to decide whether to run a bot?

It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.

Is this financial advice?

No. It is general education about a calculation. The prices and volumes are made up and nothing here is a signal.

Know the Risk Before You Run It

Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.

Trading carries a risk of loss