{
  "additionalProperties": false,
  "description": "Detect Order Block zones -- last opposing candle before a displacement move.\n\nTracks the most recent opposing candle (bearish before bullish move, or vice versa).\nWhen a displacement candle fires (large body, small wicks), creates a zone from the\nopposing candle body range. Entry triggers when price returns to the zone.",
  "properties": {
    "direction": {
      "default": "both",
      "enum": [
        "bullish",
        "bearish",
        "both"
      ],
      "title": "Direction",
      "type": "string"
    },
    "fill_threshold": {
      "default": 0.5,
      "description": "Fill percentage (0-1) at which zone is considered filled",
      "maximum": 1.0,
      "minimum": 0.0,
      "title": "Fill Threshold",
      "type": "number"
    },
    "max_bars": {
      "anyOf": [
        {
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 200,
      "description": "Zone expiry in bars",
      "title": "Max Bars"
    },
    "min_body_pct": {
      "anyOf": [
        {
          "maximum": 1.0,
          "minimum": 0.0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional displacement-body filter. Require the displacement candle's body |close-open| to be at least this fraction of its full range (high-low). None disables the filter (default-preserving). Setting this also activates canonical-mode consume-after-fire.",
      "title": "Min Body Pct"
    },
    "min_displacement_atr": {
      "anyOf": [
        {
          "exclusiveMinimum": 0.0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional displacement strength filter, in ATR(14) multiples. The displacement candle body must satisfy |close-open| >= mult * ATR(14). None disables the filter (default-preserving). Setting this also activates canonical-mode consume-after-fire.",
      "title": "Min Displacement Atr"
    },
    "resolution": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Higher-timeframe override for zone lifecycle. Set to '4h' to detect OBs on 4H bars. None = strategy timeframe.",
      "title": "Resolution"
    },
    "select": {
      "default": "any",
      "description": "How to pick among matching zones at trigger time. 'any' (default) fires when any zone overlaps the bar. 'nearest'/'most_recent'/'oldest' deterministically pick one zone \u2014 required when binding execution price via TriggeringZonePriceSpec (VIB-591).",
      "enum": [
        "nearest",
        "most_recent",
        "oldest",
        "any"
      ],
      "title": "Select",
      "type": "string"
    },
    "type": {
      "const": "order_block",
      "default": "order_block",
      "title": "Type",
      "type": "string"
    },
    "use_wicks": {
      "default": true,
      "description": "Zone bounds source for the opposing candle. Default True preserves current behavior (full high/low including wicks). False switches to canonical SMC body bounds (max(open,close)/min(open,close)) and activates consume-after-fire so only one zone fires per setup.",
      "title": "Use Wicks",
      "type": "boolean"
    }
  },
  "title": "OrderBlockCondition",
  "type": "object"
}
