QuantBrasil
Documentação

quantbrasil backtests status

Mostra a oportunidade de entrada mais relevante agora

Sintaxe

quantbrasil backtests status <backtest-id>

Esta é uma operação de leitura. Modos de saída: json, human.

Argumentos e opções

NomeTipoObrigatórioDescriçãoPadrão
backtest-idArgumentoSimID do backtest
--jsonOpçãoNãoExibe saída JSON

Exemplos

quantbrasil backtests status 123

Saída (--json)

Estrutura da resposta retornada com --json:

export interface BacktestStatusResponse {
  ok: boolean;
  summary_markdown: string;
  backtest_id: number;
  strategy_id: string;
  ticker: string;
  timeframe_id: string;
  entry_model:
    | "close_confirmed"
    | "next_candle_break"
    | "live_price_trigger"
    | "open_or_time";
  data: {
    state: "fresh" | "stale" | "unknown";
    as_of: string | null;
    age_minutes: number | null;
  };
  period: {
    state: "not_started" | "open" | "closed" | "unknown";
    candle_at: string | null;
    complete: boolean;
    closes_at: string | null;
  };
  session: {
    state: "upcoming" | "open" | "closed" | "unknown";
    reference_date: string;
    timezone: string;
  };
  setup: {
    state: "not_applicable" | "none" | "forming" | "formed" | "unknown";
    candle_at: string | null;
  };
  activation: {
    state:
      | "not_applicable"
      | "pending"
      | "triggered"
      | "confirmed"
      | "expired"
      | "invalidated"
      | "unknown";
    mode: "price_touch" | "at_close" | "at_open" | "scheduled_time";
    triggered_at: string | null;
    entry_price: number | null;
    trigger: BacktestStatusTrigger | null;
    reason: "stale_data" | "entry_stop_order_unknown" | null;
  };
  recent_event: {
    state: "activated" | "expired" | "invalidated";
    occurred_at: string;
    entry_price: number | null;
    mode: "price_touch" | "at_close" | "at_open" | "scheduled_time";
    recency: "today" | "last_session";
  } | null;
  display_state:
    | "waiting_confirmation"
    | "waiting_activation"
    | "activated"
    | "window_closed"
    | "no_opportunity"
    | "invalidated"
    | "unavailable";
  attention: "none" | "watch" | "activated" | "unknown";
}

export interface BacktestStatusTrigger {
  kind: "price" | "condition" | "time";
  operator: "gte" | "lte" | null;
  price: number | null;
  observed: number | null;
  condition_met: boolean | null;
  scheduled_for: string | null;
}

Exemplo de resposta

{
  "ok": true,
  "summary_markdown": "Entrada ativada em 37,61.",
  "backtest_id": 123,
  "strategy_id": "long_123",
  "ticker": "PETR4",
  "timeframe_id": "M30",
  "entry_model": "next_candle_break",
  "data": {
    "state": "fresh",
    "as_of": "2026-07-16T13:40:00Z",
    "age_minutes": 5
  },
  "period": {
    "state": "open",
    "candle_at": "2026-07-16T13:30:00Z",
    "complete": false,
    "closes_at": "2026-07-16T14:00:00Z"
  },
  "session": {
    "state": "open",
    "reference_date": "2026-07-16",
    "timezone": "America/Sao_Paulo"
  },
  "setup": {
    "state": "formed",
    "candle_at": "2026-07-16T13:00:00Z"
  },
  "activation": {
    "state": "triggered",
    "mode": "price_touch",
    "triggered_at": "2026-07-16T13:30:00Z",
    "entry_price": 37.61,
    "trigger": {
      "kind": "price",
      "operator": "gte",
      "price": 37.61,
      "observed": 37.8,
      "condition_met": null,
      "scheduled_for": null
    },
    "reason": null
  },
  "recent_event": {
    "state": "activated",
    "occurred_at": "2026-07-16T13:30:00Z",
    "entry_price": 37.61,
    "mode": "price_touch",
    "recency": "today"
  },
  "display_state": "activated",
  "attention": "activated"
}