{
  "schemaVersion": "1.0",
  "kind": "ackalgo-strategy-workspace",
  "strategy": {
    "schemaVersion": "1.0",
    "id": "session-atr-strategy",
    "name": "Broker Session + H1 ATR",
    "description": "Use an example broker-time session window, a closed-candle direction rule, and H1 ATR protection.",
    "platform": "mt5",
    "symbol": "XAUUSD",
    "primaryTimeframe": "M15",
    "confirmationTimeframes": [
      "H1"
    ],
    "evaluationMode": "closed_bar",
    "tradeDirection": "both",
    "nodes": [
      {
        "id": "session",
        "type": "strategy",
        "position": {
          "x": 20,
          "y": 80
        },
        "data": {
          "kind": "session",
          "label": "Example Broker-Time Window",
          "description": "Static weekday broker-time example. Adjust it for the broker schedule and daylight-saving changes.",
          "config": {
            "timezone": "broker",
            "start": "12:00",
            "end": "16:00",
            "days": [
              1,
              2,
              3,
              4,
              5
            ]
          }
        }
      },
      {
        "id": "atr",
        "type": "strategy",
        "position": {
          "x": 20,
          "y": 260
        },
        "data": {
          "kind": "indicator",
          "label": "H1 ATR 14",
          "description": "Higher-timeframe volatility used for protective levels.",
          "config": {
            "indicatorId": "atr",
            "timeframe": "H1",
            "parameters": {
              "period": 14
            },
            "output": "value"
          }
        }
      },
      {
        "id": "candle-direction",
        "type": "strategy",
        "position": {
          "x": 240,
          "y": 170
        },
        "data": {
          "kind": "condition",
          "label": "Closed Candle Direction",
          "description": "Buy after a bullish close and reverse the rule for sells.",
          "config": {
            "operator": "greater_than",
            "left": {
              "kind": "market",
              "field": "close",
              "shift": 1
            },
            "right": {
              "kind": "market",
              "field": "open",
              "shift": 1
            },
            "signal": "both",
            "evaluateOn": "closed_bar",
            "reverseForOpposite": true
          }
        }
      },
      {
        "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% · ATR Protection",
          "description": "Use H1 ATR for symbol-aware stop and target distances.",
          "config": {
            "sizingMode": "risk_percent",
            "riskPercent": 1,
            "stopLoss": {
              "mode": "atr",
              "value": 1.5,
              "sourceNodeId": "atr"
            },
            "takeProfit": {
              "mode": "atr",
              "value": 3,
              "sourceNodeId": "atr"
            }
          }
        }
      },
      {
        "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": "session-to-rule",
        "source": "session",
        "target": "candle-direction",
        "type": "smoothstep",
        "data": {
          "role": "filter"
        }
      },
      {
        "id": "rule-to-entry",
        "source": "candle-direction",
        "target": "entry",
        "type": "smoothstep",
        "data": {
          "role": "signal"
        }
      },
      {
        "id": "entry-to-risk",
        "source": "entry",
        "target": "risk",
        "type": "smoothstep",
        "data": {
          "role": "risk"
        }
      },
      {
        "id": "atr-to-risk",
        "source": "atr",
        "target": "risk",
        "type": "smoothstep",
        "data": {
          "role": "data"
        }
      },
      {
        "id": "risk-to-exit",
        "source": "risk",
        "target": "exit",
        "type": "smoothstep",
        "data": {
          "role": "risk"
        }
      }
    ]
  }
}
