{
  "additionalProperties": false,
  "description": "VIB-1367 phase 4 / VIB-1319: the sub-metric selector is named ``field``\nacross every ValueRef-style type. The legacy name ``trade_metric`` was\nremoved.",
  "properties": {
    "factor": {
      "anyOf": [
        {
          "maximum": 1000000.0,
          "minimum": -1000000.0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Factor"
    },
    "field": {
      "enum": [
        "trade_count",
        "consecutive_wins",
        "consecutive_losses",
        "last_pnl",
        "last_pnl_pct",
        "rolling_win_rate",
        "rolling_avg_pnl_pct",
        "bars_since_last_exit"
      ],
      "title": "Field",
      "type": "string"
    },
    "resolution": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional higher-timeframe override for this value ref. Set it inside lhs/rhs refs such as {'type': 'indicator', ..., 'resolution': '4h'} or {'type': 'price', 'field': 'close', 'resolution': '4h'}. Do not put timeframe/source_timeframe on the parent condition. None = strategy timeframe.",
      "title": "Resolution"
    },
    "type": {
      "const": "trade_history",
      "default": "trade_history",
      "title": "Type",
      "type": "string"
    },
    "window": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Window"
    }
  },
  "required": [
    "field"
  ],
  "title": "TradeHistorySignalRef",
  "type": "object"
}
