{
  "schemaVersion": "1.0",
  "kind": "ackalgo-strategy-workspace",
  "strategy": {
    "schemaVersion": "1.0",
    "id": "rsi-reversal-strategy",
    "name": "RSI 30 / 70 Reversal",
    "description": "Enter after RSI leaves an extreme zone on a completed bar.",
    "platform": "mt5",
    "symbol": "XAUUSD",
    "primaryTimeframe": "M15",
    "confirmationTimeframes": [],
    "evaluationMode": "closed_bar",
    "tradeDirection": "both",
    "nodes": [
      {
        "id": "rsi",
        "type": "strategy",
        "position": {
          "x": 20,
          "y": 170
        },
        "data": {
          "kind": "indicator",
          "label": "RSI 14",
          "description": "Relative Strength Index calculated from close prices.",
          "config": {
            "indicatorId": "rsi",
            "timeframe": "M15",
            "parameters": {
              "period": 14,
              "appliedPrice": "PRICE_CLOSE"
            },
            "output": "value"
          }
        }
      },
      {
        "id": "rsi-long",
        "type": "strategy",
        "position": {
          "x": 240,
          "y": 80
        },
        "data": {
          "kind": "condition",
          "label": "RSI Crosses Above 30",
          "description": "Long signal after RSI recovers from oversold.",
          "config": {
            "operator": "crosses_above",
            "left": {
              "kind": "node",
              "nodeId": "rsi",
              "output": "value",
              "shift": 1
            },
            "right": {
              "kind": "constant",
              "value": 30
            },
            "signal": "long",
            "evaluateOn": "closed_bar"
          }
        }
      },
      {
        "id": "rsi-short",
        "type": "strategy",
        "position": {
          "x": 240,
          "y": 260
        },
        "data": {
          "kind": "condition",
          "label": "RSI Crosses Below 70",
          "description": "Short signal after RSI falls from overbought.",
          "config": {
            "operator": "crosses_below",
            "left": {
              "kind": "node",
              "nodeId": "rsi",
              "output": "value",
              "shift": 1
            },
            "right": {
              "kind": "constant",
              "value": 70
            },
            "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": "rsi-to-long",
        "source": "rsi",
        "target": "rsi-long",
        "type": "smoothstep",
        "data": {
          "role": "data"
        }
      },
      {
        "id": "rsi-to-short",
        "source": "rsi",
        "target": "rsi-short",
        "type": "smoothstep",
        "data": {
          "role": "data"
        }
      },
      {
        "id": "long-to-entry",
        "source": "rsi-long",
        "target": "entry",
        "type": "smoothstep",
        "data": {
          "role": "signal"
        }
      },
      {
        "id": "short-to-entry",
        "source": "rsi-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"
        }
      }
    ]
  }
}
