{
  "additionalProperties": false,
  "properties": {
    "factor": {
      "anyOf": [
        {
          "maximum": 1000000.0,
          "minimum": -1000000.0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Factor"
    },
    "lookback_bars": {
      "maximum": 1000,
      "minimum": 2,
      "title": "Lookback Bars",
      "type": "integer"
    },
    "percentile_level": {
      "anyOf": [
        {
          "maximum": 100.0,
          "minimum": 0.0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Percentile Level"
    },
    "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"
    },
    "source": {
      "additionalProperties": true,
      "title": "Source",
      "type": "object"
    },
    "stat": {
      "enum": [
        "mean",
        "std",
        "zscore",
        "sum",
        "count",
        "rank",
        "percentile",
        "ema"
      ],
      "title": "Stat",
      "type": "string"
    },
    "type": {
      "const": "rolling_stats",
      "default": "rolling_stats",
      "title": "Type",
      "type": "string"
    }
  },
  "required": [
    "source",
    "lookback_bars",
    "stat"
  ],
  "title": "RollingStatsSignalRef",
  "type": "object"
}
