The Leak: How a Look-Ahead Bug Fooled Us for Three Weeks
September 19, 2026 · 4 min read · Part of Movement
We say we build in the open. This is what that costs. In mid-September we found that a filter inside Conduit had been reading information a live trader could not have had, and that every result we had produced since late August was contaminated by it. Here is the bug, how it was caught, and what we do differently now. There are no numbers in this note, on purpose; the point is the method.
The bug
Conduit uses a higher-timeframe reading as a filter: it will only take a trade when the larger picture agrees. The filter was built by looking up the most recent completed higher-timeframe candle. That sounds right. The problem is the word "completed". On a five-minute chart at ten past the hour, the current hourly candle is still forming; its close does not exist yet. Our lookup was reaching the candle that would *eventually* be the most recent completed one, which meant that at ten past the hour the filter already knew how the hour would close. A live trader cannot know that. The strategy could.
It is a tiny bug. It is one of the most common bugs in backtesting, it is invisible in a chart, and it made Conduit look better than it is for three weeks.
How it was caught
Not by reading the code. The twin caught it. In the twin test the random-entry twin should land, on average, exactly where arithmetic says a random entry with those exits should land. Ours was landing slightly better than that, consistently, and only when the higher-timeframe filter was on. A random entry cannot have skill, so if the twin is winning, the twin is cheating, and the only way the twin could cheat was if something it shared with the real strategy was leaking the future. That something was the filter.
We want to underline this. The check that found the bug was not a check on the strategy. It was a check on the *null*, the thing that is supposed to have no edge at all. Test your null as hard as you test your idea.
What else fell out
Once we knew to look, we found three smaller leaks of the same family: a fill that was being credited the spread it should have paid, a fill at a resting level the market had already gapped through, and a drift in the twin's synthetic prices that made it lose for reasons of its own. Each was small. Together they had been flattering us. All four are fixed in the harness, the runner and the page that publishes the record.
What changed
The higher-timeframe filter now reads only candles that were complete at the moment of the bar being tested, built from the bars that existed then. Every resting order fills at the open of a bar that opens through its level, never at the level. The twin is drift-corrected. And every published number now carries the date of the harness that produced it, so a correction like this one can be traced to the day it landed rather than quietly replacing what came before.
Why publish it
Because the alternative is a smooth curve and a quiet edit. We would rather you see the mistake and the correction than trust a record that has never been wrong. It is also the most useful lesson on this page for anyone building their own tool: the bug that hurts you will not be in the idea. It will be in the plumbing, and the only thing that finds it is a null you have tested as hard as your thesis. How Conduit was built has the rest of the story.
Kingdom Portfolios LLC is an independent education publisher. It is not registered with the CFTC or the NFA, is not a Commodity Trading Advisor, does not offer or manage investments, and does not trade anyone else's capital. Nothing here is investment advice, a signal, an offer, or a solicitation.
No performance results of any kind are presented in this note and none should be inferred. Where this note refers to our lab, our harness or our measurement, it means simulated research on historical data. Hypothetical performance results have many inherent limitations: they are prepared with the benefit of hindsight, they do not involve financial risk, no hypothetical record can completely account for the impact of financial risk in actual trading, and no representation is made that any account will or is likely to achieve results similar to anything described. Past performance is not indicative of future results.
The algorithms described trade only Kingdom Portfolios' own accounts. They are not for sale, not licensed, and not run for anyone else. Trading forex and futures carries substantial risk of loss, including loss of the whole account. Education only.
Common Questions
Did the leak change whether Conduit works?
It changed every number we had, which is why we re-ran everything from scratch. We do not publish results or conclusions from either the leaked or the corrected run. The lesson worth taking is that the difference between the two came from a bug rather than from the market, and only a null tested as hard as the idea could see it.
How do I check my own backtest for look-ahead?
For every value your rule reads, ask "at this exact bar, did this value exist yet?" Higher-timeframe closes, indicators computed on the current candle, and fills at levels the market gapped through are the three usual suspects.
Start the Free Curriculum
Foundations of Stewardship Trading walks you from the basics to disciplined scaling, grade by grade, no hype, education only.
Education only. This article is general financial education, not investment, legal, or tax advice and not a recommendation to buy, sell, or trade any asset. Kingdom Portfolios does not manage money, accept investor funds, or guarantee any result. Trading involves substantial risk of loss. Consult your own licensed professionals before making decisions.