{
  "additionalProperties": false,
  "description": "Breakout then pullback confirmation.\n\nDetects when price breaks above/below an N-bar high/low, then retests\nthat breakout level within a configurable window. The pattern confirms\nwhen the retest holds (price touches breakout level but closes on the\ncorrect side).\n\nMaps to BreakoutRetestSpec which compiles to a 2-step sequence:\n  Step 1 (breakout): close > N-bar MAX(high) or close < N-bar MIN(low)\n  Step 2 (retest):   price pulls back to breakout level and holds\n\nExamples:\n  Long: {\"card_type\": \"breakout_retest\", \"direction\": \"above\",\n         \"lookback_bars\": 20, \"retest_window\": 5,\n         \"pullback_depth_atr\": 1.0}\n  Short: {\"card_type\": \"breakout_retest\", \"direction\": \"below\",\n          \"lookback_bars\": 50, \"retest_window\": 8,\n          \"pullback_depth_atr\": 1.5}",
  "properties": {
    "card_type": {
      "const": "breakout_retest",
      "default": "breakout_retest",
      "title": "Card Type",
      "type": "string"
    },
    "direction": {
      "default": "above",
      "description": "'above' creates a long entry after resistance breaks and retests; 'below' creates a short entry after support breaks and retests.",
      "enum": [
        "above",
        "below"
      ],
      "title": "Direction",
      "type": "string"
    },
    "lookback_bars": {
      "default": 20,
      "description": "Breakout lookback in bars. direction='above' breaks above the lookback high; direction='below' breaks below the lookback low.",
      "maximum": 200,
      "minimum": 5,
      "title": "Lookback Bars",
      "type": "integer"
    },
    "pullback_depth_atr": {
      "default": 1.0,
      "description": "Allowed pullback depth in ATR units around the breakout level. Smaller values require a tighter retest; larger values allow a deeper pullback.",
      "maximum": 10.0,
      "minimum": 0.1,
      "title": "Pullback Depth Atr",
      "type": "number"
    },
    "retest_window": {
      "default": 5,
      "description": "Maximum bars after the breakout for the pullback retest to hold.",
      "maximum": 50,
      "minimum": 1,
      "title": "Retest Window",
      "type": "integer"
    }
  },
  "title": "BreakoutRetestCard",
  "type": "object"
}
