# What is the volume ratio (relative volume)? Formula and a backtest

Canonical URL: https://marketheist.io/portfolio/learn/volume-ratio
By Jeffrey Lin · Published 2026-11-24 · Updated 2026-11-24 · Data through Sep 2026
Category: Indicators

## Key takeaways

- The volume ratio compares today's trading volume with the average of recent days: above 1 is busier than usual, below 1 quieter.
- It carries no direction. Heavy volume comes with panics as often as with breakouts, so on its own it cannot say whether to buy.
- Volume jumps when prices move sharply and when news arrives, so high readings cluster in turbulent markets.
- Traders use it to confirm another signal, for example acting on a breakout only when the day's volume is above its average.
- A rule that acts on single busy days changes position often, so trading costs weigh heavily on it.

## Definition

The volume ratio, also called relative volume, divides a day's trading volume by the average volume of recent days, so a reading above 1 marks a busier day than usual and a reading below 1 a quieter one. It measures participation, not direction: a heavy-volume day can be a sharp rally or a sharp sell-off.

Also known as: relative volume, RVOL, volume ratio indicator, unusual volume, volume spike, volume vs average volume.

## How it works

Take today's volume and divide it by the average volume of the last 20 trading days, today included. A reading of 1 is an ordinary day. A reading well above 1 means many more shares changed hands than usual, a reading well below 1 a thin, quiet session. Because the average is recent, the ratio adapts as a fund's normal volume grows or shrinks over the years, which raw volume does not.

Most days read a little below 1. Volume is lopsided: a few very heavy days, around sell-offs, news, option expiries and index rebalancing, pull the average up, so a typical day sits under it. That shape matters for thresholds. A rule that waits for a ratio above a level such as 1.2 is waiting for days that are uncommon by construction.

Volume and price changes are linked in size more than in sign. Jonathan Karpoff's survey of the evidence in 1987 found that volume rises with the absolute size of price changes, up or down. So a busy day says the market is moving and disagreeing, not which way the disagreement resolves. For individual stocks, Gervais, Kaniel and Mingelgrin found in 2001 that unusually high volume was followed by higher returns over the next month, an effect across stocks, not a rule for timing one fund.

The volume ratio is like the number of people in a shop compared with a normal afternoon: a crowd says something is happening, a sale or a fire alarm, but not which one.

That is why volume is usually a second condition. A breakout on heavy volume is read as more credible than one on light volume, and a sell-off on heavy volume as capitulation. Used alone, a rule that holds a fund after busy days ends up holding it after many of the worst days, because those are the busiest.

## Formula

**Volume ratio of day t**

```
VR_t = \frac{V_t}{\frac{1}{n} \sum_{k = 0}^{n - 1} V_{t - k}}
```

where:

- Vₜ: shares traded on day t
- n: the averaging period: 20 by default
- k: how many days back; k = 0 is today, so today is part of its own average

Because today is inside the average, the ratio can never exceed n: a day with all of the period's volume would read exactly n.

**The busy-day rule tested here**

```
s_t = {\begin{pmatrix} 1 & VR_t > \theta \\ 0 & otherwise \end{pmatrix}, r_{t + 1}^{rule} = s_t \cdot r_{t + 1} - c \cdot|s_t - s_{t - 1}|
```

where:

- θ: the threshold: 1.2 by default
- sₜ: the position decided at the close of day t: 1 = hold, 0 = cash
- rₜ₊₁: the fund's total return on the next day
- c: one-way trading cost as a fraction (5 basis points = 0.0005), charged on each entry and each exit

## Worked example

SPY daily bars from Oct 2006 to Sep 2026, about 20 years. The busy-day rule holds SPY for the next day after a day whose volume was more than 1.2 times its 20-day average, otherwise cash, with no trading costs; its mirror image holds SPY after every other day.

SPY's volume ratio had a median of 0.94: on a typical day volume was under its recent average, because a few very heavy days lift the average. The busy-day condition held on 21.3% of days, so the rule was invested 21.3% of the time, in 583 separate stretches, 29.2 a year, each lasting 1.8 days on average.

The busy-day rule grew 0.4% a year with volatility of 11.6% and a worst decline from a peak of -43.7%. The mirror rule grew 10.7% a year with volatility of 15.6% and a worst decline of -36.0%. Holding SPY throughout: 11.1% a year, 19.4% and -55.2%.

As with any pair of rules that split the days between them, their results multiply back to buy-and-hold: $10,000 became $10,841 under the busy-day rule and $75,907 under the mirror rule, and the first times the second, divided by $10,000, gives buy-and-hold's $82,292 apart from rounding. Whatever one side earned, the other did not.

The busy-day rule changes position often, so costs matter. Charged 5 basis points on each entry and each exit, its growth fell from 0.4% to -2.5% a year, with the same days in the market.

Data through Sep 2026. Reproduce id: 82a09b396e9bb98d (this guide, its lab setup and the data month).

## How MarketHeist computes it

- **Data**: Daily bars (open, high, low, close, volume) of the fund as the MarketHeist data service serves them to the backtester: prices adjusted for splits and dividends, so a dividend counts as reinvested. They come from a snapshot taken each month and cut at the data month of this page, and are not rounded. The fund's own history, not an extension: a fund younger than the window is measured over the years it has.
- **Window**: The worked example and the lab measure the last 20 years of trading days, Oct 2006 to Sep 2026 (5030 days), ending at the data month of this page. Every setup, and buy and hold, is measured over exactly these days; an indicator is warmed up on the days before them, so changing a setting never moves the window, and a setting that needs more history than exists before the window is refused rather than measured over fewer days.
- **Backtest**: The backtester's own engine, in the order it runs it: the indicator, the position rule (or entry and exit triggers) and the optional regime filter produce a position for every day of the fund's whole history; the position is then shifted forward by the execution delay and applied to each day's return over the window. Cash earns 0, there is no leverage, and a one-way cost in basis points is charged on the size of every change of position. Round trips are the closed entries of the trade log (a trade still open on the last day is not counted); the win rate is the share of them with a gain; the payoff ratio is the average win over the size of the average loss; expectancy is the average return per trade; the per-trade profit factor is the sum of the winning trades' returns over the size of the sum of the losing ones, while the per-day profit factor sums days.
- **Years and volatility**: A year is 252 trading days, the engine's convention: trades per year is round trips over days divided by 252, the CAGR is the growth multiple to the power 252 over the days, and volatility is the sample standard deviation of the daily returns times the square root of 252.
- **Indicator statistics**: The indicator's main output over the window: its last value, its 10th, 50th and 90th percentile (linear interpolation between ranks), and the share of days the rule alone says long, before the delay and any regime filter. Every output of the indicator is also summarized by its median and the share of days below 0.
- **Buy and hold**: The fund held every day of the window with dividends reinvested. The largest one-day gain and loss are the highest and lowest daily returns; the CAGR without the 10 or 30 largest gains (or losses) replaces those days' returns with 0 and recompounds.
- **Average volume**: Simple moving average of daily share volume over period bars, today included (default 20, from 2 to 300). (`sma` in packages/shared/engine/utils.ts)
- **Ratio (the signal)**: Today's volume divided by that average; no value while the average is not yet available or is 0. This is the primary output the position rule reads; the indicator needs volume only. (`compute` in packages/shared/engine/indicators/vol_ratio.ts)
- **Default rule**: Long while the ratio is strictly above 1.2, otherwise flat (the module's default). (`SPEC` in packages/shared/engine/indicators/vol_ratio.ts)
- **Volume data**: Daily share volume as the data source reports it for the fund, adjusted for share splits; the price side uses the dividend-adjusted close. (`yahooResultToRows` in packages/platform/ohlcv.ts)
- **Trading costs**: A one-way cost in basis points, charged on every bar where the position changes, in proportion to the size of the change: an entry and an exit each pay it once. Buy-and-hold pays nothing. (`runBacktest` in packages/shared/engine/backtest.ts)
- **Timing and cash**: The position decided at a bar's close is applied to the next bar's return (execution delay 1); cash earns 0. (`runBacktest` in packages/shared/engine/backtest.ts)
- **Engine functions**: `computePosition` (packages/shared/engine/run_basic.ts), `generatePosition` (packages/shared/engine/positions.ts), `applyRegimeFilter` (packages/shared/engine/regime_filter.ts), `generateTriggeredPosition` (packages/shared/engine/triggered_position.ts), `runBacktest` (packages/shared/engine/backtest.ts), `getIndicator` (packages/shared/engine/indicators/registry.ts)

## Volume ratio (relative volume) compared with its neighbours

The volume ratio and other ways to read volume

| Measure | What it compares | Direction | Typical use |
| --- | --- | --- | --- |
| Volume ratio (relative volume) | Today's volume with its recent average | None | Confirm a breakout; flag unusual days |
| Raw volume | Nothing: shares traded | None | Liquidity; changes with the fund's size over the years |
| On-balance volume | Cumulative volume signed by the day's direction | Yes | Divergences between volume and price |
| Rolling VWAP deviation | The close with a volume-weighted average price | Yes | Trend: above or below where volume traded |
| ATR% | Daily price range with its recent average | None | Volatility filters and stops |

## Limitations

- Volume has no direction. A busy-day rule holds the fund after heavy sell-offs as readily as after heavy rallies.
- Some heavy days are mechanical: option expiries, index rebalancing and the last days of a quarter lift volume without any news about the fund.
- A ratio counts shares, not dollars, and the data source's volume can differ from another source's depending on which venues are included. Comparisons across sources or across funds are rough.
- Rules on daily volume spikes trade often, so the zero-cost result overstates what a trader would have kept; the cost variant in the example shows the size of the gap at one cost level.
- The test ignores spreads and taxes, earns nothing on cash and describes one historical path of one fund.

## Frequently asked questions

**What is a high relative volume?**

There is no fixed cutoff. A day with twice the recent average volume is uncommon for a broad index fund; screeners for individual stocks often look for larger multiples. Compare a reading with the fund's own distribution, as the percentiles in the lab do.

**Why is the volume ratio below 1 on most days?**

Because volume is lopsided. A few very heavy days lift the average, so an ordinary day sits a little under it, and the median ratio is below 1.

**Does high volume predict returns?**

Not reliably for one fund's direction. Volume is linked to the size of price moves in both directions. Studies across many stocks have found that unusually high volume was followed by somewhat higher returns on average, but that is an effect across stocks over weeks, not a timing rule for an index fund.

**How is the volume ratio used with other indicators?**

As a second condition: act on a price signal only when the day's volume is above its average, or ignore signals on thin days. In the backtester that means combining two entry triggers, one of them on the volume ratio.

## References

1. Karpoff, J. M. (1987) The Relation Between Price Changes and Trading Volume: A Survey. Journal of Financial and Quantitative Analysis 22(1). Volume rises with the absolute size of price changes.
2. Gervais, S., Kaniel, R. and Mingelgrin, D. H. (2001) The High-Volume Return Premium. Journal of Finance 56(3).
3. Lo, A. W. and Wang, J. (2000) Trading Volume: Definitions, Data Analysis, and Implications of Portfolio Theory. Review of Financial Studies 13(2). How to measure volume and turnover.
4. Blume, L., Easley, D. and O'Hara, M. (1994) Market Statistics and Technical Analysis: The Role of Volume. Journal of Finance 49(1).

## Try it

App: https://marketheist.io/backtest/?c=eyJ0aWNrZXIiOiJTUFkiLCJmcmVxdWVuY3kiOiIxZCIsImluZGljYXRvcl9pZCI6InZvbF9yYXRpbyIsImluZGljYXRvcl9wYXJhbXMiOnsicGVyaW9kIjoyMH0sInBvc2l0aW9uX3J1bGUiOnsidHlwZSI6InRocmVzaG9sZCIsInRocmVzaG9sZCI6MS4yLCJkaXJlY3Rpb24iOiJhYm92ZSJ9LCJleGVjdXRpb25fZGVsYXkiOjEsInRyYW5zYWN0aW9uX2Nvc3RzX2JwcyI6MCwibGV2ZXJhZ2UiOnsibW9kZSI6Im5vbmUifX0

MCP prompt (MarketHeist MCP server, https://marketheist.io/mcp):

```
Using MarketHeist.io, backtest SPY on daily bars with the volume ratio (20-day average): hold SPY the day after volume is more than 1.2 times its average, otherwise cash, one-bar delay, over the last 20 years, once with no costs and once with 5 basis points per trade, and compare both with buy-and-hold.
```

Historical simulation, not advice.
