Ambiguous Bars

An ambiguous bar is a tested bar where the backtester cannot uniquely determine what happens on it. Strategy Builder Professional counts the ambiguous bars; the count lowers the Backtest quality statistic.

A bar becomes ambiguous in two ways.

Ambiguous entry signals

An entry signal is ambiguous when the strategy allows both directions at a single entry level:

  • the Entry point is Bar Open or Moving Average — one entry price for both directions, and
  • the entry rules do not determine the direction — typically when the strategy has no entry rules, or when the rules allow both directions on the same bar.

In live trading two opposite orders at the same price cannot be executed meaningfully, so the backtester skips the entry on such bars and counts the bar as ambiguous.

Determine the direction to avoid ambiguous entry signals:

  • add a directional entry rule, for example Moving Average rises, or
  • enable Long Only or Short Only.

Ambiguous intrabar orders

When two entry levels are both inside the bar range — for example, the Upper and the Lower Bollinger Bands — the strategy places both pending orders, exactly as live trading would: the order whose level the price reaches first fills.

The backtester approximates the sequence with the intrabar interpolation method: Pessimistic, Optimistic, Nearest, Shortest, or Random. The trade still executes; the bar is only counted as ambiguous, which reduces the Backtest quality statistic. A bar is also counted when two stop or exit orders are both reachable and the method has to pick one.

Select the method in the menu next to the Backtest stats heading in the Strategy Editor; Pessimistic is the default. Pessimistic assumes the less favorable order fills first, Optimistic the more favorable one, Nearest the level closest to the bar open, Shortest follows the price travel direction of the bar, and Random picks between the reachable orders weighted by their distance.

Keep the count low

Every ambiguous bar reduces the Backtest quality. When the count is high, the strategy cannot determine its own direction, or its intrabar orders resolve differently than live execution would — review the entry rules, the entry point indicator, and the features before using the strategy.