A backtest can only support a decision if every input was available at the moment the decision would have been made. If a strategy uses Monday’s closing price to decide a trade entered before Monday closed, the result contains look-ahead bias and cannot describe a trade anyone could have placed.
At 9:14 p.m. on Sunday, Owen had a laptop open at his kitchen table in Manchester, a mug gone cold beside his notebook, and a broker connection screen waiting for him. He had spent the weekend reviewing a stock strategy that looked unusually clean: a high win rate, shallow pullbacks, and a chart that kept rising through the test period.
He was about to connect capital when he opened the script behind the backtest.
The strategy’s rule said it bought when the day closed above a moving average. Yet the test recorded an entry at that same day’s close. The closing price had determined the signal, then the backtest treated it as though Owen could have bought at the exact price used to make the decision.
That difference could turn a promising system into a costly first week. If Monday opened lower, the entry was worse. If the move faded before the next session, the trade might never qualify. His planned capital connection stayed on the screen while he checked the rest of the logic.
This is an illustrative composite, not a customer story. The error is real and common enough to deserve a written check before any strategy reaches a live account.
A close is only known after the close
Daily bars are convenient because they reduce a market session to four numbers: open, high, low, and close. They also create an easy trap. A closing price is only final when the session ends. A strategy can use that price to generate a signal, but it cannot use it to enter at that same closing price unless the rules and execution method make that genuinely possible.
For a daily strategy, the more defensible sequence is simple:
- The market closes and the strategy evaluates the completed bar.
- The signal becomes available after that close.
- The order is considered for the next available trading opportunity, often the next session’s open or a defined limit condition.
- The test includes plausible costs, spread, and slippage assumptions.
That sequence may make a beautiful equity curve less beautiful. It replaces a price the strategy could only see in hindsight with a price a trader could have encountered.
The same issue appears on intraday charts. A five-minute candle does not reveal its final high, low, or close until the five minutes are over. If a rule reacts to the completed candle, its signal belongs after the candle closes. A test that enters inside that candle based on its finished values has quietly moved information backward in time.
Small timing errors change the risk you actually take
Look-ahead bias is easy to dismiss as a technical detail. It changes position sizing, stop placement, expected drawdown, and the number of trades a strategy appears to produce.
Imagine a strategy that signals after a daily close at $100 and sets a stop at $96. A backtest may calculate a $4 risk per share and size the trade accordingly. If the next available entry is $102, the same $96 stop creates $6 of risk per share. Holding the original share count means the trade risks 50% more than planned.
A trader who treats a backtest as a promise may discover the mismatch only when a live order fills. The loss limit remains real even when the test assumptions were not.
This is why a written risk limit needs to sit beside every proposed trade. The entry price can move. The stop can widen. The capital at risk must remain visible. Mara’s $145 loss risk. Her $100 limit holds. shows the practical discipline: reject or resize a trade when the stated risk exceeds the limit.
Owen found a second problem when he corrected the entry timing. Several trades disappeared because the next session never reached his limit price. Others opened far enough away from the prior close that their planned stop no longer fit. The strategy had not become worse overnight. The test had become more honest.
Build a backtest around the information you could have had
A useful backtest answers a narrow question: given the data available at a defined time, what might this rule have done under stated execution assumptions? It cannot tell you what will happen next.
Start by writing the exact decision timestamp. “After the daily close” is different from “at the next market open.” “After a 15-minute bar completes” is different from “while the bar is still forming.” Then check every indicator, filter, and price field against that timestamp.
Be especially careful with:
- Indicators calculated using the current bar’s close when the entry claims to occur before that close.
- Daily or weekly values applied to intraday trades before the higher-timeframe bar has completed.
- Data sets revised after the fact, including constituent lists or delisted assets omitted from the sample.
- Rules tuned repeatedly until they fit one period unusually well.
- Fill assumptions that ignore spread, fees, slippage, gaps, or unavailable liquidity.
A strategy needs enough losing trades in the test to show its downside. Maximum drawdown matters because it describes a path a trader may have to sit through, rather than the destination shown by a final return number. A test with a strong result and a drawdown beyond your stated tolerance has already failed your risk process.
Keep the decision separate from the order
The cleanest safeguard is to treat a signal as a proposal, not an instruction. Record when the signal appeared, the price information it used, the intended entry condition, the stop, the position size, and the maximum cash loss before an order can execute.
That creates an audit trail you can review when reality differs from the test. It also leaves room for a human decision when a gap, a changed stop distance, or a different market condition makes the original trade unacceptable.
An approval-gated workflow follows that discipline. The system can queue a trade signal, but the trader reviews the current price and risk before approving or rejecting it. The approval step does not repair a weak backtest. It does stop a historical assumption from turning directly into a live order without a fresh look.
On Monday morning, Owen rewrote his test so that each signal appeared only after the bar that created it had closed. He logged the next-session entry assumptions and reran the numbers. The result offered fewer trades and a rougher path. His notebook gained a final line before he connected anything: “Can I know this price when the rule says I act?”
Educational content, not financial advice.
Comments
No comments yet.