A forming candle is not a closed candle

A forming candle is still changing. Its high, low, and close are final only after the interval ends. Using the eventual close early is look-ahead bias.

A forming candle is the bar the market is still building. Its high, low, close, and volume can change until the interval ends. A closed candle is that same bar after the interval ends. Only the closed bar is safe to treat as known history.

What is still allowed to change

Take a 60-minute bar. Twenty minutes after it opens, the high so far is only the high so far. A later trade inside the same hour can print a higher high, a lower low, or a different close. The figures in this article's images are a worked example of that clock, not a recorded market run: 20 minutes elapsed and 40 minutes left on the forming bar, then 60 minutes elapsed and 0 minutes left once it has closed.

Venues publish this distinction in the data, not only in chart coloring. Binance's spot kline stream pushes updates to the current candlestick and includes a field, x, whose description is "Is this kline closed?" While the interval is open, that field is false and the close in the payload is the latest trade price in the bar. When the interval finishes, an update can mark the kline closed. Using the closed values during the open interval borrows the future.

Paper trading vs backtesting names the same mistake look-ahead bias: a decision that uses information that was not available at that time. A completed candle used before it closed is the example that matters here.

Three ways to time a rule

An indicator reading on a forming bar moves as the bar moves. If the rule acts on that reading immediately, it can enter and then see the reading disappear before the close. If the rule waits, it acts on a value that will not be revised by later trades inside that bar. Waiting does not remove slippage, costs, or a bad rule. It removes one source of hindsight.

Tradee stores the choice on each bot instance as a signal mode. The names are live, entries_on_close, and signals_on_close.

  • live evaluates the entry graph and the exit graph on the forming bar. This is the default.
  • entries_on_close lets a new entry fire when a bar has just closed, and it reads that closed bar. Exit signals still evaluate on the forming bar.
  • signals_on_close waits for the close on both the entry graph and the exit graph.

Stop-loss, take-profit, and a trailing stop still run inside the bar in every mode. A close-only entry does not delay a stop that is already armed. If your test assumes that nothing happens until the hour ends, write that down, because the product does not assume it.

Backtests follow the same mode. A close-mode entry is judged on the closed bar. Intrabar stops are still approximated from bar prices, so a one-hour test is a coarser picture of a stop than a finer simulation step. Match the mode when you compare a backtest with a paper run. Strategy, bot, and execution is where that run lives. The mode is part of the instance, so changing it is a bot change, not an execution-funding change.

In the two close modes, a restarted runner marks the latest bar that already closed as already seen. The next close signal is a bar that finishes after startup. That avoids a burst of entries from hours the process was not awake to see. Live mode is different: it evaluates the forming bar on the first ticks, because it is not waiting for a close.

Where people mix the two bars

The usual backtest leak is subtle. The file of candles contains the final close of each hour. A loop that decides at the open of the hour, using that row's close, has the whole hour in hand. The repair is to decide from the previous closed bar, or to state that the strategy is allowed to use the forming bar and then test it that way on purpose.

Chart screenshots create a cousin of the same leak. The rightmost candle looks like every candle to its left. It is not finished. A cross that is true at minute 20 can be false at minute 60. An indicator is not a strategy covers the missing decision. This page covers the missing timestamp on that decision.

Higher-timeframe values have the same clock. A daily average read from inside today includes today's unfinished daily bar. If the rule meant "yesterday's daily close," it has to say so. Coarser inputs do not become closed just because the chart's own bar closed.

What to record with the rule

  1. The bar size the signal uses.
  2. Whether entries may use the forming bar, the just-closed bar, or both.
  3. Whether exits follow entries or may fire inside the bar.
  4. Whether stops and targets may fire inside the bar. In Tradee, they may.
  5. The warmup, so early readings are not treated as signals.
  6. The same answers in the backtest and in the paper run.

If two tests disagree, check this list before you change the averages. A forming-bar entry and a closed-bar entry are different strategies that share a diagram.

FAQ about forming candle

Is the latest price the close?

Only after the interval ends. Before that, the latest price is the current close of a forming bar. It is useful for a rule that intends to react early. It is the wrong input for a rule that was researched on finished bars.

Do stops wait for the close?

Not in Tradee. Whichever signal mode you pick, stop-loss and take-profit still watch price while the bar is open. If you need a stop that can only act on a closed bar, that is a different rule, and the default product behavior will not do it for you.

Methodology and sources

The open-bar example uses a 60-minute interval, inspected at 20 minutes, so 40 minutes remain. Those counts are arithmetic, not a market reprint. The closed-flag description follows Binance's spot kline stream document, field x. Signal modes follow Tradee's instance runtime: forming-bar evaluation, entry-on-close, or both graphs on close, with intrabar stop and target handling in each case. This article is educational and does not provide personalized investment or trading advice.

This article is for education. It is not financial advice. Trading can lose money. Past results do not guarantee future results.