A model can look useful on the data used to choose it and disappoint as soon as the period changes. That happened in this MNQ price-prediction experiment: about +$2,351 in the selected research simulation became −$1,728 across three later windows. I rejected the configuration for trading.
MNQ is the Micro E-mini Nasdaq-100 futures contract, linked to the Nasdaq-100 stock index. NQ is its larger E-mini counterpart. The dataset records market prices and traded volume over time.
The question had started much earlier, with the data. I had built a custom NinjaTrader extractor, but could access only three months of history at the time. I wanted a longer, detailed time series to explore whether a model could find patterns that continued into other periods.
I directed Claude Code through the implementation and runs. The Python pipeline used MNQ price and volume data, Polars for preparation and LightGBM for prediction. The result was a research experiment, with approximate historical trade simulations, rather than a verified trading return.
Choose the history before choosing the model
Earlier acquisition work used Databento. I asked for actual cost estimates before building the download pipeline, then asked how much one-second history the available credit could cover. Longer history would provide more periods to compare.
The choice was between records of individual transactions and summaries of each second. The recorded estimate for two years of MNQ transaction data was well beyond the budget. The acquisition instead used roughly two and a half years of one-second summaries.
Each summary, often called a bar, contains opening, highest, lowest and closing price plus total volume. It keeps much more timing detail than daily data, but loses the sequence of trades inside that second. It also lacks the transaction count and separate actual buying and selling activity. Those limits determine which features can be built from it.
I had noticed differences between NQ and MNQ activity data in the earlier work. In the model project, I corrected the assumption that NQ should be the evaluation dataset. Testing an MNQ model required more MNQ data. NQ could become a separate comparison later.
More detail is a choice to test
Preparation checks the required fields, converts timestamps to UTC, sorts observations and removes duplicate timestamps. An inspection script reports date and price ranges, average volume and duplicate counts. The target builder excludes an example when its required future observation is missing or crosses a session boundary.
That makes the inputs more consistent without establishing complete coverage. Acquisition notes flagged three degraded days, which need explicit treatment in a fresh evaluation. A small one-day file used to check that the pipeline runs overlaps the later evaluation period, so the research runner excludes it.
I also questioned how much detail to keep. Combining five seconds into one row reduces the work, but can remove a pattern. I asked for comparisons of five and ten seconds, then progressively wider intervals, eventually extending the search to an hour.
Aggregation keeps the first opening price, highest and lowest prices, last closing price and summed volume. The selected configuration used 20-minute summaries to predict the next 20-minute price return. Starting with detailed data let us compare intervals after acquisition.
That search reused the research period. It selected a configuration; the same period could not then independently establish that the choice would continue to work.
A prediction has to survive the cost of acting on it
The evaluator turned the strongest positive and negative estimates into simulated trades. Tightening the selection changed the research result:
| Selection in the research period | Simulated trades | Approximate result after primary costs |
|---|---|---|
| Top and bottom 10% | 3,907 | -$905 |
| Top and bottom 3% | 2,605 | +$2,351 |
The primary assumption charged $1.50 for entering and leaving a trade. At $2.25, the research gain fell to about $397. The extra $0.75 across 2,605 simulated trades consumed $1,953.75. These are historical simulation assumptions; the return-to-dollar conversion uses a representative price.
Evaluation moved forward through time: train on six earlier months, evaluate on roughly the next month, then repeat. In the September 2023 through November 2025 research dataset, 14 of 21 evaluation windows were positive under primary costs.
The selected configuration then ran through three additional windows covering December 2025 through February 2026. All three lost money: about $737, $750 and $241. Together they lost $1,728 across 353 simulated trades, or about $1,993 under the higher cost assumption.
21 research folds, then three losing folds.
Inspect all 24 fold values
| Fold | Period | P&L · USD | Trades |
|---|---|---|---|
| 1 | Research | -$308.07 | 52 |
| 2 | Research | -$1,379.34 | 408 |
| 3 | Research | $697.12 | 24 |
| 4 | Research | $455.43 | 22 |
| 5 | Research | -$435.00 | 84 |
| 6 | Research | $1,509.77 | 193 |
| 7 | Research | $841.68 | 22 |
| 8 | Research | -$791.77 | 396 |
| 9 | Research | -$498.26 | 107 |
| 10 | Research | $62.12 | 174 |
| 11 | Research | $634.76 | 22 |
| 12 | Research | $357.03 | 25 |
| 13 | Research | -$93.28 | 168 |
| 14 | Research | $96.96 | 24 |
| 15 | Research | $195.83 | 193 |
| 16 | Research | -$2,122.38 | 228 |
| 17 | Research | $26.21 | 24 |
| 18 | Research | $331.58 | 24 |
| 19 | Research | $643.97 | 24 |
| 20 | Research | $281.04 | 36 |
| 21 | Research | $1,845.50 | 355 |
| 22 | Later | -$736.84 | 113 |
| 23 | Later | -$750.43 | 218 |
| 24 | Later | -$240.97 | 22 |
The earlier research notes called the result a breakthrough. The later entry says DO NOT TRADE this configuration as-is. The additional data changed the decision.
The later period still needs a cleaner test
The time split removes the prediction horizon plus an additional hour from the end of training. For a 20-minute prediction, that creates an 80-minute gap before evaluation, keeping nearby training targets from extending into that window.
Train on earlier bars, evaluate on later bars
Two implementation choices still weaken the separation. The final model uses the later evaluation answers to decide when training stops. The evaluator also sets its selection cutoffs from all eligible predictions in each evaluation window:
# Shortened illustration of the current selection rule.
upper_threshold = np.percentile(predictions, 97)
lower_threshold = np.percentile(predictions, 3)At the start of the window, its remaining predictions would not yet exist. A cleaner test would determine both training decisions and selection cutoffs from earlier information. I therefore describe these as later-period results, rather than claiming a completely untouched statistical holdout.
The existing 126 causality and time-split tests passed locally. They check useful properties, including whether adding future rows changes an earlier feature value. They do not remove those two evaluation dependencies or establish that trades could be executed profitably.
This work left me with a rejected configuration and a more specific next experiment: treat degraded days explicitly, set model and selection decisions using earlier data, then evaluate on a new period. Buying detailed data and building a working pipeline gave me a way to ask the question. The later losses were the reason not to act on the selected result.
Project sources & checks
Earlier MNQ acquisition work records Databento cost estimates, completed one-second OHLCV downloads and degraded-day warnings. Direct Claude Code requests establish the preference to estimate costs first and investigate longer history.
mnq-nq-xgboos-lightgbm: research/notes.md, scripts/01_prepare_data.py, scripts/02_run_walkforward.py, src/mnq_research/data_io.py, labels.py, splits.py and train.py.
Recomputed totals from metrics_by_fold.csv in runs 20260410_124942 and 20260410_125941; these are approximate historical simulations.
126 existing causality and temporal-split tests passed locally. This does not establish that the entire evaluation is free of bias.