{
  "schemaVersion": "1.0",
  "kind": "ackalgo-strategy-workspace",
  "strategy": {
    "schemaVersion": "1.0",
    "id": "fractal-breakout-strategy",
    "name": "Confirmed Fractal Breakout",
    "description": "Enter when a closed price first crosses the latest fully confirmed upper or lower fractal.",
    "platform": "mt5",
    "symbol": "XAUUSD",
    "primaryTimeframe": "H1",
    "confirmationTimeframes": [],
    "evaluationMode": "closed_bar",
    "tradeDirection": "both",
    "nodes": [
      {
        "id": "fractals",
        "type": "strategy",
        "position": {
          "x": 20,
          "y": 170
        },
        "data": {
          "kind": "indicator",
          "label": "Confirmed Fractals",
          "description": "Sparse upper and lower buffers are searched from the first fully confirmed fractal at bar 3.",
          "config": {
            "indicatorId": "fractals",
            "timeframe": "H1",
            "parameters": {},
            "output": "upper"
          }
        }
      },
      {
        "id": "breakout-long",
        "type": "strategy",
        "position": {
          "x": 240,
          "y": 80
        },
        "data": {
          "kind": "condition",
          "label": "Close Breaks Upper Fractal",
          "description": "Long signal after a completed candle closes above resistance.",
          "config": {
            "operator": "breaks_above",
            "left": {
              "kind": "market",
              "field": "close",
              "shift": 1
            },
            "right": {
              "kind": "node",
              "nodeId": "fractals",
              "output": "upper",
              "shift": 3,
              "readMode": "last_non_empty",
              "maxLookbackBars": 100
            },
            "signal": "long",
            "evaluateOn": "closed_bar"
          }
        }
      },
      {
        "id": "breakout-short",
        "type": "strategy",
        "position": {
          "x": 240,
          "y": 260
        },
        "data": {
          "kind": "condition",
          "label": "Close Breaks Lower Fractal",
          "description": "Short signal after a completed candle closes below support.",
          "config": {
            "operator": "breaks_below",
            "left": {
              "kind": "market",
              "field": "close",
              "shift": 1
            },
            "right": {
              "kind": "node",
              "nodeId": "fractals",
              "output": "lower",
              "shift": 3,
              "readMode": "last_non_empty",
              "maxLookbackBars": 100
            },
            "signal": "short",
            "evaluateOn": "closed_bar"
          }
        }
      },
      {
        "id": "entry",
        "type": "strategy",
        "position": {
          "x": 460,
          "y": 80
        },
        "data": {
          "kind": "entry",
          "label": "Market Entry",
          "description": "Open at market after the closed-bar signal is confirmed.",
          "config": {
            "side": "both",
            "orderType": "market",
            "maxOpenPositions": 1,
            "oneTradePerBar": true
          }
        }
      },
      {
        "id": "risk",
        "type": "strategy",
        "position": {
          "x": 460,
          "y": 260
        },
        "data": {
          "kind": "risk",
          "label": "Risk 1% · 1:2 R:R",
          "description": "Size each position from account risk and protect every entry.",
          "config": {
            "sizingMode": "risk_percent",
            "riskPercent": 1,
            "stopLoss": {
              "mode": "percent",
              "value": 0.5
            },
            "takeProfit": {
              "mode": "percent",
              "value": 1
            }
          }
        }
      },
      {
        "id": "exit",
        "type": "strategy",
        "position": {
          "x": 680,
          "y": 170
        },
        "data": {
          "kind": "exit",
          "label": "Protected Exit",
          "description": "Close when the stop-loss or take-profit level is reached.",
          "config": {
            "mode": "stop_or_target"
          }
        }
      }
    ],
    "edges": [
      {
        "id": "fractals-to-long",
        "source": "fractals",
        "target": "breakout-long",
        "type": "smoothstep",
        "data": {
          "role": "data"
        }
      },
      {
        "id": "fractals-to-short",
        "source": "fractals",
        "target": "breakout-short",
        "type": "smoothstep",
        "data": {
          "role": "data"
        }
      },
      {
        "id": "long-to-entry",
        "source": "breakout-long",
        "target": "entry",
        "type": "smoothstep",
        "data": {
          "role": "signal"
        }
      },
      {
        "id": "short-to-entry",
        "source": "breakout-short",
        "target": "entry",
        "type": "smoothstep",
        "data": {
          "role": "signal"
        }
      },
      {
        "id": "entry-to-risk",
        "source": "entry",
        "target": "risk",
        "type": "smoothstep",
        "data": {
          "role": "risk"
        }
      },
      {
        "id": "risk-to-exit",
        "source": "risk",
        "target": "exit",
        "type": "smoothstep",
        "data": {
          "role": "risk"
        }
      }
    ]
  }
}
