{
  "schemaVersion": "1.0",
  "kind": "ackalgo-strategy-workspace",
  "strategy": {
    "schemaVersion": "1.0",
    "id": "ma-crossover-strategy",
    "name": "EMA 20 / 50 Crossover",
    "description": "Enter with the trend when the fast EMA crosses the slow EMA.",
    "platform": "mt5",
    "symbol": "EURUSD",
    "primaryTimeframe": "M15",
    "confirmationTimeframes": [],
    "evaluationMode": "closed_bar",
    "tradeDirection": "both",
    "nodes": [
      {
        "id": "fast-ma",
        "type": "strategy",
        "position": {
          "x": 20,
          "y": 80
        },
        "data": {
          "kind": "indicator",
          "label": "Fast EMA 20",
          "description": "Fast trend line on the execution timeframe.",
          "config": {
            "indicatorId": "moving-average",
            "timeframe": "M15",
            "parameters": {
              "period": 20,
              "shift": 0,
              "maMethod": "MODE_EMA",
              "appliedPrice": "PRICE_CLOSE"
            },
            "output": "value"
          }
        }
      },
      {
        "id": "slow-ma",
        "type": "strategy",
        "position": {
          "x": 20,
          "y": 260
        },
        "data": {
          "kind": "indicator",
          "label": "Slow EMA 50",
          "description": "Slow trend line on the execution timeframe.",
          "config": {
            "indicatorId": "moving-average",
            "timeframe": "M15",
            "parameters": {
              "period": 50,
              "shift": 0,
              "maMethod": "MODE_EMA",
              "appliedPrice": "PRICE_CLOSE"
            },
            "output": "value"
          }
        }
      },
      {
        "id": "ma-cross",
        "type": "strategy",
        "position": {
          "x": 240,
          "y": 170
        },
        "data": {
          "kind": "condition",
          "label": "EMA Crossover",
          "description": "Buy on a cross above and reverse the rule for sells.",
          "config": {
            "operator": "crosses_above",
            "left": {
              "kind": "node",
              "nodeId": "fast-ma",
              "output": "value",
              "shift": 1
            },
            "right": {
              "kind": "node",
              "nodeId": "slow-ma",
              "output": "value",
              "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% · 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": "fast-to-cross",
        "source": "fast-ma",
        "target": "ma-cross",
        "type": "smoothstep",
        "data": {
          "role": "data"
        }
      },
      {
        "id": "slow-to-cross",
        "source": "slow-ma",
        "target": "ma-cross",
        "type": "smoothstep",
        "data": {
          "role": "data"
        }
      },
      {
        "id": "cross-to-entry",
        "source": "ma-cross",
        "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"
        }
      }
    ]
  }
}
