{
  "additionalProperties": false,
  "description": "Trigger on spread or ratio deviation between two symbols.\n\nCalculates ratio, difference, log-ratio, or z-score between two assets.\nUse for pairs trading, intermarket mean-reversion, or relative-value entries.",
  "properties": {
    "calc_type": {
      "default": "zscore",
      "description": "How to calculate the spread value",
      "enum": [
        "ratio",
        "difference",
        "log_ratio",
        "zscore"
      ],
      "title": "Calc Type",
      "type": "string"
    },
    "hedge_ratio": {
      "anyOf": [
        {
          "maximum": 10.0,
          "minimum": 0.1,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Hedge ratio (default: 1.0 or rolling estimate)",
      "title": "Hedge Ratio"
    },
    "symbol_a": {
      "description": "First symbol in spread (numerator)",
      "title": "Symbol A",
      "type": "string"
    },
    "symbol_b": {
      "description": "Second symbol in spread (denominator)",
      "title": "Symbol B",
      "type": "string"
    },
    "threshold": {
      "default": 2.0,
      "description": "Threshold value for trigger",
      "title": "Threshold",
      "type": "number"
    },
    "trigger_op": {
      "default": "above",
      "description": "Trigger when spread is above/below threshold",
      "enum": [
        "above",
        "below",
        "crosses_above",
        "crosses_below"
      ],
      "title": "Trigger Op",
      "type": "string"
    },
    "type": {
      "const": "spread",
      "default": "spread",
      "title": "Type",
      "type": "string"
    },
    "window_bars": {
      "default": 100,
      "description": "Lookback for rolling calculations",
      "maximum": 1000,
      "minimum": 10,
      "title": "Window Bars",
      "type": "integer"
    }
  },
  "required": [
    "symbol_a",
    "symbol_b"
  ],
  "title": "SpreadCondition",
  "type": "object"
}
