{
  "additionalProperties": false,
  "description": "Execute a number of minutes after the session open or before the session close.\n\nSchedules the rule at that instant on every trading session, the general form of\n\"five minutes before the close\" or \"thirty minutes after the open\". The offset is\nresolved against each date's own open and close, so ``close`` with -5 is 12:55 on a\n13:00 half-day, and the order fills from the 1-minute execution print there. Works on\nANY timeframe, daily included; a daily strategy decides from the last completed daily\nbar (yesterday's).\n\n``open`` takes an offset of zero or more and ``close`` an offset of zero or less\n(negative is before the anchor): the opposite signs fall outside every session and are\nrefused when written. It needs a market with a session, so it is refused for crypto\n(24/7), which has no open or close; use ``at_time`` there. The rule is evaluated ONLY\nat these instants and places a market order, so other conditions alongside it are\nsampled then and a protective exit must not be scheduled. An entry at exactly the\nclose is refused by the simulator (its closing auction is reduce-only).\n\nBecause it names when to ACT, it can only be an entry or an exit trigger, alone or\ninside ``all_of`` with other conditions, one per rule. It cannot sit on a gate or\ninside any_of/not/sequence/consecutive/at_least/latch.\n\nExample, five minutes before the close: {\"kind\": \"at_session\", \"anchor\": \"close\", \"offset_minutes\": -5}",
  "properties": {
    "anchor": {
      "description": "The session boundary the offset is measured from: 'open' or 'close' of each trading session.",
      "enum": [
        "open",
        "close"
      ],
      "title": "Anchor",
      "type": "string"
    },
    "kind": {
      "const": "at_session",
      "default": "at_session",
      "title": "Kind",
      "type": "string"
    },
    "offset_minutes": {
      "description": "Whole minutes from the anchor; negative is before it. Zero or more after the 'open', zero or less before the 'close' (-5 is five minutes before the close). At most a day either way.",
      "maximum": 1440,
      "minimum": -1440,
      "title": "Offset Minutes",
      "type": "integer"
    }
  },
  "required": [
    "anchor",
    "offset_minutes"
  ],
  "title": "AtSessionCondition",
  "type": "object"
}
