Back to MCP catalog
explain_bar

Explain one bar of a backtest or paper session, or each condition's state across a range of bars, with optional stored OHLCV.

Area

Diagnostics

Group

Diagnostics

Access

Read

Risk

Read-only

Details

Full description

Explain one bar of a run, or the condition states across a range of bars.

Select exactly one of bar_id, timestamp, or start_bar with end_bar. A bar_id or timestamp explains that bar (trade facts and captured decisions); start_bar and end_bar return each condition's state on every bar of the range. An argument that belongs to the other form is refused by name.

Reads backtests and paper sessions alike, by run ID. A paper session is read at its latest committed bar; one started before paper diagnostics were recorded refuses with RESULTS_UNAVAILABLE.

Pass include_ohlcv=true to attach the current stored candle in ohlcv for the selected sleeve, timeframe and bar open. It can differ from the data used when the run executed. When the candle is unavailable, ohlcv_unavailable gives the reason.

Returns opening or closing trade evidence and condition snapshots. Trade episodes carry stable sequence identities and retain their measured economics when condition capture is unavailable. condition_states_error reports that absence explicitly. A timestamp-only read with no trade requires a recorded bar.

entry_signal is true when an entry that filled was decided on this bar; entry_fill is true when an entry filled on this bar. Condition states always describe this bar. Every fill carries decided_at, the instant the engine decided its order, or {"unavailable": "not_recorded"} when an older result did not record it. A fill decided on an earlier bar also carries decided_on_bar (call explain_bar on it for the conditions that fired).

Execution events explain fired signals, scheduled triggers (rule, role and decision_at instant), entry-block reasons and entry orders that ended. Condition states include node identity, labels, met, prev_met, typed operand absences, and the recorded operand values as left and right. Trade evidence carries the signal, limit, stop and target prices, and execution events the prices an entry was blocked at and the stop levels. Outside the Quawd app, raw prices and volume are withheld: an operand that is one is listed under withheld, and the signal price and zone highs and lows are marked withheld; derived values (indicators, fills, stops, targets) stay. Optional context adds surrounding condition states and position information.

Portfolio and universe reads require a sleeve. Bar indices belong to that sleeve's native reporting timeline. Timestamp selects the bar opening at that exact instant.

The single-bar form (bar_id or timestamp) is Hobby and up. The range form (start_bar and end_bar) is open to every plan. For a range, pass ohlcv_window with timezone-aware start, end, and limit to attach a separate page of current stored candles for this sleeve's timeframe; they can differ from the data used when the run executed. A range returns, per bar, every condition group (entry, exit, gate, overlay) with each condition's met and prev_met, its kind, operator and operand labels, and status with absences when it could not be decided, so you can find the bars where an entry or exit could have fired. A range outside the run's bars or a missing/unknown sleeve_id refuses with VALIDATION_ERROR.

A backtest needs per-bar diagnostics (settings.collect_diagnostics=true) for a range: on any other backtest it refuses with DIAGNOSTICS_UNAVAILABLE, whose recovery_hint names that setting. Paper sessions record them from their first bar; one started before they were recorded refuses with RESULTS_UNAVAILABLE.

Refusals preserve the diagnostics absence or expiry reason and rerun guidance. Missing or foreign backtests have the same not-found result.

Where the host shows widgets, a single bar draws a bar check card: the bar's time, whether it entered, exited, was blocked or had no signal, each entry, exit and gate condition with its operand values, and any trade it opened or closed. A range draws a condition strip card: one row per condition and one column per bar, met or not, with how many bars the entry fired on. Explain the card in words rather than restating its numbers.

Operates on

Builder objects this tool reads or produces, linked to their reference pages.

Capabilities

Bounded options and operating modes surfaced above the full JSON schema.

No bounded capability options are declared for this tool.

Required Inputs

run_idstringRun ID of a backtest or a paper session, as list_runs reports it.

Optional Inputs

bar_idanyOf (2 variants)Single bar: zero-based bar index. Select exactly one of bar_id, timestamp, or start_bar with end_bar.
context_barsanyOf (2 variants)Single bar only: optional ±N-bar window. When >0, response includes `context: [...]` — per-bar condition states (all groups: entry/exit/gate) and position info, clamped to [0, n_bars). Default 0 returns the single-bar payload. Max 200.
end_baranyOf (2 variants)Range: last bar index (inclusive, 0-based). Pass with start_bar.
include_diagnosticsanyOf (2 variants)Single bar only: include the declared state values each bar recorded, for explicit debugging.
include_ohlcvanyOf (2 variants)Single bar only: include the candle for the selected bar's symbol and timestamp: the stored candle in the Quawd app; elsewhere the display feed's bar with its note (stocks and ETFs; partial-market volume, unadjusted prices).
limitanyOf (2 variants)Range only: most bars to return (default 50, at most 100).
ohlcv_windowanyOf (2 variants)Range only: timezone-aware start and end (at most 14 days apart) and a limit for a separate page of current stored candles.
sleeve_idanyOf (2 variants)Sleeve to inspect on portfolio/universe (per_sleeve) backtests. REQUIRED for per_sleeve runs; omit on single-symbol runs. Omit on a per_sleeve run to receive the list of available sleeve_ids.
start_baranyOf (2 variants)Range: first bar index (inclusive, 0-based). Pass with end_bar.
timestampanyOf (2 variants)Single bar: ISO 8601 time of the bar to inspect, such as 2026-09-25T12:00:00Z; resolved to the bar opening at that instant. Select exactly one of bar_id, timestamp, or start_bar with end_bar.
Quawd

A subscription SaaS platform for designing, backtesting, and paper-trading algorithmic trading strategies on equities and crypto — described in plain English to an AI agent, no code required.

© 2026 Quawd. All rights reserved.

Quawd is a software tool, not a broker-dealer or investment adviser, and does not provide investment advice. Trading involves substantial risk of loss. Backtested and hypothetical results have inherent limitations and are not indicative of future performance.