← Back to Blog

An Attempt To Predict Tomorrow's ETF Gap With Classical Machine Learning

Every ETF instrument on bhavcopydata.com already shows a gap at open which is the difference between a day's opening price and the previous day's close. It is one of the simplest numbers on the site and one of the most watched. I wanted to know whether a classical machine learning model, trained only on the kind of daily insights already published on bhavcopydata.com, could predict which direction tomorrow's gap would go. This is a plain account of what I tried, what worked, and what did not.

The setup

I used 160,315 ETF trading days across 390 symbols, spanning 08 January 2024 to 10 August 2026. Every row carried a set of features already computed as part of insights from bhavcopydata.com, that day's own change %, its own gap %, its intraday range %, its position inside its 52-week range, whether it was near a 52-week high or low, its liquidity badge and its ETF category. I added a few extra rolling numbers for this test only, a 20 day trailing turnover average to measure a volume surge, a 5 day trailing average change to measure momentum, and a 10 day trailing standard deviation of daily change to measure recent volatility.

The target was simple. For each symbol on each day, did the next trading day open with a gap up or a gap down.

I split the data by. Everything before 30 January 2026 was used to train the models, 119,422 rows. Everything from 02 February 2026 onward was held back to test them, 40,893 rows. This matters. A random split would let a model see information from the future while training, which would make it look better than it actually is. A date based split does not allow that.

The first surprise, the baseline is already strong

Before training anything, I checked how often ETFs actually gapped up the next day. In the test period, 59.8% of the days that followed ended with a gap up. Gaps up were simply more common than gaps down in this market and in this window. A model that always predicts gap up, without looking at a single feature, already gets 59.8% accuracy for free. Any real model has to beat that number, not 50%, to be worth anything.

What was tried

I trained two models on the training period only, then scored both against the held out test period.

A logistic regression, the simplest classification model, using the numeric features scaled and the categorical features, ETF category and liquidity badge, one-hot encoded.

A gradient boosted tree model, a more flexible method that can pick up on non-linear patterns and interactions between features that a logistic regression cannot.

What was found

Model Accuracy AUC
Always predict gap up 59.8% 0.500
Logistic regression 52.2% 0.523
Gradient boosted trees 60.5% 0.575

AUC measures how well a model separates the two outcomes across every possible confidence threshold, where 0.500 is a coin flip and 1.000 is perfect separation.

The logistic regression actually did worse than doing nothing. Its accuracy of 52.2% was well below the 59.8% you would get by always guessing up. Its AUC of 0.523 sits barely above a coin flip. In plain terms, the simplest model found almost nothing usable in these features.

The gradient boosted model edged past the baseline on accuracy, 60.5% against 59.8%, and its AUC of 0.575 is a real, if modest, improvement over a coin flip. The accuracy gain over just always guessing up is small enough on its own that it would not convince anyone.

Where the real signal showed up

Accuracy hides something important when one outcome, gap up, is already more common than the other. A model can post a high accuracy score just by leaning toward the common outcome most of the time, without actually telling days apart well. So instead of stopping at the accuracy number, we sorted the gradient boosted model's predictions by how confident it was and looked at the two extremes.

On the 10% of test days the model was most confident for a gap up, the actual gap up rate was 75.8%. On the 10% of test days the model was most confident for a gap down, the actual gap up rate was only 48.6%. That is a 27.2 percentage point spread between the model's most and least confident calls, against a base rate of 59.8%. That spread is the real evidence that the features carry some information, even though the overall accuracy number does not show it clearly.

What actually mattered to the model

I measured which features the gradient boosted model leaned on most, by checking how much its accuracy dropped when each feature was scrambled on its own. The number of trades that day mattered most, followed by the 10 day trailing volatility, the ETF's own gap % that same day, and its 5 day momentum. A stock's own recent volatility and its own recent gap history carried more weight than its ETF category, its liquidity badge, or whether it was near a 52-week high or low, all of which barely moved the model's accuracy when removed.

What this means in plain terms

A model built only on the daily insights already public on bhavcopydata.com does not reliably beat the simple habit of assuming tomorrow looks like most other days. Overall accuracy barely moves past that baseline, and a simpler model can do worse than doing nothing at all. The one place a real, measurable signal shows up is in the tails. When the model is most confident, its calls do separate from the base rate by a meaningful margin. That is a research finding, not a trading system. Turning a 27 percentage point spread on the most confident 10% of days into something a trader can actually use, with position sizing and costs accounted for, is a different and harder question than the one I tested here.

Caveats worth stating plainly

This model only used end of day data already computed as part of insights from bhavcopydata.com. It has no access to news, corporate actions, broader index moves the same day, or anything from outside a stock's own trading history. Adding any of those could move these numbers in either direction. The test period, 02 February 2026 to 10 August 2026, is about six months of one market regime, not a full cycle, so I would want to see this hold across a longer and more varied stretch before treating the confident tail finding as durable.

The full daily insights that fed this model, gap at open, 52-week position, liquidity badges and the rest, are available for every ETF on bhavcopydata.com.