Oisigma/Blog
Research & notes

Selection Bias: Why the 79 Stocks Were Picked at Random

A test is only as informative as the way its sample was chosen. Show a band on a handful of tickers picked after the fact, and the result says more about the picking than about the band. This article explains how selection bias enters indicator testing, why Oisigma's check on individual stocks used 79 names drawn at random and not used for tuning, and what that check does and does not establish.

What is selection bias?

Selection bias is what happens when the sample being tested is chosen in a way that is related to the outcome. In backtesting, the usual form is choosing tickers, periods or examples after seeing how a method did on them. The result on that sample then overstates how the method behaves on the wider set it was drawn from.

It rarely needs to be deliberate. Charts that look clean are easier to remember and easier to show. A ticker that behaved strangely gets set aside as unrepresentative. A period gets trimmed because the data looked odd. Each choice can be defended on its own, and together they tilt the sample toward cases that suit the method.

The bias also does not need anyone to see the result directly. A researcher who has watched a tool on a few favourite charts for years carries an impression of where it looks good, and that impression can shape which names get tested first. That is why the cleanest protection is a rule for choosing the sample that does not depend on judgment at all.

Why do hand-picked examples prove little?

A chart example can show that a method is capable of looking a certain way. It cannot show how often it looks that way. Even a list of a dozen tickers says little if the reader does not know how the dozen were chosen. The useful question is always about the names that were not shown.

For a band, the risk is specific. The inner band makes a coverage claim: it aims to hold roughly two-thirds of next closes, scored on closes, using only data available at the prior close. Across many stocks, some will land above that target and some below it, partly by chance. If only the names that landed closest to the target are reported, the published fit looks tighter than it is. If only the highest are reported, a reader might take a wide band for a good one.

How does random selection help?

A random draw breaks the link between the choice and the outcome. Nobody decides which names go in, so nobody's impression of where the band looks good can steer the sample.

The 79-stock check adds a second protection: the names were not used for tuning. Random selection stops the sample from being chosen to suit the band. Keeping the names out of tuning stops the band from being adjusted to suit the sample. Those are different leaks, and closing one does not close the other. The post on overfitting covers the second in more detail.

What did the 79-stock check find?

Across 79 randomly chosen US stocks, none of them used for tuning, the inner band's containment averaged about 73.6%, and every name came in above 70%. Past behavior is not a guarantee of future results.

The second half of that sentence matters as much as the first. An average can hide a tail of names where the band fitted poorly. Reporting the floor alongside the average tells a reader that no single stock in the draw fell below 70%, which an average alone cannot say.

The average also sat above the figure for the S&P 500 index. No live Oisigma page explains why single stocks ran higher than the index, and this article does not offer a cause. The gap is reported as measured. The Proof page has more on the stock-level results.

What does random selection not settle?

Random selection removes one source of bias. It does not make a sample complete.

A random draw is only as broad as the pool it is drawn from, and a reader is entitled to ask what that pool was. The working paper's Appendix D itemizes tickers, dates and data-handling choices, and the working paper is the place to check the details of the draw rather than taking a summary on trust.

Seventy-nine is also a sample, not a census. A different random draw of the same size would give a somewhat different average. The check shows that the band's calibration on single stocks did not depend on a chosen set of names. It does not pin down the stock-level figure exactly, and it says nothing about stocks outside the pool. The post on what the working paper does not cover lists what remains untested.

Finally, the check measures calibration only. It asks whether the band's width matched the size of the next move on these stocks. The working paper validates the range's calibration, not the profitability of any use of it, and whether any use delivers value after costs is an open question.

How can a reader check selection in any test?

The questions that expose selection bias are simple, and they apply to any published test, Oisigma's included. How were the names chosen, and was the rule fixed before anyone saw the results? Were the same names used to set the method's parameters? Is the weakest result reported, or only the average or the best? How many names were tested in total, including any that were dropped?

There is also a check that needs nobody's word for anything. A reader can pick tickers of their own, by any rule they like, and score next closes against the band. If the stock-level calibration holds on names the vendor never chose, that is better evidence than any sample the vendor could publish. The guide to backtesting a band indicator sets out the method.

The takeaway

A test on hand-picked tickers proves little, because the picking can do the work. Oisigma's stock-level check drew 79 US names at random and kept them out of tuning, which closes two separate leaks at once. The band's inner containment averaged about 73.6% on that draw with every name above 70%, historically, and past behavior is not a guarantee of future results. That supports the calibration claim on single stocks; it does not explain the gap with the index, and it does not cover every stock.

Frequently asked questions

What is survivorship bias in backtesting? Survivorship bias is a form of selection bias in which a test uses only assets that still exist today, leaving out those that were delisted, merged or failed. It is most discussed for return backtests, but any test can ask whether its pool included names that later dropped out. The working paper's Appendix D, which itemizes tickers, dates and handling choices, is where that kind of question can be checked.

Why test a random sample instead of every stock? A random sample is a standard way to estimate how a method behaves across a large population without scoring every member. Its value comes from the draw being independent of the outcome, not from its size alone. A larger hand-picked set can carry more bias than a smaller random one.

Does a higher containment rate on single stocks mean the band fits them better? Not necessarily. Calibration is about how close measured coverage sits to the band's target, so a higher rate is not automatically a better one. The calibrated expected-range explainer explains what the target is.

If you want to score the range on stocks you chose yourself, the 30-day free trial gives full access to the indicator on TradingView, then $15 a month, and you can cancel anytime. You can start the trial here.

‍

Now, your charts

Curious how this looks on your charts?

Try it free for 30 days and see the range update as new bars print, on whatever symbols and timeframes you actually trade.

Start your free trial
Complete checkout
Read the paper

30 days free, then $15/mo. Cancel anytime from your account.

Pick up where you left off.