Skip to content

The wrong bars to compare against

Your alert fires on “volume more than three times the twenty-bar average”, and it fires every single morning on roughly the same forty stocks. The filter is not finding unusual participation. On an intraday chart it is finding the time of day, and the fix is to change the denominator rather than the threshold.

Technical AnalysisIntermediate12 min read
Browse Technical Analysis(123)

The scan is a reasonable one and it is the first thing most people build. On a five-minute chart, flag any bar whose volume exceeds three times the average of the previous twenty bars. Run it for a fortnight and a pattern appears that has nothing to do with the stocks: it fires in a burst between 9.15 and 9.30, goes quiet through the middle of the day, and fires again after three o’clock. The first instinct is that Indian markets are busy at the ends of the day, which is true and is taught in this track as the [[Volume smile]]. The second and more useful thought is that the filter cannot possibly be measuring what it was built to measure, because a filter that fires at the same times every day is measuring the clock.

Think of it like this
The busiest platform in India

Stand on a suburban platform at 9.10 in the morning and count the crowd, then compare it with the count from twenty minutes earlier. It is far bigger, every single day, and it means nothing at all. To know whether today is genuinely unusual you compare this morning’s 9.10 with the last twenty mornings’ 9.10 — and then a strike, a festival or a diverted line shows up immediately.

In the market

An intraday volume bar has the same property. Its neighbours on the chart are not its peers; the same slot on other days is. Compare a bar with the twenty bars beside it and you rediscover the timetable. Compare it with the same five minutes across twenty sessions and you find the news.

What the rolling window is actually holding

Follow the denominator literally. At 9.20 this morning, the twenty five-minute bars immediately before the current one are not from this morning at all — twenty bars of five minutes is a hundred minutes, and the session had only just opened. They are yesterday’s bars from about 1.50 in the afternoon to the close. That window contains the quiet middle of yesterday and then yesterday’s closing rush, in whatever proportion the clock happened to produce.

Worked example
Two bars, two methods, opposite answers
An illustrative midcap, with typical five-minute volumes taken from its own last twenty sessions
This stock’s usual 9.15 – 9.20 barThe median of that slot across the last twenty sessions — the opening burst, on an ordinary dayAbout 84,000 shares
This stock’s usual 13.00 – 13.05 barThe same stock in the flat part of the afternoon. A ninefold difference, on days when nothing at all happensAbout 9,000 shares
Today’s 9.15 – 9.20 barA heavy open150,000 shares
Today’s 13.00 – 13.05 barA much smaller number in absolute terms31,000 shares
The rolling twenty-bar method at 9.20The denominator is yesterday afternoon. The alert fires loudly150,000 ÷ about 18,000 ≈ 8.3×
The rolling twenty-bar method at 13.05Here the denominator is the surrounding quiet, which is at least the right kind of window — but the threshold was calibrated on mornings31,000 ÷ about 9,500 ≈ 3.3×
The same-slot method at 9.20A busy open for this stock, and no more than that150,000 ÷ 84,000 ≈ 1.8×
The same-slot method at 13.05Three and a half times what this stock normally does at one o’clock. Somebody turned up31,000 ÷ 9,000 ≈ 3.4×
The two methods do not merely disagree on magnitude, they reverse the ranking. The rolling window says the morning bar was by far the bigger event, at 8.3× against 3.3×. The same-slot comparison says the afternoon bar was the bigger event, at 3.4× against 1.8×, and that the morning was an ordinary busy open. Anyone who watched both would agree with the second: a stock doing three and a half times its usual one o’clock volume is something happening, and a stock doing 1.8 times its usual opening volume is a Tuesday. The threshold was never the problem. The denominator was.
Loading interactive demo…

Volume relative to a baseline is the right idea throughout. The question this lesson adds is which baseline, once the bars are shorter than a session.

Building the right denominator

A time-of-day profile, which is an afternoon’s work
  1. 1
    Take twenty sessions of intraday bars for the stock

    The same bar size you actually trade. Twenty is a reasonable [[Sample size]] for a stable profile and short enough that it still describes the stock as it is now.

  2. 2
    Group by the slot, not by the date

    All the 9.15 – 9.20 bars together, all the 9.20 – 9.25 bars together, and so on. On a five-minute chart that is 75 groups of twenty observations each.

  3. 3
    Take the median of each group, not the mean

    One results day or one block deal will drag a mean badly, and the profile is supposed to describe an ordinary day. The median is the cheap and correct choice here.

  4. 4
    Divide today’s bar by its own slot’s median

    That ratio is the number your filter should be reading. It is comparable across the day and across stocks, which is the entire point of a relative measure.

  5. 5
    Rebuild it periodically, and after anything structural

    A stock’s profile changes when it enters or leaves an index, when derivatives are listed on it, or when its free float changes materially. A profile from last year is not a description of this stock.

Why this survives so well

  • It is genuinely harmless on daily bars. One session resembles another closely enough that the twenty sessions before this one are a fair comparison for this one. The construction is correct where most people learn it, which is exactly why it gets carried down to five-minute bars unchanged.
  • The filter looks like it is working. It fires, it produces a list, and the list is full of stocks that really did trade heavily. Nothing errors and nothing is empty. A filter that returns plausible results every morning is very hard to doubt.
  • The false positives are self-confirming. Opening bars are volatile, so some of the stocks the morning burst throws up do move afterwards — not because the filter selected them, but because it is the open. That is enough to keep anybody using it.
  • It quietly converts a strategy into a different strategy. A system whose entry filter fires disproportionately in the first fifteen minutes is, whatever its author believes, mostly a strategy about the open. It will be evaluated against breakout logic and it will actually be tracking the [[Volume smile]].
  • And it wastes the [[Sample size]] you thought you had. If four-fifths of the signals in a two-year intraday backtest came from the same two slots of the day, the effective sample is far smaller than the trade count suggests, and it is concentrated in the part of the session with the widest spreads.
◆ Your call

The scan returns forty names at 9.20 and six names at 14.05

You have been running the twenty-bar relative-volume filter on five-minute bars for a month. The morning list is long and mostly familiar; the afternoon list is short and often contains a name you have not seen before.

Simple bhasha mein
Subah ke 120 cup, do baje ke 13

Chai ki dukaan pe subah 120 cup bikte hain aur do baje 13. Do baje waale 13 ko subah ke 120 se taulo toh har roz ek hi jawab aayega: dopahar mein kuch nahi ho raha. Sach jaanna ho toh aaj ke do baje ko pichhle bees din ke do baje se taulo. Chart pe bhi yahi hai. Ek midcap ka aam 9.15–9.20 bar 84,000 share ka hai aur aam 1.00–1.05 bar 9,000 ka — nau guna farq, un dinon bhi jab kuch nahi hota. Aaj subah 1,50,000 hue aur do baje ke aas-paas 31,000. Purana tareeka — pichhle bees bar ka average — 9.20 pe denominator kal dopahar se uthata hai (bees paanch-minute bar matlab sau minute), toh 1,50,000 ÷ 18,000 = 8.3 guna, aur 1.05 pe 31,000 ÷ 9,500 = 3.3 guna. Slot waala tareeka: 1,50,000 ÷ 84,000 = 1.8 guna, aur 31,000 ÷ 9,000 = 3.4 guna. Ranking hi palat gayi — subah aam din tha, dopahar mein koi aaya tha. Threshold mat chhedo, denominator badlo: har slot ka apna median, pichhle bees session ka.

What to remember
  • On an intraday chart, the twenty bars beside this one are not its peers — the same slot on other days is.
  • At 9.20 a twenty-bar rolling average of five-minute volume is an average of yesterday afternoon.
  • Building a median profile per slot across twenty sessions reverses the ranking of events, and reverses it in the direction a human observer would agree with.
  • The same reasoning applies to bar ranges, so a short trailing window and a fixed threshold do different work at different hours.
  • The construction is sound on daily bars, which is exactly why it gets carried down to intraday bars without anyone questioning it.
Finished this lesson?

Mark it done to track your progress through the curriculum.