Naya Trader Member sign in

Data

Five measurement bugs that fake an edge

Each of these made a losing idea look like a winner in our own research. All five are easy to make and hard to see.

29 October 2026 · 7 min read

When a backtest looks too good, the market is rarely the reason. Usually the measurement is wrong. These five bugs each produced a confident, wrong result in our research before we caught them.

1. Relative volume that's wrong at the open

A common formula for relative volume is: volume so far today, divided by the average full-day volume times the fraction of the session that has passed. It looks reasonable, but the first few minutes of a session carry far more than their share of a day's volume. So this formula reads 4 to 6 times too high in the morning, then keeps falling all day, even while a stock is still trending.

On one day, one stock read 6.6× at 09:15 on this formula and 1.6× on the correct one. That bug alone had produced a "volume leads price" finding that vanished once it was fixed.

Fix: compare today's volume up to 10:00 with the average volume up to 10:00 over the last 20 or so sessions. Same clock time on both sides.

2. The "close" that isn't the close

The last traded price of the day is not NSE's official closing price. For most stocks the official close is the volume-weighted average price of the last 30 minutes. For stocks with futures and options, NSE now strikes the close in a closing auction that runs from 15:15 to 15:30.

Using the last 1-minute bar as yesterday's close, our "% change today" figures were off by 0.33% on average, and by more than 1% for 91 of about 1,640 stocks on a single day. That is enough to push a stock in or out of an "up 3% today" screen.

Fix: take the previous close from NSE's bhavcopy, not from your candles.

3. Lookahead through selection

Nobody reads tomorrow's price on purpose. Every lookahead leak we found came from choosing, not from reading a future bar directly.

In one case, trades entered at the first signal but were kept only if the stock also passed a filter that fired 64 minutes later. The result had a t-statistic of 47. In another, on 15-minute candles, the bar's label (its start time) was treated as the moment the signal was known. That handed the scan 14 free minutes and made it look 12 minutes faster than a rival. Both results were retracted.

Fix: for every number that feeds a decision, ask "at the minute I enter, could I have known this?" Then ask what you ranked by. Even printing results best-first is a form of selection: a reader who sees only the top 25 of 187 sees an average that the strategy never delivered.

A t-statistic far above anything else you have seen is not a discovery. Treat it as a bug until you have found out why it is not one.

4. Survivorship in the stock list

A stock list built from today's market, such as "price above ₹50 and ₹1 crore traded today", quietly removes every stock that later crashed below ₹50, moved to the trade-to-trade segment, or was delisted. Of about 920 stocks that traded ₹10 crore or more a day a year earlier, 133 were missing from the current list.

Testing a buying strategy on the survivors means testing it only on stocks you already know did not collapse. Every multi-day long backtest run on that list looked better than it should have.

Fix: rebuild the list as it stood on each test day, including the stocks that later disappeared.

5. Data that quietly goes missing

Our replay tool loaded stocks with a rule that silently dropped about 17% of the universe. Those stocks could never trigger. When we counted what the scanner had "missed", about 65% of the misses were really this loading bug, not a weakness in the scanner. We had been about to redesign the wrong thing.

Feeds have their own gaps. Some fill minutes with no trades using flat copies of the previous bar, so a stock can look active when nothing traded.

Fix: count rows in and rows out at every step of a pipeline, and print both. A number that should not change and does is the cheapest bug report you will ever get.

A short checklist

  1. Is every rolling measure compared at the same time of day?
  2. Is the previous close the official one?
  3. At the minute of entry, was every input already known, including the filters used to pick the trade?
  4. Does the stock list include the stocks that later failed?
  5. Did every stock you meant to test actually reach the test?

← The edge is real. It's just smaller than the bill.
Next: Compared to what? Your control group decides the answer →