{
  "additionalProperties": false,
  "description": "Field from latest event payload.\n\nAuthoring flow:\n  1. Call list_event_types().\n  2. Pick event_type_id from a returned event type.\n  3. Pick event_field from payload_schema.fields.\n\nExample:\n  {\"type\": \"event_field\", \"event_type_id\": \"macro.cpi\",\n   \"event_field\": \"value\"}\n\nTo compare a release against a previous one, set occurrences_back on a\nsecond ref and subtract:\n  {\"type\": \"binary_expr\", \"op\": \"-\",\n   \"left\":  {\"type\": \"event_field\", \"event_type_id\": \"macro.cpi\",\n             \"event_field\": \"value\"},\n   \"right\": {\"type\": \"event_field\", \"event_type_id\": \"macro.cpi\",\n             \"event_field\": \"value\", \"occurrences_back\": 1}}",
  "properties": {
    "event_field": {
      "description": "Payload field from payload_schema.fields.",
      "title": "Event Field",
      "type": "string"
    },
    "event_type_id": {
      "description": "Event type ID from list_event_types().",
      "title": "Event Type Id",
      "type": "string"
    },
    "factor": {
      "anyOf": [
        {
          "maximum": 1000000.0,
          "minimum": -1000000.0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Factor"
    },
    "fill": {
      "default": "previous",
      "description": "'previous' carries forward; 'none' resolves only on the event bar.",
      "enum": [
        "none",
        "previous"
      ],
      "title": "Fill",
      "type": "string"
    },
    "max_age_seconds": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Staleness limit for carried-forward values, in seconds.",
      "title": "Max Age Seconds"
    },
    "occurrences_back": {
      "default": 0,
      "description": "0 = latest release; 1 = the release before it, and so on. Counted by distinct data period, so a later revision of an earlier period does not consume a step. Requires an event type whose payload declares a 'period' (the macro.*/treasury.*/market.*/energy.* release families) and fill='previous'. Resolves as missing when fewer than occurrences_back+1 releases are known.",
      "minimum": 0,
      "title": "Occurrences Back",
      "type": "integer"
    },
    "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": "event_field",
      "default": "event_field",
      "title": "Type",
      "type": "string"
    }
  },
  "required": [
    "event_type_id",
    "event_field"
  ],
  "title": "EventFieldSignalRef",
  "type": "object"
}
