{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "MyInvestPilot Primitives Schema",
  "description": "Schema definitions for all primitive components used in strategy definitions",
  "definitions": {
    "ChandelierExit": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "ChandelierExit",
          "description": "Primitive type identifier for ChandelierExit"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for ChandelierExit indicator.",
          "properties": {
            "period": {
              "default": 60,
              "description": "The lookback period for highest high and ATR",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "multiplier": {
              "default": 4.0,
              "description": "The ATR multiplier",
              "exclusiveMinimum": 0,
              "title": "Multiplier",
              "type": "number"
            },
            "add_ma": {
              "default": false,
              "description": "Whether to also calculate MA",
              "title": "Add Ma",
              "type": "boolean"
            },
            "ma_period": {
              "default": 250,
              "description": "The period for MA calculation if add_ma=True",
              "exclusiveMinimum": 0,
              "title": "Ma Period",
              "type": "integer"
            }
          },
          "title": "ChandelierExitParams",
          "type": "object"
        },
        "period": {
          "default": 60,
          "description": "The lookback period for highest high and ATR",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "multiplier": {
          "default": 4.0,
          "description": "The ATR multiplier",
          "exclusiveMinimum": 0,
          "title": "Multiplier",
          "type": "number"
        },
        "add_ma": {
          "default": false,
          "description": "Whether to also calculate MA",
          "title": "Add Ma",
          "type": "boolean"
        },
        "ma_period": {
          "default": 250,
          "description": "The period for MA calculation if add_ma=True",
          "exclusiveMinimum": 0,
          "title": "Ma Period",
          "type": "integer"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for ChandelierExit primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Constant": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Constant",
          "description": "Primitive type identifier for Constant"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for Constant indicator.",
          "properties": {
            "value": {
              "default": 1.0,
              "description": "The constant value to generate",
              "title": "Value",
              "type": "number"
            }
          },
          "title": "ConstantParams",
          "type": "object"
        },
        "value": {
          "default": 1.0,
          "description": "The constant value to generate",
          "title": "Value",
          "type": "number"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for Constant primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "DonchianChannel": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "DonchianChannel",
          "description": "Primitive type identifier for DonchianChannel"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for DonchianChannel indicator.",
          "properties": {
            "period": {
              "default": 20,
              "description": "Number of bars in the channel window. Must be >= 1.",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "upper_column": {
              "default": "High",
              "description": "Column used to build the upper channel (rolling maximum).",
              "title": "Upper Column",
              "type": "string"
            },
            "lower_column": {
              "default": "Low",
              "description": "Column used to build the lower channel (rolling minimum).",
              "title": "Lower Column",
              "type": "string"
            },
            "exclude_current": {
              "default": true,
              "description": "If True, the channel value at bar t uses only completed bars ending at t-1 (upper[t]=max(column[t-period .. t-1])). This is the breakout-safe default. If False, the channel is an ordinary rolling range that includes bar t.",
              "title": "Exclude Current",
              "type": "boolean"
            }
          },
          "title": "DonchianChannelParams",
          "type": "object"
        },
        "period": {
          "default": 20,
          "description": "Number of bars in the channel window. Must be >= 1.",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "upper_column": {
          "default": "High",
          "description": "Column used to build the upper channel (rolling maximum).",
          "title": "Upper Column",
          "type": "string"
        },
        "lower_column": {
          "default": "Low",
          "description": "Column used to build the lower channel (rolling minimum).",
          "title": "Lower Column",
          "type": "string"
        },
        "exclude_current": {
          "default": true,
          "description": "If True, the channel value at bar t uses only completed bars ending at t-1 (upper[t]=max(column[t-period .. t-1])). This is the breakout-safe default. If False, the channel is an ordinary rolling range that includes bar t.",
          "title": "Exclude Current",
          "type": "boolean"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for DonchianChannel primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-output-names": [
        "upper",
        "lower",
        "middle",
        "width"
      ]
    },
    "HighestValue": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "HighestValue",
          "description": "Primitive type identifier for HighestValue"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for extreme value indicators.",
          "properties": {
            "column": {
              "default": "Close",
              "description": "Column name to use from the input DataFrame",
              "title": "Column",
              "type": "string"
            },
            "period": {
              "default": 14,
              "description": "Lookback period for finding extreme values",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "output_format": {
              "default": "series",
              "description": "Output format",
              "enum": [
                "series",
                "dataframe"
              ],
              "title": "Output Format",
              "type": "string"
            }
          },
          "title": "ExtremeIndicatorParams",
          "type": "object"
        },
        "column": {
          "default": "Close",
          "description": "Column name to use from the input DataFrame",
          "title": "Column",
          "type": "string"
        },
        "period": {
          "default": 14,
          "description": "Lookback period for finding extreme values",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "output_format": {
          "default": "series",
          "description": "Output format",
          "enum": [
            "series",
            "dataframe"
          ],
          "title": "Output Format",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for HighestValue primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "LowestValue": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "LowestValue",
          "description": "Primitive type identifier for LowestValue"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for extreme value indicators.",
          "properties": {
            "column": {
              "default": "Close",
              "description": "Column name to use from the input DataFrame",
              "title": "Column",
              "type": "string"
            },
            "period": {
              "default": 14,
              "description": "Lookback period for finding extreme values",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "output_format": {
              "default": "series",
              "description": "Output format",
              "enum": [
                "series",
                "dataframe"
              ],
              "title": "Output Format",
              "type": "string"
            }
          },
          "title": "ExtremeIndicatorParams",
          "type": "object"
        },
        "column": {
          "default": "Close",
          "description": "Column name to use from the input DataFrame",
          "title": "Column",
          "type": "string"
        },
        "period": {
          "default": 14,
          "description": "Lookback period for finding extreme values",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "output_format": {
          "default": "series",
          "description": "Output format",
          "enum": [
            "series",
            "dataframe"
          ],
          "title": "Output Format",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for LowestValue primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "PercentFromHighest": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "PercentFromHighest",
          "description": "Primitive type identifier for PercentFromHighest"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for extreme value indicators.",
          "properties": {
            "column": {
              "default": "Close",
              "description": "Column name to use from the input DataFrame",
              "title": "Column",
              "type": "string"
            },
            "period": {
              "default": 14,
              "description": "Lookback period for finding extreme values",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "output_format": {
              "default": "series",
              "description": "Output format",
              "enum": [
                "series",
                "dataframe"
              ],
              "title": "Output Format",
              "type": "string"
            }
          },
          "title": "ExtremeIndicatorParams",
          "type": "object"
        },
        "column": {
          "default": "Close",
          "description": "Column name to use from the input DataFrame",
          "title": "Column",
          "type": "string"
        },
        "period": {
          "default": 14,
          "description": "Lookback period for finding extreme values",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "output_format": {
          "default": "series",
          "description": "Output format",
          "enum": [
            "series",
            "dataframe"
          ],
          "title": "Output Format",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for PercentFromHighest primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "PercentFromLowest": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "PercentFromLowest",
          "description": "Primitive type identifier for PercentFromLowest"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for extreme value indicators.",
          "properties": {
            "column": {
              "default": "Close",
              "description": "Column name to use from the input DataFrame",
              "title": "Column",
              "type": "string"
            },
            "period": {
              "default": 14,
              "description": "Lookback period for finding extreme values",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "output_format": {
              "default": "series",
              "description": "Output format",
              "enum": [
                "series",
                "dataframe"
              ],
              "title": "Output Format",
              "type": "string"
            }
          },
          "title": "ExtremeIndicatorParams",
          "type": "object"
        },
        "column": {
          "default": "Close",
          "description": "Column name to use from the input DataFrame",
          "title": "Column",
          "type": "string"
        },
        "period": {
          "default": 14,
          "description": "Lookback period for finding extreme values",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "output_format": {
          "default": "series",
          "description": "Output format",
          "enum": [
            "series",
            "dataframe"
          ],
          "title": "Output Format",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for PercentFromLowest primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "DebtRatio": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "DebtRatio",
          "description": "Primitive type identifier for DebtRatio"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "properties": {
            "column": {
              "default": "debt_ratio",
              "description": "Debt ratio column",
              "title": "Column",
              "type": "string"
            }
          },
          "title": "DebtRatioParams",
          "type": "object"
        },
        "column": {
          "default": "debt_ratio",
          "description": "Debt ratio column",
          "title": "Column",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for DebtRatio primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "OperatingCashflow": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "OperatingCashflow",
          "description": "Primitive type identifier for OperatingCashflow"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "properties": {
            "column": {
              "default": "operating_cashflow",
              "description": "Operating cash flow column",
              "title": "Column",
              "type": "string"
            }
          },
          "title": "OperatingCashflowParams",
          "type": "object"
        },
        "column": {
          "default": "operating_cashflow",
          "description": "Operating cash flow column",
          "title": "Column",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for OperatingCashflow primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "PE_TTM": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "PE_TTM",
          "description": "Primitive type identifier for PE_TTM"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "properties": {
            "column": {
              "default": "pe_ttm",
              "description": "PE TTM column",
              "title": "Column",
              "type": "string"
            }
          },
          "title": "PETTMParams",
          "type": "object"
        },
        "column": {
          "default": "pe_ttm",
          "description": "PE TTM column",
          "title": "Column",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for PE_TTM primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "ROE": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "ROE",
          "description": "Primitive type identifier for ROE"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "properties": {
            "column": {
              "default": "roe",
              "description": "Return on Equity column",
              "title": "Column",
              "type": "string"
            }
          },
          "title": "ROEParams",
          "type": "object"
        },
        "column": {
          "default": "roe",
          "description": "Return on Equity column",
          "title": "Column",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for ROE primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "RevenueYoY": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "RevenueYoY",
          "description": "Primitive type identifier for RevenueYoY"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "properties": {
            "column": {
              "default": "revenue_yoy",
              "description": "Revenue YoY column",
              "title": "Column",
              "type": "string"
            }
          },
          "title": "RevenueYoYParams",
          "type": "object"
        },
        "column": {
          "default": "revenue_yoy",
          "description": "Revenue YoY column",
          "title": "Column",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for RevenueYoY primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "MACD": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "MACD",
          "description": "Primitive type identifier for MACD"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for MACD indicator.",
          "properties": {
            "fast_period": {
              "default": 12,
              "description": "The period for the fast EMA",
              "exclusiveMinimum": 0,
              "title": "Fast Period",
              "type": "integer"
            },
            "slow_period": {
              "default": 26,
              "description": "The period for the slow EMA",
              "exclusiveMinimum": 0,
              "title": "Slow Period",
              "type": "integer"
            },
            "signal_period": {
              "default": 9,
              "description": "The period for the signal EMA",
              "exclusiveMinimum": 0,
              "title": "Signal Period",
              "type": "integer"
            },
            "column": {
              "default": "Close",
              "description": "The column to calculate MACD on",
              "title": "Column",
              "type": "string"
            },
            "output_format": {
              "default": "dict",
              "description": "Output format, either 'dict' or 'dataframe'",
              "enum": [
                "dict",
                "dataframe"
              ],
              "title": "Output Format",
              "type": "string"
            }
          },
          "title": "MACDParams",
          "type": "object"
        },
        "fast_period": {
          "default": 12,
          "description": "The period for the fast EMA",
          "exclusiveMinimum": 0,
          "title": "Fast Period",
          "type": "integer"
        },
        "slow_period": {
          "default": 26,
          "description": "The period for the slow EMA",
          "exclusiveMinimum": 0,
          "title": "Slow Period",
          "type": "integer"
        },
        "signal_period": {
          "default": 9,
          "description": "The period for the signal EMA",
          "exclusiveMinimum": 0,
          "title": "Signal Period",
          "type": "integer"
        },
        "column": {
          "default": "Close",
          "description": "The column to calculate MACD on",
          "title": "Column",
          "type": "string"
        },
        "output_format": {
          "default": "dict",
          "description": "Output format, either 'dict' or 'dataframe'",
          "enum": [
            "dict",
            "dataframe"
          ],
          "title": "Output Format",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for MACD primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-output-names": [
        "macd",
        "signal",
        "histogram"
      ]
    },
    "RSI": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "RSI",
          "description": "Primitive type identifier for RSI"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for RSI indicator.",
          "properties": {
            "period": {
              "default": 14,
              "description": "The lookback period for the RSI calculation",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "column": {
              "default": "Close",
              "description": "The column to calculate RSI on",
              "title": "Column",
              "type": "string"
            }
          },
          "title": "RSIParams",
          "type": "object"
        },
        "period": {
          "default": 14,
          "description": "The lookback period for the RSI calculation",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "column": {
          "default": "Close",
          "description": "The column to calculate RSI on",
          "title": "Column",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for RSI primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "RateOfChange": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "RateOfChange",
          "description": "Primitive type identifier for RateOfChange"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for the numeric rate-of-change feature.",
          "properties": {
            "periods": {
              "default": 1,
              "description": "Positive lookback in trading observations",
              "exclusiveMinimum": 0,
              "title": "Periods",
              "type": "integer"
            },
            "column": {
              "default": "Close",
              "description": "Input data column used to calculate decimal returns",
              "title": "Column",
              "type": "string"
            }
          },
          "title": "RateOfChangeParams",
          "type": "object"
        },
        "periods": {
          "default": 1,
          "description": "Positive lookback in trading observations",
          "exclusiveMinimum": 0,
          "title": "Periods",
          "type": "integer"
        },
        "column": {
          "default": "Close",
          "description": "Input data column used to calculate decimal returns",
          "title": "Column",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for RateOfChange primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "EMA": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "EMA",
          "description": "Primitive type identifier for EMA"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for Exponential Moving Average indicator.",
          "properties": {
            "period": {
              "default": 20,
              "description": "The lookback period for the moving average",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "column": {
              "default": "Close",
              "description": "The column to calculate EMA on",
              "title": "Column",
              "type": "string"
            },
            "adjust": {
              "default": false,
              "description": "Specify if the weights should be normalized",
              "title": "Adjust",
              "type": "boolean"
            }
          },
          "title": "EMAParams",
          "type": "object"
        },
        "period": {
          "default": 20,
          "description": "The lookback period for the moving average",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "column": {
          "default": "Close",
          "description": "The column to calculate EMA on",
          "title": "Column",
          "type": "string"
        },
        "adjust": {
          "default": false,
          "description": "Specify if the weights should be normalized",
          "title": "Adjust",
          "type": "boolean"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for EMA primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "SMA": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "SMA",
          "description": "Primitive type identifier for SMA"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for Simple Moving Average indicator.",
          "properties": {
            "period": {
              "default": 20,
              "description": "The lookback period for the moving average",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "column": {
              "default": "Close",
              "description": "The column to calculate SMA on",
              "title": "Column",
              "type": "string"
            }
          },
          "title": "SMAParams",
          "type": "object"
        },
        "period": {
          "default": 20,
          "description": "The lookback period for the moving average",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "column": {
          "default": "Close",
          "description": "The column to calculate SMA on",
          "title": "Column",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for SMA primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Stochastic": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Stochastic",
          "description": "Primitive type identifier for Stochastic"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for Stochastic Oscillator.",
          "properties": {
            "k_period": {
              "default": 14,
              "description": "The lookback period for %K calculation",
              "exclusiveMinimum": 0,
              "title": "K Period",
              "type": "integer"
            },
            "d_period": {
              "default": 3,
              "description": "The period for the %D moving average",
              "exclusiveMinimum": 0,
              "title": "D Period",
              "type": "integer"
            },
            "d_method": {
              "default": "simple",
              "description": "The method for calculating %D",
              "enum": [
                "simple",
                "exponential"
              ],
              "title": "D Method",
              "type": "string"
            },
            "output_format": {
              "default": "dict",
              "description": "Output format",
              "enum": [
                "dict",
                "dataframe"
              ],
              "title": "Output Format",
              "type": "string"
            }
          },
          "title": "StochasticParams",
          "type": "object"
        },
        "k_period": {
          "default": 14,
          "description": "The lookback period for %K calculation",
          "exclusiveMinimum": 0,
          "title": "K Period",
          "type": "integer"
        },
        "d_period": {
          "default": 3,
          "description": "The period for the %D moving average",
          "exclusiveMinimum": 0,
          "title": "D Period",
          "type": "integer"
        },
        "d_method": {
          "default": "simple",
          "description": "The method for calculating %D",
          "enum": [
            "simple",
            "exponential"
          ],
          "title": "D Method",
          "type": "string"
        },
        "output_format": {
          "default": "dict",
          "description": "Output format",
          "enum": [
            "dict",
            "dataframe"
          ],
          "title": "Output Format",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for Stochastic primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-output-names": [
        "k",
        "d"
      ]
    },
    "ATR": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "ATR",
          "description": "Primitive type identifier for ATR"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for ATR indicator.",
          "properties": {
            "period": {
              "default": 14,
              "description": "The lookback period for calculating ATR",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "method": {
              "default": "sma",
              "description": "The calculation method",
              "enum": [
                "sma",
                "ema"
              ],
              "title": "Method",
              "type": "string"
            }
          },
          "title": "ATRParams",
          "type": "object"
        },
        "period": {
          "default": 14,
          "description": "The lookback period for calculating ATR",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "method": {
          "default": "sma",
          "description": "The calculation method",
          "enum": [
            "sma",
            "ema"
          ],
          "title": "Method",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for ATR primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "BollingerBands": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "BollingerBands",
          "description": "Primitive type identifier for BollingerBands"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for Bollinger Bands indicator.",
          "properties": {
            "period": {
              "default": 20,
              "description": "The lookback period for the moving average",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "std_dev": {
              "default": 2.0,
              "description": "Standard deviation multiplier",
              "exclusiveMinimum": 0,
              "title": "Std Dev",
              "type": "number"
            },
            "column": {
              "default": "Close",
              "description": "The column to calculate bands on",
              "title": "Column",
              "type": "string"
            },
            "method": {
              "default": "sma",
              "description": "MA calculation method",
              "enum": [
                "sma",
                "ema"
              ],
              "title": "Method",
              "type": "string"
            }
          },
          "title": "BollingerBandsParams",
          "type": "object"
        },
        "period": {
          "default": 20,
          "description": "The lookback period for the moving average",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "std_dev": {
          "default": 2.0,
          "description": "Standard deviation multiplier",
          "exclusiveMinimum": 0,
          "title": "Std Dev",
          "type": "number"
        },
        "column": {
          "default": "Close",
          "description": "The column to calculate bands on",
          "title": "Column",
          "type": "string"
        },
        "method": {
          "default": "sma",
          "description": "MA calculation method",
          "enum": [
            "sma",
            "ema"
          ],
          "title": "Method",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for BollingerBands primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "numeric",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-output-names": [
        "middle",
        "upper",
        "lower"
      ]
    },
    "Comparison": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Comparison",
          "description": "Primitive type identifier for Comparison"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for Comparison signal.",
          "properties": {
            "comparison": {
              "default": "greater",
              "description": "Type of comparison to perform",
              "enum": [
                "greater",
                "less",
                "equal",
                "greater_equal",
                "less_equal",
                "not_equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "threshold": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Threshold value for comparison when only one input is provided",
              "title": "Threshold"
            },
            "epsilon": {
              "default": 1e-10,
              "description": "Small value to avoid floating point precision issues",
              "minimum": 0.0,
              "title": "Epsilon",
              "type": "number"
            }
          },
          "title": "ComparisonParams",
          "type": "object"
        },
        "comparison": {
          "default": "greater",
          "description": "Type of comparison to perform",
          "enum": [
            "greater",
            "less",
            "equal",
            "greater_equal",
            "less_equal",
            "not_equal"
          ],
          "title": "Comparison",
          "type": "string"
        },
        "threshold": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Threshold value for comparison when only one input is provided",
          "title": "Threshold"
        },
        "epsilon": {
          "default": 1e-10,
          "description": "Small value to avoid floating point precision issues",
          "minimum": 0.0,
          "title": "Epsilon",
          "type": "number"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 1
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for Comparison primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Crossover": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Crossover",
          "description": "Primitive type identifier for Crossover"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for Crossover signal.",
          "properties": {
            "mode": {
              "default": "cross",
              "description": "Comparison mode: 'cross' for actual crossing, 'simple' for basic comparison",
              "enum": [
                "cross",
                "simple"
              ],
              "title": "Mode",
              "type": "string"
            }
          },
          "title": "CrossoverParams",
          "type": "object"
        },
        "mode": {
          "default": "cross",
          "description": "Comparison mode: 'cross' for actual crossing, 'simple' for basic comparison",
          "enum": [
            "cross",
            "simple"
          ],
          "title": "Mode",
          "type": "string"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for Crossover primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Crossunder": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Crossunder",
          "description": "Primitive type identifier for Crossunder"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for Crossunder signal.",
          "properties": {
            "mode": {
              "default": "cross",
              "description": "Comparison mode: 'cross' for actual crossing, 'simple' for basic comparison",
              "enum": [
                "cross",
                "simple"
              ],
              "title": "Mode",
              "type": "string"
            }
          },
          "title": "CrossunderParams",
          "type": "object"
        },
        "mode": {
          "default": "cross",
          "description": "Comparison mode: 'cross' for actual crossing, 'simple' for basic comparison",
          "enum": [
            "cross",
            "simple"
          ],
          "title": "Mode",
          "type": "string"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for Crossunder primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "GreaterThan": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "GreaterThan",
          "description": "Primitive type identifier for GreaterThan"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for GreaterThan signal.",
          "properties": {
            "epsilon": {
              "default": 0.0,
              "description": "Small value for floating point comparison tolerance",
              "minimum": 0.0,
              "title": "Epsilon",
              "type": "number"
            }
          },
          "title": "GreaterThanParams",
          "type": "object"
        },
        "epsilon": {
          "default": 0.0,
          "description": "Small value for floating point comparison tolerance",
          "minimum": 0.0,
          "title": "Epsilon",
          "type": "number"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for GreaterThan primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "InRange": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "InRange",
          "description": "Primitive type identifier for InRange"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for InRange signal.",
          "properties": {
            "include_lower": {
              "default": true,
              "description": "Whether to include the lower bound",
              "title": "Include Lower",
              "type": "boolean"
            },
            "include_upper": {
              "default": true,
              "description": "Whether to include the upper bound",
              "title": "Include Upper",
              "type": "boolean"
            }
          },
          "title": "InRangeParams",
          "type": "object"
        },
        "include_lower": {
          "default": true,
          "description": "Whether to include the lower bound",
          "title": "Include Lower",
          "type": "boolean"
        },
        "include_upper": {
          "default": true,
          "description": "Whether to include the upper bound",
          "title": "Include Upper",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 3,
          "maxItems": 3
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for InRange primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "LessThan": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "LessThan",
          "description": "Primitive type identifier for LessThan"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for LessThan signal.",
          "properties": {
            "epsilon": {
              "default": 0.0,
              "description": "Small value for floating point comparison tolerance",
              "minimum": 0.0,
              "title": "Epsilon",
              "type": "number"
            }
          },
          "title": "LessThanParams",
          "type": "object"
        },
        "epsilon": {
          "default": 0.0,
          "description": "Small value for floating point comparison tolerance",
          "minimum": 0.0,
          "title": "Epsilon",
          "type": "number"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for LessThan primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "CrossAbove": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "CrossAbove",
          "description": "Primitive type identifier for CrossAbove"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for CrossAbove and CrossBelow signals.",
          "properties": {
            "threshold": {
              "default": 0.0,
              "description": "Additional threshold to require for crossing",
              "title": "Threshold",
              "type": "number"
            },
            "strict": {
              "default": false,
              "description": "If True, requires strict comparison for prior period",
              "title": "Strict",
              "type": "boolean"
            }
          },
          "title": "CrossCompositeParams",
          "type": "object"
        },
        "threshold": {
          "default": 0.0,
          "description": "Additional threshold to require for crossing",
          "title": "Threshold",
          "type": "number"
        },
        "strict": {
          "default": false,
          "description": "If True, requires strict comparison for prior period",
          "title": "Strict",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for CrossAbove primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "CrossBelow": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "CrossBelow",
          "description": "Primitive type identifier for CrossBelow"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for CrossAbove and CrossBelow signals.",
          "properties": {
            "threshold": {
              "default": 0.0,
              "description": "Additional threshold to require for crossing",
              "title": "Threshold",
              "type": "number"
            },
            "strict": {
              "default": false,
              "description": "If True, requires strict comparison for prior period",
              "title": "Strict",
              "type": "boolean"
            }
          },
          "title": "CrossCompositeParams",
          "type": "object"
        },
        "threshold": {
          "default": 0.0,
          "description": "Additional threshold to require for crossing",
          "title": "Threshold",
          "type": "number"
        },
        "strict": {
          "default": false,
          "description": "If True, requires strict comparison for prior period",
          "title": "Strict",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for CrossBelow primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "CrossSectionalRank": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "CrossSectionalRank",
          "description": "Primitive type identifier for CrossSectionalRank"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "properties": {
            "direction": {
              "default": "descending",
              "description": "Feature ordering direction",
              "pattern": "^(ascending|descending)$",
              "title": "Direction",
              "type": "string"
            }
          },
          "title": "CrossSectionalRankParams",
          "type": "object"
        },
        "direction": {
          "default": "descending",
          "description": "Feature ordering direction",
          "pattern": "^(ascending|descending)$",
          "title": "Direction",
          "type": "string"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 3,
          "maxItems": 3
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for CrossSectionalRank primitive",
      "x-evaluation-domain": "cross_sectional",
      "x-output-type": "rank",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-input-types": [
        "numeric",
        "boolean",
        "cadence"
      ]
    },
    "EqualWeight": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "EqualWeight",
          "description": "Primitive type identifier for EqualWeight"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "properties": {
            "rebalance_policy": {
              "default": "scheduled",
              "description": "Emit on every scheduled decision or only when selected membership changes",
              "enum": [
                "scheduled",
                "membership_change"
              ],
              "title": "Rebalance Policy",
              "type": "string"
            }
          },
          "title": "EqualWeightParams",
          "type": "object"
        },
        "rebalance_policy": {
          "default": "scheduled",
          "description": "Emit on every scheduled decision or only when selected membership changes",
          "enum": [
            "scheduled",
            "membership_change"
          ],
          "title": "Rebalance Policy",
          "type": "string"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2,
          "maxItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for EqualWeight primitive",
      "x-evaluation-domain": "cross_sectional",
      "x-output-type": "weight",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-input-types": [
        "selection",
        "cadence"
      ]
    },
    "RebalanceCadence": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "RebalanceCadence",
          "description": "Primitive type identifier for RebalanceCadence"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "properties": {
            "frequency": {
              "default": "monthly_first_session",
              "description": "Portfolio decision-session cadence",
              "enum": [
                "daily",
                "weekly_first_session",
                "monthly_first_session"
              ],
              "title": "Frequency",
              "type": "string"
            },
            "bootstrap_on_first_session": {
              "default": true,
              "description": "For weekly/monthly cadence, act on the first observed Portfolio session when true; when false, wait for the next calendar period. Daily cadence is unaffected.",
              "title": "Bootstrap On First Session",
              "type": "boolean"
            }
          },
          "title": "RebalanceCadenceParams",
          "type": "object"
        },
        "frequency": {
          "default": "monthly_first_session",
          "description": "Portfolio decision-session cadence",
          "enum": [
            "daily",
            "weekly_first_session",
            "monthly_first_session"
          ],
          "title": "Frequency",
          "type": "string"
        },
        "bootstrap_on_first_session": {
          "default": true,
          "description": "For weekly/monthly cadence, act on the first observed Portfolio session when true; when false, wait for the next calendar period. Daily cadence is unaffected.",
          "title": "Bootstrap On First Session",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 0,
          "maxItems": 0
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for RebalanceCadence primitive",
      "x-evaluation-domain": "cross_sectional",
      "x-output-type": "cadence",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-input-types": []
    },
    "TopN": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "TopN",
          "description": "Primitive type identifier for TopN"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "properties": {
            "n": {
              "default": 1,
              "description": "Maximum selected symbol count",
              "exclusiveMinimum": 0,
              "title": "N",
              "type": "integer"
            }
          },
          "title": "TopNParams",
          "type": "object"
        },
        "n": {
          "default": 1,
          "description": "Maximum selected symbol count",
          "exclusiveMinimum": 0,
          "title": "N",
          "type": "integer"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2,
          "maxItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for TopN primitive",
      "x-evaluation-domain": "cross_sectional",
      "x-output-type": "selection",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-input-types": [
        "rank",
        "cadence"
      ]
    },
    "And": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "And",
          "description": "Primitive type identifier for And"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for logical signal primitives.",
          "properties": {
            "fill_method": {
              "anyOf": [
                {
                  "enum": [
                    "ffill",
                    "bfill"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Method to handle NaN values",
              "title": "Fill Method"
            }
          },
          "title": "LogicalParams",
          "type": "object"
        },
        "fill_method": {
          "anyOf": [
            {
              "enum": [
                "ffill",
                "bfill"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Method to handle NaN values",
          "title": "Fill Method"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for And primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Not": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Not",
          "description": "Primitive type identifier for Not"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for Not signal primitive.",
          "properties": {
            "fill_method": {
              "anyOf": [
                {
                  "enum": [
                    "ffill",
                    "bfill"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Method to handle NaN values",
              "title": "Fill Method"
            },
            "preserve_na": {
              "default": false,
              "description": "If True, NaN values remain NaN in the output",
              "title": "Preserve Na",
              "type": "boolean"
            }
          },
          "title": "NotParams",
          "type": "object"
        },
        "fill_method": {
          "anyOf": [
            {
              "enum": [
                "ffill",
                "bfill"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Method to handle NaN values",
          "title": "Fill Method"
        },
        "preserve_na": {
          "default": false,
          "description": "If True, NaN values remain NaN in the output",
          "title": "Preserve Na",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 1,
          "maxItems": 1
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for Not primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Or": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Or",
          "description": "Primitive type identifier for Or"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for logical signal primitives.",
          "properties": {
            "fill_method": {
              "anyOf": [
                {
                  "enum": [
                    "ffill",
                    "bfill"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Method to handle NaN values",
              "title": "Fill Method"
            }
          },
          "title": "LogicalParams",
          "type": "object"
        },
        "fill_method": {
          "anyOf": [
            {
              "enum": [
                "ffill",
                "bfill"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Method to handle NaN values",
          "title": "Fill Method"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for Or primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Add": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Add",
          "description": "Primitive type identifier for Add"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for mathematical operation signals.",
          "properties": {
            "operation": {
              "default": "add",
              "description": "Type of operation to perform",
              "enum": [
                "add",
                "subtract",
                "multiply",
                "divide"
              ],
              "title": "Operation",
              "type": "string"
            },
            "comparison": {
              "default": "greater",
              "description": "Type of comparison",
              "enum": [
                "greater",
                "less",
                "equal",
                "greater_equal",
                "less_equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "threshold": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Value to compare result against (if not comparing against another series)",
              "title": "Threshold"
            },
            "absolute": {
              "default": false,
              "description": "Whether to take the absolute value of the result before comparison",
              "title": "Absolute",
              "type": "boolean"
            },
            "return_calculation": {
              "default": false,
              "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
              "title": "Return Calculation",
              "type": "boolean"
            }
          },
          "title": "MathOperationParams",
          "type": "object"
        },
        "operation": {
          "default": "add",
          "description": "Type of operation to perform",
          "enum": [
            "add",
            "subtract",
            "multiply",
            "divide"
          ],
          "title": "Operation",
          "type": "string"
        },
        "comparison": {
          "default": "greater",
          "description": "Type of comparison",
          "enum": [
            "greater",
            "less",
            "equal",
            "greater_equal",
            "less_equal"
          ],
          "title": "Comparison",
          "type": "string"
        },
        "threshold": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Value to compare result against (if not comparing against another series)",
          "title": "Threshold"
        },
        "absolute": {
          "default": false,
          "description": "Whether to take the absolute value of the result before comparison",
          "title": "Absolute",
          "type": "boolean"
        },
        "return_calculation": {
          "default": false,
          "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
          "title": "Return Calculation",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for Add primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "dynamic",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Divide": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Divide",
          "description": "Primitive type identifier for Divide"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for mathematical operation signals.",
          "properties": {
            "operation": {
              "default": "divide",
              "description": "Type of operation to perform",
              "enum": [
                "add",
                "subtract",
                "multiply",
                "divide"
              ],
              "title": "Operation",
              "type": "string"
            },
            "comparison": {
              "default": "greater",
              "description": "Type of comparison",
              "enum": [
                "greater",
                "less",
                "equal",
                "greater_equal",
                "less_equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "threshold": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Value to compare result against (if not comparing against another series)",
              "title": "Threshold"
            },
            "absolute": {
              "default": false,
              "description": "Whether to take the absolute value of the result before comparison",
              "title": "Absolute",
              "type": "boolean"
            },
            "return_calculation": {
              "default": false,
              "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
              "title": "Return Calculation",
              "type": "boolean"
            }
          },
          "title": "MathOperationParams",
          "type": "object"
        },
        "operation": {
          "default": "divide",
          "description": "Type of operation to perform",
          "enum": [
            "add",
            "subtract",
            "multiply",
            "divide"
          ],
          "title": "Operation",
          "type": "string"
        },
        "comparison": {
          "default": "greater",
          "description": "Type of comparison",
          "enum": [
            "greater",
            "less",
            "equal",
            "greater_equal",
            "less_equal"
          ],
          "title": "Comparison",
          "type": "string"
        },
        "threshold": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Value to compare result against (if not comparing against another series)",
          "title": "Threshold"
        },
        "absolute": {
          "default": false,
          "description": "Whether to take the absolute value of the result before comparison",
          "title": "Absolute",
          "type": "boolean"
        },
        "return_calculation": {
          "default": false,
          "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
          "title": "Return Calculation",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for Divide primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "dynamic",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Multiply": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Multiply",
          "description": "Primitive type identifier for Multiply"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for mathematical operation signals.",
          "properties": {
            "operation": {
              "default": "multiply",
              "description": "Type of operation to perform",
              "enum": [
                "add",
                "subtract",
                "multiply",
                "divide"
              ],
              "title": "Operation",
              "type": "string"
            },
            "comparison": {
              "default": "greater",
              "description": "Type of comparison",
              "enum": [
                "greater",
                "less",
                "equal",
                "greater_equal",
                "less_equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "threshold": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Value to compare result against (if not comparing against another series)",
              "title": "Threshold"
            },
            "absolute": {
              "default": false,
              "description": "Whether to take the absolute value of the result before comparison",
              "title": "Absolute",
              "type": "boolean"
            },
            "return_calculation": {
              "default": false,
              "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
              "title": "Return Calculation",
              "type": "boolean"
            }
          },
          "title": "MathOperationParams",
          "type": "object"
        },
        "operation": {
          "default": "multiply",
          "description": "Type of operation to perform",
          "enum": [
            "add",
            "subtract",
            "multiply",
            "divide"
          ],
          "title": "Operation",
          "type": "string"
        },
        "comparison": {
          "default": "greater",
          "description": "Type of comparison",
          "enum": [
            "greater",
            "less",
            "equal",
            "greater_equal",
            "less_equal"
          ],
          "title": "Comparison",
          "type": "string"
        },
        "threshold": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Value to compare result against (if not comparing against another series)",
          "title": "Threshold"
        },
        "absolute": {
          "default": false,
          "description": "Whether to take the absolute value of the result before comparison",
          "title": "Absolute",
          "type": "boolean"
        },
        "return_calculation": {
          "default": false,
          "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
          "title": "Return Calculation",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for Multiply primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "dynamic",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Subtract": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Subtract",
          "description": "Primitive type identifier for Subtract"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for mathematical operation signals.",
          "properties": {
            "operation": {
              "default": "subtract",
              "description": "Type of operation to perform",
              "enum": [
                "add",
                "subtract",
                "multiply",
                "divide"
              ],
              "title": "Operation",
              "type": "string"
            },
            "comparison": {
              "default": "greater",
              "description": "Type of comparison",
              "enum": [
                "greater",
                "less",
                "equal",
                "greater_equal",
                "less_equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "threshold": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Value to compare result against (if not comparing against another series)",
              "title": "Threshold"
            },
            "absolute": {
              "default": false,
              "description": "Whether to take the absolute value of the result before comparison",
              "title": "Absolute",
              "type": "boolean"
            },
            "return_calculation": {
              "default": false,
              "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
              "title": "Return Calculation",
              "type": "boolean"
            }
          },
          "title": "MathOperationParams",
          "type": "object"
        },
        "operation": {
          "default": "subtract",
          "description": "Type of operation to perform",
          "enum": [
            "add",
            "subtract",
            "multiply",
            "divide"
          ],
          "title": "Operation",
          "type": "string"
        },
        "comparison": {
          "default": "greater",
          "description": "Type of comparison",
          "enum": [
            "greater",
            "less",
            "equal",
            "greater_equal",
            "less_equal"
          ],
          "title": "Comparison",
          "type": "string"
        },
        "threshold": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Value to compare result against (if not comparing against another series)",
          "title": "Threshold"
        },
        "absolute": {
          "default": false,
          "description": "Whether to take the absolute value of the result before comparison",
          "title": "Absolute",
          "type": "boolean"
        },
        "return_calculation": {
          "default": false,
          "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
          "title": "Return Calculation",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 2
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for Subtract primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "dynamic",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "PercentChange": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "PercentChange",
          "description": "Primitive type identifier for PercentChange"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for PercentChange signal.",
          "properties": {
            "periods": {
              "default": 1,
              "description": "Number of periods to calculate change over",
              "exclusiveMinimum": 0,
              "title": "Periods",
              "type": "integer"
            },
            "threshold": {
              "default": 0,
              "description": "Value to compare percent change against",
              "title": "Threshold",
              "type": "number"
            },
            "comparison": {
              "default": "greater",
              "description": "Comparison type",
              "enum": [
                "greater",
                "less",
                "equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "is_absolute": {
              "default": false,
              "description": "Whether to use absolute value of percent change",
              "title": "Is Absolute",
              "type": "boolean"
            }
          },
          "title": "PercentChangeParams",
          "type": "object"
        },
        "periods": {
          "default": 1,
          "description": "Number of periods to calculate change over",
          "exclusiveMinimum": 0,
          "title": "Periods",
          "type": "integer"
        },
        "threshold": {
          "default": 0,
          "description": "Value to compare percent change against",
          "title": "Threshold",
          "type": "number"
        },
        "comparison": {
          "default": "greater",
          "description": "Comparison type",
          "enum": [
            "greater",
            "less",
            "equal"
          ],
          "title": "Comparison",
          "type": "string"
        },
        "is_absolute": {
          "default": false,
          "description": "Whether to use absolute value of percent change",
          "title": "Is Absolute",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 1
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for PercentChange primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Streak": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Streak",
          "description": "Primitive type identifier for Streak"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for Streak pattern detection.",
          "properties": {
            "min_length": {
              "default": 2,
              "description": "Minimum number of consecutive occurrences required",
              "exclusiveMinimum": 0,
              "title": "Min Length",
              "type": "integer"
            },
            "max_length": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Maximum number of consecutive occurrences to consider",
              "title": "Max Length"
            },
            "match_type": {
              "default": "true",
              "description": "Type of streak to detect",
              "enum": [
                "true",
                "false",
                "any"
              ],
              "title": "Match Type",
              "type": "string"
            }
          },
          "title": "StreakParams",
          "type": "object"
        },
        "min_length": {
          "default": 2,
          "description": "Minimum number of consecutive occurrences required",
          "exclusiveMinimum": 0,
          "title": "Min Length",
          "type": "integer"
        },
        "max_length": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum number of consecutive occurrences to consider",
          "title": "Max Length"
        },
        "match_type": {
          "default": "true",
          "description": "Type of streak to detect",
          "enum": [
            "true",
            "false",
            "any"
          ],
          "title": "Match Type",
          "type": "string"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 1
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for Streak primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "StockBondSwitch": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "StockBondSwitch",
          "description": "Primitive type identifier for StockBondSwitch"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for StockBondSwitch signal.",
          "properties": {
            "default_to_stock": {
              "default": true,
              "description": "Whether to default to stock when condition is unavailable",
              "title": "Default To Stock",
              "type": "boolean"
            }
          },
          "title": "StockBondSwitchParams",
          "type": "object"
        },
        "default_to_stock": {
          "default": true,
          "description": "Whether to default to stock when condition is unavailable",
          "title": "Default To Stock",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 1
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for StockBondSwitch primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "boolean",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "Lag": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Lag",
          "description": "Primitive type identifier for Lag"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for Lag signal primitive.",
          "properties": {
            "periods": {
              "default": 1,
              "description": "Number of periods to shift. Positive values shift forward (look back at past values).",
              "minimum": 0,
              "title": "Periods",
              "type": "integer"
            },
            "fill_value": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Value to use for filling NaN positions created by the shift. For boolean series, use 0 (False) or 1 (True). None keeps NaN.",
              "title": "Fill Value"
            }
          },
          "title": "LagParams",
          "type": "object"
        },
        "periods": {
          "default": 1,
          "description": "Number of periods to shift. Positive values shift forward (look back at past values).",
          "minimum": 0,
          "title": "Periods",
          "type": "integer"
        },
        "fill_value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Value to use for filling NaN positions created by the shift. For boolean series, use 0 (False) or 1 (True). None keeps NaN.",
          "title": "Fill Value"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 1
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for Lag primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "dynamic",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "ConditionalWeight": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "ConditionalWeight",
          "description": "Primitive type identifier for ConditionalWeight"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for ConditionalWeight primitive.",
          "properties": {
            "true_weight": {
              "description": "条件为True时的权重",
              "maximum": 1,
              "minimum": 0,
              "title": "True Weight",
              "type": "number"
            },
            "false_weight": {
              "description": "条件为False时的权重",
              "maximum": 1,
              "minimum": 0,
              "title": "False Weight",
              "type": "number"
            }
          },
          "required": [
            "true_weight",
            "false_weight"
          ],
          "title": "ConditionalWeightParams",
          "type": "object"
        },
        "true_weight": {
          "description": "条件为True时的权重",
          "maximum": 1,
          "minimum": 0,
          "title": "True Weight",
          "type": "number"
        },
        "false_weight": {
          "description": "条件为False时的权重",
          "maximum": 1,
          "minimum": 0,
          "title": "False Weight",
          "type": "number"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 1
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for ConditionalWeight primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "weight",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "LinearScaleWeight": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "LinearScaleWeight",
          "description": "Primitive type identifier for LinearScaleWeight"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for LinearScaleWeight primitive.",
          "properties": {
            "min_indicator": {
              "description": "指标最小值",
              "title": "Min Indicator",
              "type": "number"
            },
            "max_indicator": {
              "description": "指标最大值",
              "title": "Max Indicator",
              "type": "number"
            },
            "min_weight": {
              "description": "映射到的最小权重",
              "maximum": 1,
              "minimum": 0,
              "title": "Min Weight",
              "type": "number"
            },
            "max_weight": {
              "description": "映射到的最大权重",
              "maximum": 1,
              "minimum": 0,
              "title": "Max Weight",
              "type": "number"
            },
            "clip": {
              "default": true,
              "description": "是否裁剪超出范围的值",
              "title": "Clip",
              "type": "boolean"
            }
          },
          "required": [
            "min_indicator",
            "max_indicator",
            "min_weight",
            "max_weight"
          ],
          "title": "LinearScaleWeightParams",
          "type": "object"
        },
        "min_indicator": {
          "description": "指标最小值",
          "title": "Min Indicator",
          "type": "number"
        },
        "max_indicator": {
          "description": "指标最大值",
          "title": "Max Indicator",
          "type": "number"
        },
        "min_weight": {
          "description": "映射到的最小权重",
          "maximum": 1,
          "minimum": 0,
          "title": "Min Weight",
          "type": "number"
        },
        "max_weight": {
          "description": "映射到的最大权重",
          "maximum": 1,
          "minimum": 0,
          "title": "Max Weight",
          "type": "number"
        },
        "clip": {
          "default": true,
          "description": "是否裁剪超出范围的值",
          "title": "Clip",
          "type": "boolean"
        },
        "inputs": {
          "type": "array",
          "description": "Input references for the signal",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Reference to another indicator or signal ID"
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                  }
                },
                "required": [
                  "column"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Reference to market indicator code"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "Reference to transformer name"
                  }
                },
                "required": [
                  "market",
                  "transformer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "description": "Canonical bare numeric literal value"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of constant value"
                  },
                  "value": {
                    "type": "number",
                    "description": "Constant numeric value"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/definitions/AnyNestedSignal",
                "description": "Nested signal definition"
              }
            ]
          },
          "minItems": 1
        }
      },
      "required": [
        "type",
        "id",
        "inputs"
      ],
      "additionalProperties": true,
      "description": "Configuration for LinearScaleWeight primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "weight",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "ChandelierExitTransformer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "ChandelierExitTransformer",
          "description": "Primitive type identifier for ChandelierExitTransformer"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for ChandelierExitTransformer.",
          "properties": {
            "indicator": {
              "description": "Market indicator code",
              "title": "Indicator",
              "type": "string"
            },
            "period": {
              "default": 30,
              "description": "Period for highest high and ATR calculation",
              "exclusiveMinimum": 0,
              "title": "Period",
              "type": "integer"
            },
            "multiplier": {
              "default": 2.0,
              "description": "ATR multiplier for stop calculation",
              "exclusiveMinimum": 0,
              "title": "Multiplier",
              "type": "number"
            }
          },
          "required": [
            "indicator"
          ],
          "title": "ChandelierExitTransformerParams",
          "type": "object"
        },
        "indicator": {
          "description": "Market indicator code",
          "title": "Indicator",
          "type": "string"
        },
        "period": {
          "default": 30,
          "description": "Period for highest high and ATR calculation",
          "exclusiveMinimum": 0,
          "title": "Period",
          "type": "integer"
        },
        "multiplier": {
          "default": 2.0,
          "description": "ATR multiplier for stop calculation",
          "exclusiveMinimum": 0,
          "title": "Multiplier",
          "type": "number"
        },
        "name": {
          "type": "string",
          "description": "Unique name for this transformer instance"
        }
      },
      "required": [
        "type",
        "name"
      ],
      "additionalProperties": true,
      "description": "Configuration for ChandelierExitTransformer primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "IdentityTransformer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "IdentityTransformer",
          "description": "Primitive type identifier for IdentityTransformer"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for IdentityTransformer.",
          "properties": {
            "indicator": {
              "description": "Market indicator code",
              "title": "Indicator",
              "type": "string"
            },
            "field": {
              "default": "Close",
              "description": "Field to use from the indicator data",
              "title": "Field",
              "type": "string"
            }
          },
          "required": [
            "indicator"
          ],
          "title": "IdentityTransformerParams",
          "type": "object"
        },
        "indicator": {
          "description": "Market indicator code",
          "title": "Indicator",
          "type": "string"
        },
        "field": {
          "default": "Close",
          "description": "Field to use from the indicator data",
          "title": "Field",
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Unique name for this transformer instance"
        }
      },
      "required": [
        "type",
        "name"
      ],
      "additionalProperties": true,
      "description": "Configuration for IdentityTransformer primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "MovingAverageTransformer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "MovingAverageTransformer",
          "description": "Primitive type identifier for MovingAverageTransformer"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for MovingAverageTransformer.",
          "example": {
            "field": "Close",
            "indicator": "VIX",
            "method": "simple",
            "window": 20
          },
          "properties": {
            "indicator": {
              "description": "Market indicator code",
              "title": "Indicator",
              "type": "string"
            },
            "window": {
              "description": "Size of the moving average window",
              "exclusiveMinimum": 0,
              "title": "Window",
              "type": "integer"
            },
            "method": {
              "default": "simple",
              "description": "Type of moving average",
              "enum": [
                "simple",
                "exponential",
                "weighted"
              ],
              "title": "Method",
              "type": "string"
            },
            "field": {
              "default": "Close",
              "description": "Field to use from the indicator data",
              "title": "Field",
              "type": "string"
            }
          },
          "required": [
            "indicator",
            "window"
          ],
          "title": "MovingAverageTransformerParams",
          "type": "object"
        },
        "indicator": {
          "description": "Market indicator code",
          "title": "Indicator",
          "type": "string"
        },
        "window": {
          "description": "Size of the moving average window",
          "exclusiveMinimum": 0,
          "title": "Window",
          "type": "integer"
        },
        "method": {
          "default": "simple",
          "description": "Type of moving average",
          "enum": [
            "simple",
            "exponential",
            "weighted"
          ],
          "title": "Method",
          "type": "string"
        },
        "field": {
          "default": "Close",
          "description": "Field to use from the indicator data",
          "title": "Field",
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Unique name for this transformer instance"
        }
      },
      "required": [
        "type",
        "name"
      ],
      "additionalProperties": true,
      "description": "Configuration for MovingAverageTransformer primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "PercentileRankTransformer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "PercentileRankTransformer",
          "description": "Primitive type identifier for PercentileRankTransformer"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for PercentileRankTransformer.",
          "properties": {
            "indicator": {
              "description": "Market indicator code",
              "title": "Indicator",
              "type": "string"
            },
            "lookback": {
              "description": "Historical period for percentile calculation",
              "exclusiveMinimum": 0,
              "title": "Lookback",
              "type": "integer"
            },
            "field": {
              "default": "Close",
              "description": "Field to use from the indicator data",
              "title": "Field",
              "type": "string"
            }
          },
          "required": [
            "indicator",
            "lookback"
          ],
          "title": "PercentileRankTransformerParams",
          "type": "object"
        },
        "indicator": {
          "description": "Market indicator code",
          "title": "Indicator",
          "type": "string"
        },
        "lookback": {
          "description": "Historical period for percentile calculation",
          "exclusiveMinimum": 0,
          "title": "Lookback",
          "type": "integer"
        },
        "field": {
          "default": "Close",
          "description": "Field to use from the indicator data",
          "title": "Field",
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Unique name for this transformer instance"
        }
      },
      "required": [
        "type",
        "name"
      ],
      "additionalProperties": true,
      "description": "Configuration for PercentileRankTransformer primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "RSITransformer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "RSITransformer",
          "description": "Primitive type identifier for RSITransformer"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for RSITransformer.",
          "properties": {
            "indicator": {
              "description": "Market indicator code",
              "title": "Indicator",
              "type": "string"
            },
            "window": {
              "default": 14,
              "description": "Period for RSI calculation",
              "exclusiveMinimum": 0,
              "title": "Window",
              "type": "integer"
            },
            "field": {
              "default": "Close",
              "description": "Field to use from the indicator data",
              "title": "Field",
              "type": "string"
            }
          },
          "required": [
            "indicator"
          ],
          "title": "RSITransformerParams",
          "type": "object"
        },
        "indicator": {
          "description": "Market indicator code",
          "title": "Indicator",
          "type": "string"
        },
        "window": {
          "default": 14,
          "description": "Period for RSI calculation",
          "exclusiveMinimum": 0,
          "title": "Window",
          "type": "integer"
        },
        "field": {
          "default": "Close",
          "description": "Field to use from the indicator data",
          "title": "Field",
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Unique name for this transformer instance"
        }
      },
      "required": [
        "type",
        "name"
      ],
      "additionalProperties": true,
      "description": "Configuration for RSITransformer primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "RelativeStrengthTransformer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "RelativeStrengthTransformer",
          "description": "Primitive type identifier for RelativeStrengthTransformer"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for RelativeStrengthTransformer.",
          "properties": {
            "indicator": {
              "description": "Market indicator code",
              "title": "Indicator",
              "type": "string"
            },
            "reference": {
              "description": "Reference method: 'ma', 'value', or 'lookback'",
              "title": "Reference",
              "type": "string"
            },
            "window": {
              "anyOf": [
                {
                  "exclusiveMinimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Window size for 'ma' or 'lookback' reference",
              "title": "Window"
            },
            "value": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Fixed value for 'value' reference",
              "title": "Value"
            },
            "field": {
              "default": "Close",
              "description": "Field to use from the indicator data",
              "title": "Field",
              "type": "string"
            }
          },
          "required": [
            "indicator",
            "reference"
          ],
          "title": "RelativeStrengthTransformerParams",
          "type": "object"
        },
        "indicator": {
          "description": "Market indicator code",
          "title": "Indicator",
          "type": "string"
        },
        "reference": {
          "description": "Reference method: 'ma', 'value', or 'lookback'",
          "title": "Reference",
          "type": "string"
        },
        "window": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Window size for 'ma' or 'lookback' reference",
          "title": "Window"
        },
        "value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Fixed value for 'value' reference",
          "title": "Value"
        },
        "field": {
          "default": "Close",
          "description": "Field to use from the indicator data",
          "title": "Field",
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Unique name for this transformer instance"
        }
      },
      "required": [
        "type",
        "name"
      ],
      "additionalProperties": true,
      "description": "Configuration for RelativeStrengthTransformer primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "ZScoreTransformer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "ZScoreTransformer",
          "description": "Primitive type identifier for ZScoreTransformer"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for ZScoreTransformer.",
          "properties": {
            "indicator": {
              "description": "Market indicator code",
              "title": "Indicator",
              "type": "string"
            },
            "window": {
              "description": "Historical period for mean/std calculation",
              "exclusiveMinimum": 0,
              "title": "Window",
              "type": "integer"
            },
            "field": {
              "default": "Close",
              "description": "Field to use from the indicator data",
              "title": "Field",
              "type": "string"
            }
          },
          "required": [
            "indicator",
            "window"
          ],
          "title": "ZScoreTransformerParams",
          "type": "object"
        },
        "indicator": {
          "description": "Market indicator code",
          "title": "Indicator",
          "type": "string"
        },
        "window": {
          "description": "Historical period for mean/std calculation",
          "exclusiveMinimum": 0,
          "title": "Window",
          "type": "integer"
        },
        "field": {
          "default": "Close",
          "description": "Field to use from the indicator data",
          "title": "Field",
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Unique name for this transformer instance"
        }
      },
      "required": [
        "type",
        "name"
      ],
      "additionalProperties": true,
      "description": "Configuration for ZScoreTransformer primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      }
    },
    "CashSweepPercentCapitalStrategy": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "CashSweepPercentCapitalStrategy",
          "description": "Primitive type identifier for CashSweepPercentCapitalStrategy"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for CashSweepPercentCapitalStrategy.",
          "properties": {
            "initial_capital": {
              "default": 100000.0,
              "description": "Initial capital amount",
              "exclusiveMinimum": 0,
              "title": "Initial Capital",
              "type": "number"
            },
            "percents": {
              "default": 20.0,
              "description": "Target percentage per traded symbol (same semantics as PercentCapitalStrategy)",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "title": "Percents",
              "type": "number"
            },
            "max_positions": {
              "anyOf": [
                {
                  "exclusiveMinimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Maximum number of non-auxiliary positions allowed, None for unlimited",
              "title": "Max Positions"
            },
            "sweep_symbol": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Optional symbol used as cash sweep destination",
              "title": "Sweep Symbol"
            },
            "min_sweep_cash": {
              "default": 1000.0,
              "description": "Minimum idle cash required before placing a sweep order",
              "minimum": 0,
              "title": "Min Sweep Cash",
              "type": "number"
            },
            "max_sweep_percent": {
              "default": 99.0,
              "description": "Upper bound for sweep target allocation to keep a cash safety buffer",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "title": "Max Sweep Percent",
              "type": "number"
            }
          },
          "title": "CashSweepPercentCapitalStrategyParams",
          "type": "object"
        },
        "initial_capital": {
          "default": 100000.0,
          "description": "Initial capital amount",
          "exclusiveMinimum": 0,
          "title": "Initial Capital",
          "type": "number"
        },
        "percents": {
          "default": 20.0,
          "description": "Target percentage per traded symbol (same semantics as PercentCapitalStrategy)",
          "exclusiveMinimum": 0,
          "maximum": 100,
          "title": "Percents",
          "type": "number"
        },
        "max_positions": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum number of non-auxiliary positions allowed, None for unlimited",
          "title": "Max Positions"
        },
        "sweep_symbol": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional symbol used as cash sweep destination",
          "title": "Sweep Symbol"
        },
        "min_sweep_cash": {
          "default": 1000.0,
          "description": "Minimum idle cash required before placing a sweep order",
          "minimum": 0,
          "title": "Min Sweep Cash",
          "type": "number"
        },
        "max_sweep_percent": {
          "default": 99.0,
          "description": "Upper bound for sweep target allocation to keep a cash safety buffer",
          "exclusiveMinimum": 0,
          "maximum": 100,
          "title": "Max Sweep Percent",
          "type": "number"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for CashSweepPercentCapitalStrategy primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-capabilities": {
        "allocation_mode": "target_percent",
        "target_weight_compatible": false,
        "atomic_complete_vector_compatible": false,
        "audited_target_weight_override": false
      }
    },
    "FixedInvestmentStrategy": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "FixedInvestmentStrategy",
          "description": "Primitive type identifier for FixedInvestmentStrategy"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for FixedInvestmentStrategy.",
          "properties": {
            "initial_capital": {
              "default": 100000.0,
              "description": "Initial capital amount",
              "exclusiveMinimum": 0,
              "title": "Initial Capital",
              "type": "number"
            },
            "investment_amount": {
              "default": 10000.0,
              "description": "Amount to invest periodically",
              "exclusiveMinimum": 0,
              "title": "Investment Amount",
              "type": "number"
            },
            "investment_frequency": {
              "default": "y",
              "description": "Investment frequency: 'y' for yearly, 'm' for monthly",
              "enum": [
                "y",
                "m"
              ],
              "title": "Investment Frequency",
              "type": "string"
            },
            "percents": {
              "default": 20.0,
              "description": "Maximum percentage per position",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "title": "Percents",
              "type": "number"
            },
            "fund_val_start": {
              "default": 100.0,
              "description": "Initial fund value",
              "exclusiveMinimum": 0,
              "title": "Fund Val Start",
              "type": "number"
            },
            "max_positions": {
              "anyOf": [
                {
                  "exclusiveMinimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Maximum number of positions allowed, None for unlimited",
              "title": "Max Positions"
            }
          },
          "title": "FixedInvestmentStrategyParams",
          "type": "object"
        },
        "initial_capital": {
          "default": 100000.0,
          "description": "Initial capital amount",
          "exclusiveMinimum": 0,
          "title": "Initial Capital",
          "type": "number"
        },
        "investment_amount": {
          "default": 10000.0,
          "description": "Amount to invest periodically",
          "exclusiveMinimum": 0,
          "title": "Investment Amount",
          "type": "number"
        },
        "investment_frequency": {
          "default": "y",
          "description": "Investment frequency: 'y' for yearly, 'm' for monthly",
          "enum": [
            "y",
            "m"
          ],
          "title": "Investment Frequency",
          "type": "string"
        },
        "percents": {
          "default": 20.0,
          "description": "Maximum percentage per position",
          "exclusiveMinimum": 0,
          "maximum": 100,
          "title": "Percents",
          "type": "number"
        },
        "fund_val_start": {
          "default": 100.0,
          "description": "Initial fund value",
          "exclusiveMinimum": 0,
          "title": "Fund Val Start",
          "type": "number"
        },
        "max_positions": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum number of positions allowed, None for unlimited",
          "title": "Max Positions"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for FixedInvestmentStrategy primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-capabilities": {
        "allocation_mode": "cash_based",
        "target_weight_compatible": true,
        "atomic_complete_vector_compatible": false,
        "audited_target_weight_override": true
      }
    },
    "PercentCapitalStrategy": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "PercentCapitalStrategy",
          "description": "Primitive type identifier for PercentCapitalStrategy"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for PercentCapitalStrategy.",
          "properties": {
            "initial_capital": {
              "default": 100000.0,
              "description": "Initial capital amount",
              "exclusiveMinimum": 0,
              "title": "Initial Capital",
              "type": "number"
            },
            "percents": {
              "default": 20.0,
              "description": "Percentage of total value to allocate per position",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "title": "Percents",
              "type": "number"
            },
            "max_positions": {
              "anyOf": [
                {
                  "exclusiveMinimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Maximum number of positions allowed, None for unlimited",
              "title": "Max Positions"
            }
          },
          "title": "PercentCapitalStrategyParams",
          "type": "object"
        },
        "initial_capital": {
          "default": 100000.0,
          "description": "Initial capital amount",
          "exclusiveMinimum": 0,
          "title": "Initial Capital",
          "type": "number"
        },
        "percents": {
          "default": 20.0,
          "description": "Percentage of total value to allocate per position",
          "exclusiveMinimum": 0,
          "maximum": 100,
          "title": "Percents",
          "type": "number"
        },
        "max_positions": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum number of positions allowed, None for unlimited",
          "title": "Max Positions"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for PercentCapitalStrategy primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-capabilities": {
        "allocation_mode": "cash_based",
        "target_weight_compatible": false,
        "atomic_complete_vector_compatible": false,
        "audited_target_weight_override": false
      }
    },
    "ProportionalCapitalStrategy": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "ProportionalCapitalStrategy",
          "description": "Primitive type identifier for ProportionalCapitalStrategy"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for ProportionalCapitalStrategy.\n\nThis strategy allows you to set different maximum position sizes for different symbols.\nUnlike PercentCapitalStrategy which uses the same percentage for all symbols,\nthis strategy lets you customize the maximum allocation for each symbol.\n\nExample:\n    {\n        \"weights\": {\n            \"SPY\": 0.30,   // Max 30% of portfolio for SPY (stable)\n            \"QQQ\": 0.25,   // Max 25% for QQQ (tech)\n            \"SOXL\": 0.15,  // Max 15% for SOXL (3x leveraged - higher risk)\n            \"TMF\": 0.20    // Max 20% for TMF (bond hedge)\n        }\n    }",
          "properties": {
            "initial_capital": {
              "default": 100000.0,
              "description": "Initial capital amount",
              "exclusiveMinimum": 0,
              "title": "Initial Capital",
              "type": "number"
            },
            "weights": {
              "additionalProperties": {
                "type": "number"
              },
              "description": "Maximum allocation weight for each symbol (e.g., {'SPY': 0.3, 'QQQ': 0.25})",
              "title": "Weights",
              "type": "object"
            }
          },
          "title": "ProportionalCapitalStrategyParams",
          "type": "object"
        },
        "initial_capital": {
          "default": 100000.0,
          "description": "Initial capital amount",
          "exclusiveMinimum": 0,
          "title": "Initial Capital",
          "type": "number"
        },
        "weights": {
          "additionalProperties": {
            "type": "number"
          },
          "description": "Maximum allocation weight for each symbol (e.g., {'SPY': 0.3, 'QQQ': 0.25})",
          "title": "Weights",
          "type": "object"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for ProportionalCapitalStrategy primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-capabilities": {
        "allocation_mode": "cash_based",
        "target_weight_compatible": false,
        "atomic_complete_vector_compatible": false,
        "audited_target_weight_override": false
      }
    },
    "RebalancingCapitalStrategy": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "RebalancingCapitalStrategy",
          "description": "Primitive type identifier for RebalancingCapitalStrategy"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for RebalancingCapitalStrategy.\n\nThis strategy reads target weights directly from trading signals and can\nreserve an explicit cash buffer for normalized Cross-sectional vectors.",
          "properties": {
            "initial_capital": {
              "default": 100000.0,
              "description": "Initial capital amount",
              "exclusiveMinimum": 0,
              "title": "Initial Capital",
              "type": "number"
            },
            "gross_exposure": {
              "default": 1.0,
              "description": "Fraction of portfolio value invested by normalized Cross-sectional complete target vectors",
              "exclusiveMinimum": 0.0,
              "maximum": 1.0,
              "title": "Gross Exposure",
              "type": "number"
            }
          },
          "title": "RebalancingCapitalStrategyParams",
          "type": "object"
        },
        "initial_capital": {
          "default": 100000.0,
          "description": "Initial capital amount",
          "exclusiveMinimum": 0,
          "title": "Initial Capital",
          "type": "number"
        },
        "gross_exposure": {
          "default": 1.0,
          "description": "Fraction of portfolio value invested by normalized Cross-sectional complete target vectors",
          "exclusiveMinimum": 0.0,
          "maximum": 1.0,
          "title": "Gross Exposure",
          "type": "number"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for RebalancingCapitalStrategy primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-capabilities": {
        "allocation_mode": "target_weight",
        "target_weight_compatible": true,
        "atomic_complete_vector_compatible": true,
        "audited_target_weight_override": false
      }
    },
    "SimplePercentCapitalStrategy": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "SimplePercentCapitalStrategy",
          "description": "Primitive type identifier for SimplePercentCapitalStrategy"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this primitive instance"
        },
        "params": {
          "additionalProperties": false,
          "description": "Parameters for SimplePercentCapitalStrategy.",
          "properties": {
            "initial_capital": {
              "default": 100000.0,
              "description": "Initial capital amount",
              "exclusiveMinimum": 0,
              "title": "Initial Capital",
              "type": "number"
            },
            "percents": {
              "default": 20.0,
              "description": "Percentage of available cash to allocate per position",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "title": "Percents",
              "type": "number"
            },
            "max_positions": {
              "anyOf": [
                {
                  "exclusiveMinimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Maximum number of positions allowed, None for unlimited",
              "title": "Max Positions"
            }
          },
          "title": "SimplePercentCapitalStrategyParams",
          "type": "object"
        },
        "initial_capital": {
          "default": 100000.0,
          "description": "Initial capital amount",
          "exclusiveMinimum": 0,
          "title": "Initial Capital",
          "type": "number"
        },
        "percents": {
          "default": 20.0,
          "description": "Percentage of available cash to allocate per position",
          "exclusiveMinimum": 0,
          "maximum": 100,
          "title": "Percents",
          "type": "number"
        },
        "max_positions": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum number of positions allowed, None for unlimited",
          "title": "Max Positions"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": true,
      "description": "Configuration for SimplePercentCapitalStrategy primitive",
      "x-evaluation-domain": "per_symbol",
      "x-output-type": "unknown",
      "not": {
        "anyOf": [
          {
            "required": [
              "evaluation_domain"
            ]
          },
          {
            "required": [
              "scope"
            ]
          }
        ]
      },
      "x-capabilities": {
        "allocation_mode": "cash_based",
        "target_weight_compatible": false,
        "atomic_complete_vector_compatible": false,
        "audited_target_weight_override": false
      }
    },
    "AnyIndicator": {
      "oneOf": [
        {
          "$ref": "#/definitions/ChandelierExit"
        },
        {
          "$ref": "#/definitions/Constant"
        },
        {
          "$ref": "#/definitions/DonchianChannel"
        },
        {
          "$ref": "#/definitions/HighestValue"
        },
        {
          "$ref": "#/definitions/LowestValue"
        },
        {
          "$ref": "#/definitions/PercentFromHighest"
        },
        {
          "$ref": "#/definitions/PercentFromLowest"
        },
        {
          "$ref": "#/definitions/DebtRatio"
        },
        {
          "$ref": "#/definitions/OperatingCashflow"
        },
        {
          "$ref": "#/definitions/PE_TTM"
        },
        {
          "$ref": "#/definitions/ROE"
        },
        {
          "$ref": "#/definitions/RevenueYoY"
        },
        {
          "$ref": "#/definitions/MACD"
        },
        {
          "$ref": "#/definitions/RSI"
        },
        {
          "$ref": "#/definitions/RateOfChange"
        },
        {
          "$ref": "#/definitions/EMA"
        },
        {
          "$ref": "#/definitions/SMA"
        },
        {
          "$ref": "#/definitions/Stochastic"
        },
        {
          "$ref": "#/definitions/ATR"
        },
        {
          "$ref": "#/definitions/BollingerBands"
        }
      ],
      "description": "Any supported indicator primitive"
    },
    "AnySignal": {
      "oneOf": [
        {
          "$ref": "#/definitions/Comparison"
        },
        {
          "$ref": "#/definitions/Crossover"
        },
        {
          "$ref": "#/definitions/Crossunder"
        },
        {
          "$ref": "#/definitions/GreaterThan"
        },
        {
          "$ref": "#/definitions/InRange"
        },
        {
          "$ref": "#/definitions/LessThan"
        },
        {
          "$ref": "#/definitions/CrossAbove"
        },
        {
          "$ref": "#/definitions/CrossBelow"
        },
        {
          "$ref": "#/definitions/CrossSectionalRank"
        },
        {
          "$ref": "#/definitions/EqualWeight"
        },
        {
          "$ref": "#/definitions/RebalanceCadence"
        },
        {
          "$ref": "#/definitions/TopN"
        },
        {
          "$ref": "#/definitions/And"
        },
        {
          "$ref": "#/definitions/Not"
        },
        {
          "$ref": "#/definitions/Or"
        },
        {
          "$ref": "#/definitions/Add"
        },
        {
          "$ref": "#/definitions/Divide"
        },
        {
          "$ref": "#/definitions/Multiply"
        },
        {
          "$ref": "#/definitions/Subtract"
        },
        {
          "$ref": "#/definitions/PercentChange"
        },
        {
          "$ref": "#/definitions/Streak"
        },
        {
          "$ref": "#/definitions/StockBondSwitch"
        },
        {
          "$ref": "#/definitions/Lag"
        },
        {
          "$ref": "#/definitions/ConditionalWeight"
        },
        {
          "$ref": "#/definitions/LinearScaleWeight"
        }
      ],
      "description": "Any supported signal primitive"
    },
    "AnyNestedSignal": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Comparison",
              "description": "Primitive type identifier for Comparison"
            },
            "params": {
              "description": "Parameters for Comparison signal.",
              "additionalProperties": false,
              "properties": {
                "comparison": {
                  "default": "greater",
                  "description": "Type of comparison to perform",
                  "enum": [
                    "greater",
                    "less",
                    "equal",
                    "greater_equal",
                    "less_equal",
                    "not_equal"
                  ],
                  "title": "Comparison",
                  "type": "string"
                },
                "threshold": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Threshold value for comparison when only one input is provided",
                  "title": "Threshold"
                },
                "epsilon": {
                  "default": 1e-10,
                  "description": "Small value to avoid floating point precision issues",
                  "minimum": 0.0,
                  "title": "Epsilon",
                  "type": "number"
                }
              },
              "title": "ComparisonParams",
              "type": "object"
            },
            "comparison": {
              "default": "greater",
              "description": "Type of comparison to perform",
              "enum": [
                "greater",
                "less",
                "equal",
                "greater_equal",
                "less_equal",
                "not_equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "threshold": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Threshold value for comparison when only one input is provided",
              "title": "Threshold"
            },
            "epsilon": {
              "default": 1e-10,
              "description": "Small value to avoid floating point precision issues",
              "minimum": 0.0,
              "title": "Epsilon",
              "type": "number"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 1
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested Comparison signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Crossover",
              "description": "Primitive type identifier for Crossover"
            },
            "params": {
              "description": "Parameters for Crossover signal.",
              "additionalProperties": false,
              "properties": {
                "mode": {
                  "default": "cross",
                  "description": "Comparison mode: 'cross' for actual crossing, 'simple' for basic comparison",
                  "enum": [
                    "cross",
                    "simple"
                  ],
                  "title": "Mode",
                  "type": "string"
                }
              },
              "title": "CrossoverParams",
              "type": "object"
            },
            "mode": {
              "default": "cross",
              "description": "Comparison mode: 'cross' for actual crossing, 'simple' for basic comparison",
              "enum": [
                "cross",
                "simple"
              ],
              "title": "Mode",
              "type": "string"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested Crossover signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Crossunder",
              "description": "Primitive type identifier for Crossunder"
            },
            "params": {
              "description": "Parameters for Crossunder signal.",
              "additionalProperties": false,
              "properties": {
                "mode": {
                  "default": "cross",
                  "description": "Comparison mode: 'cross' for actual crossing, 'simple' for basic comparison",
                  "enum": [
                    "cross",
                    "simple"
                  ],
                  "title": "Mode",
                  "type": "string"
                }
              },
              "title": "CrossunderParams",
              "type": "object"
            },
            "mode": {
              "default": "cross",
              "description": "Comparison mode: 'cross' for actual crossing, 'simple' for basic comparison",
              "enum": [
                "cross",
                "simple"
              ],
              "title": "Mode",
              "type": "string"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested Crossunder signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "GreaterThan",
              "description": "Primitive type identifier for GreaterThan"
            },
            "params": {
              "description": "Parameters for GreaterThan signal.",
              "additionalProperties": false,
              "properties": {
                "epsilon": {
                  "default": 0.0,
                  "description": "Small value for floating point comparison tolerance",
                  "minimum": 0.0,
                  "title": "Epsilon",
                  "type": "number"
                }
              },
              "title": "GreaterThanParams",
              "type": "object"
            },
            "epsilon": {
              "default": 0.0,
              "description": "Small value for floating point comparison tolerance",
              "minimum": 0.0,
              "title": "Epsilon",
              "type": "number"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested GreaterThan signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "InRange",
              "description": "Primitive type identifier for InRange"
            },
            "params": {
              "description": "Parameters for InRange signal.",
              "additionalProperties": false,
              "properties": {
                "include_lower": {
                  "default": true,
                  "description": "Whether to include the lower bound",
                  "title": "Include Lower",
                  "type": "boolean"
                },
                "include_upper": {
                  "default": true,
                  "description": "Whether to include the upper bound",
                  "title": "Include Upper",
                  "type": "boolean"
                }
              },
              "title": "InRangeParams",
              "type": "object"
            },
            "include_lower": {
              "default": true,
              "description": "Whether to include the lower bound",
              "title": "Include Lower",
              "type": "boolean"
            },
            "include_upper": {
              "default": true,
              "description": "Whether to include the upper bound",
              "title": "Include Upper",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 3,
              "maxItems": 3
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested InRange signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "LessThan",
              "description": "Primitive type identifier for LessThan"
            },
            "params": {
              "description": "Parameters for LessThan signal.",
              "additionalProperties": false,
              "properties": {
                "epsilon": {
                  "default": 0.0,
                  "description": "Small value for floating point comparison tolerance",
                  "minimum": 0.0,
                  "title": "Epsilon",
                  "type": "number"
                }
              },
              "title": "LessThanParams",
              "type": "object"
            },
            "epsilon": {
              "default": 0.0,
              "description": "Small value for floating point comparison tolerance",
              "minimum": 0.0,
              "title": "Epsilon",
              "type": "number"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested LessThan signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "CrossAbove",
              "description": "Primitive type identifier for CrossAbove"
            },
            "params": {
              "description": "Parameters for CrossAbove and CrossBelow signals.",
              "additionalProperties": false,
              "properties": {
                "threshold": {
                  "default": 0.0,
                  "description": "Additional threshold to require for crossing",
                  "title": "Threshold",
                  "type": "number"
                },
                "strict": {
                  "default": false,
                  "description": "If True, requires strict comparison for prior period",
                  "title": "Strict",
                  "type": "boolean"
                }
              },
              "title": "CrossCompositeParams",
              "type": "object"
            },
            "threshold": {
              "default": 0.0,
              "description": "Additional threshold to require for crossing",
              "title": "Threshold",
              "type": "number"
            },
            "strict": {
              "default": false,
              "description": "If True, requires strict comparison for prior period",
              "title": "Strict",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested CrossAbove signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "CrossBelow",
              "description": "Primitive type identifier for CrossBelow"
            },
            "params": {
              "description": "Parameters for CrossAbove and CrossBelow signals.",
              "additionalProperties": false,
              "properties": {
                "threshold": {
                  "default": 0.0,
                  "description": "Additional threshold to require for crossing",
                  "title": "Threshold",
                  "type": "number"
                },
                "strict": {
                  "default": false,
                  "description": "If True, requires strict comparison for prior period",
                  "title": "Strict",
                  "type": "boolean"
                }
              },
              "title": "CrossCompositeParams",
              "type": "object"
            },
            "threshold": {
              "default": 0.0,
              "description": "Additional threshold to require for crossing",
              "title": "Threshold",
              "type": "number"
            },
            "strict": {
              "default": false,
              "description": "If True, requires strict comparison for prior period",
              "title": "Strict",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested CrossBelow signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "CrossSectionalRank",
              "description": "Primitive type identifier for CrossSectionalRank"
            },
            "params": {
              "description": "Parameters for CrossSectionalRank signal.",
              "additionalProperties": false,
              "properties": {
                "direction": {
                  "default": "descending",
                  "description": "Feature ordering direction",
                  "pattern": "^(ascending|descending)$",
                  "title": "Direction",
                  "type": "string"
                }
              },
              "title": "CrossSectionalRankParams",
              "type": "object"
            },
            "direction": {
              "default": "descending",
              "description": "Feature ordering direction",
              "pattern": "^(ascending|descending)$",
              "title": "Direction",
              "type": "string"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 3,
              "maxItems": 3
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested CrossSectionalRank signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "EqualWeight",
              "description": "Primitive type identifier for EqualWeight"
            },
            "params": {
              "description": "Parameters for EqualWeight signal.",
              "additionalProperties": false,
              "properties": {
                "rebalance_policy": {
                  "default": "scheduled",
                  "description": "Emit on every scheduled decision or only when selected membership changes",
                  "enum": [
                    "scheduled",
                    "membership_change"
                  ],
                  "title": "Rebalance Policy",
                  "type": "string"
                }
              },
              "title": "EqualWeightParams",
              "type": "object"
            },
            "rebalance_policy": {
              "default": "scheduled",
              "description": "Emit on every scheduled decision or only when selected membership changes",
              "enum": [
                "scheduled",
                "membership_change"
              ],
              "title": "Rebalance Policy",
              "type": "string"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2,
              "maxItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested EqualWeight signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "RebalanceCadence",
              "description": "Primitive type identifier for RebalanceCadence"
            },
            "params": {
              "description": "Parameters for RebalanceCadence signal.",
              "additionalProperties": false,
              "properties": {
                "frequency": {
                  "default": "monthly_first_session",
                  "description": "Portfolio decision-session cadence",
                  "enum": [
                    "daily",
                    "weekly_first_session",
                    "monthly_first_session"
                  ],
                  "title": "Frequency",
                  "type": "string"
                },
                "bootstrap_on_first_session": {
                  "default": true,
                  "description": "For weekly/monthly cadence, act on the first observed Portfolio session when true; when false, wait for the next calendar period. Daily cadence is unaffected.",
                  "title": "Bootstrap On First Session",
                  "type": "boolean"
                }
              },
              "title": "RebalanceCadenceParams",
              "type": "object"
            },
            "frequency": {
              "default": "monthly_first_session",
              "description": "Portfolio decision-session cadence",
              "enum": [
                "daily",
                "weekly_first_session",
                "monthly_first_session"
              ],
              "title": "Frequency",
              "type": "string"
            },
            "bootstrap_on_first_session": {
              "default": true,
              "description": "For weekly/monthly cadence, act on the first observed Portfolio session when true; when false, wait for the next calendar period. Daily cadence is unaffected.",
              "title": "Bootstrap On First Session",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 0,
              "maxItems": 0
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested RebalanceCadence signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "TopN",
              "description": "Primitive type identifier for TopN"
            },
            "params": {
              "description": "Parameters for TopN signal.",
              "additionalProperties": false,
              "properties": {
                "n": {
                  "default": 1,
                  "description": "Maximum selected symbol count",
                  "exclusiveMinimum": 0,
                  "title": "N",
                  "type": "integer"
                }
              },
              "title": "TopNParams",
              "type": "object"
            },
            "n": {
              "default": 1,
              "description": "Maximum selected symbol count",
              "exclusiveMinimum": 0,
              "title": "N",
              "type": "integer"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2,
              "maxItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested TopN signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "And",
              "description": "Primitive type identifier for And"
            },
            "params": {
              "description": "Parameters for logical signal primitives.",
              "additionalProperties": false,
              "properties": {
                "fill_method": {
                  "anyOf": [
                    {
                      "enum": [
                        "ffill",
                        "bfill"
                      ],
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Method to handle NaN values",
                  "title": "Fill Method"
                }
              },
              "title": "LogicalParams",
              "type": "object"
            },
            "fill_method": {
              "anyOf": [
                {
                  "enum": [
                    "ffill",
                    "bfill"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Method to handle NaN values",
              "title": "Fill Method"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested And signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Not",
              "description": "Primitive type identifier for Not"
            },
            "params": {
              "description": "Parameters for Not signal primitive.",
              "additionalProperties": false,
              "properties": {
                "fill_method": {
                  "anyOf": [
                    {
                      "enum": [
                        "ffill",
                        "bfill"
                      ],
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Method to handle NaN values",
                  "title": "Fill Method"
                },
                "preserve_na": {
                  "default": false,
                  "description": "If True, NaN values remain NaN in the output",
                  "title": "Preserve Na",
                  "type": "boolean"
                }
              },
              "title": "NotParams",
              "type": "object"
            },
            "fill_method": {
              "anyOf": [
                {
                  "enum": [
                    "ffill",
                    "bfill"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Method to handle NaN values",
              "title": "Fill Method"
            },
            "preserve_na": {
              "default": false,
              "description": "If True, NaN values remain NaN in the output",
              "title": "Preserve Na",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 1,
              "maxItems": 1
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested Not signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Or",
              "description": "Primitive type identifier for Or"
            },
            "params": {
              "description": "Parameters for logical signal primitives.",
              "additionalProperties": false,
              "properties": {
                "fill_method": {
                  "anyOf": [
                    {
                      "enum": [
                        "ffill",
                        "bfill"
                      ],
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Method to handle NaN values",
                  "title": "Fill Method"
                }
              },
              "title": "LogicalParams",
              "type": "object"
            },
            "fill_method": {
              "anyOf": [
                {
                  "enum": [
                    "ffill",
                    "bfill"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Method to handle NaN values",
              "title": "Fill Method"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested Or signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Add",
              "description": "Primitive type identifier for Add"
            },
            "params": {
              "description": "Parameters for mathematical operation signals.",
              "additionalProperties": false,
              "properties": {
                "operation": {
                  "default": "add",
                  "description": "Type of operation to perform",
                  "enum": [
                    "add",
                    "subtract",
                    "multiply",
                    "divide"
                  ],
                  "title": "Operation",
                  "type": "string"
                },
                "comparison": {
                  "default": "greater",
                  "description": "Type of comparison",
                  "enum": [
                    "greater",
                    "less",
                    "equal",
                    "greater_equal",
                    "less_equal"
                  ],
                  "title": "Comparison",
                  "type": "string"
                },
                "threshold": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Value to compare result against (if not comparing against another series)",
                  "title": "Threshold"
                },
                "absolute": {
                  "default": false,
                  "description": "Whether to take the absolute value of the result before comparison",
                  "title": "Absolute",
                  "type": "boolean"
                },
                "return_calculation": {
                  "default": false,
                  "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
                  "title": "Return Calculation",
                  "type": "boolean"
                }
              },
              "title": "MathOperationParams",
              "type": "object"
            },
            "operation": {
              "default": "add",
              "description": "Type of operation to perform",
              "enum": [
                "add",
                "subtract",
                "multiply",
                "divide"
              ],
              "title": "Operation",
              "type": "string"
            },
            "comparison": {
              "default": "greater",
              "description": "Type of comparison",
              "enum": [
                "greater",
                "less",
                "equal",
                "greater_equal",
                "less_equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "threshold": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Value to compare result against (if not comparing against another series)",
              "title": "Threshold"
            },
            "absolute": {
              "default": false,
              "description": "Whether to take the absolute value of the result before comparison",
              "title": "Absolute",
              "type": "boolean"
            },
            "return_calculation": {
              "default": false,
              "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
              "title": "Return Calculation",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested Add signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Divide",
              "description": "Primitive type identifier for Divide"
            },
            "params": {
              "description": "Parameters for mathematical operation signals.",
              "additionalProperties": false,
              "properties": {
                "operation": {
                  "default": "divide",
                  "description": "Type of operation to perform",
                  "enum": [
                    "add",
                    "subtract",
                    "multiply",
                    "divide"
                  ],
                  "title": "Operation",
                  "type": "string"
                },
                "comparison": {
                  "default": "greater",
                  "description": "Type of comparison",
                  "enum": [
                    "greater",
                    "less",
                    "equal",
                    "greater_equal",
                    "less_equal"
                  ],
                  "title": "Comparison",
                  "type": "string"
                },
                "threshold": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Value to compare result against (if not comparing against another series)",
                  "title": "Threshold"
                },
                "absolute": {
                  "default": false,
                  "description": "Whether to take the absolute value of the result before comparison",
                  "title": "Absolute",
                  "type": "boolean"
                },
                "return_calculation": {
                  "default": false,
                  "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
                  "title": "Return Calculation",
                  "type": "boolean"
                }
              },
              "title": "MathOperationParams",
              "type": "object"
            },
            "operation": {
              "default": "divide",
              "description": "Type of operation to perform",
              "enum": [
                "add",
                "subtract",
                "multiply",
                "divide"
              ],
              "title": "Operation",
              "type": "string"
            },
            "comparison": {
              "default": "greater",
              "description": "Type of comparison",
              "enum": [
                "greater",
                "less",
                "equal",
                "greater_equal",
                "less_equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "threshold": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Value to compare result against (if not comparing against another series)",
              "title": "Threshold"
            },
            "absolute": {
              "default": false,
              "description": "Whether to take the absolute value of the result before comparison",
              "title": "Absolute",
              "type": "boolean"
            },
            "return_calculation": {
              "default": false,
              "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
              "title": "Return Calculation",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested Divide signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Multiply",
              "description": "Primitive type identifier for Multiply"
            },
            "params": {
              "description": "Parameters for mathematical operation signals.",
              "additionalProperties": false,
              "properties": {
                "operation": {
                  "default": "multiply",
                  "description": "Type of operation to perform",
                  "enum": [
                    "add",
                    "subtract",
                    "multiply",
                    "divide"
                  ],
                  "title": "Operation",
                  "type": "string"
                },
                "comparison": {
                  "default": "greater",
                  "description": "Type of comparison",
                  "enum": [
                    "greater",
                    "less",
                    "equal",
                    "greater_equal",
                    "less_equal"
                  ],
                  "title": "Comparison",
                  "type": "string"
                },
                "threshold": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Value to compare result against (if not comparing against another series)",
                  "title": "Threshold"
                },
                "absolute": {
                  "default": false,
                  "description": "Whether to take the absolute value of the result before comparison",
                  "title": "Absolute",
                  "type": "boolean"
                },
                "return_calculation": {
                  "default": false,
                  "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
                  "title": "Return Calculation",
                  "type": "boolean"
                }
              },
              "title": "MathOperationParams",
              "type": "object"
            },
            "operation": {
              "default": "multiply",
              "description": "Type of operation to perform",
              "enum": [
                "add",
                "subtract",
                "multiply",
                "divide"
              ],
              "title": "Operation",
              "type": "string"
            },
            "comparison": {
              "default": "greater",
              "description": "Type of comparison",
              "enum": [
                "greater",
                "less",
                "equal",
                "greater_equal",
                "less_equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "threshold": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Value to compare result against (if not comparing against another series)",
              "title": "Threshold"
            },
            "absolute": {
              "default": false,
              "description": "Whether to take the absolute value of the result before comparison",
              "title": "Absolute",
              "type": "boolean"
            },
            "return_calculation": {
              "default": false,
              "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
              "title": "Return Calculation",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested Multiply signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Subtract",
              "description": "Primitive type identifier for Subtract"
            },
            "params": {
              "description": "Parameters for mathematical operation signals.",
              "additionalProperties": false,
              "properties": {
                "operation": {
                  "default": "subtract",
                  "description": "Type of operation to perform",
                  "enum": [
                    "add",
                    "subtract",
                    "multiply",
                    "divide"
                  ],
                  "title": "Operation",
                  "type": "string"
                },
                "comparison": {
                  "default": "greater",
                  "description": "Type of comparison",
                  "enum": [
                    "greater",
                    "less",
                    "equal",
                    "greater_equal",
                    "less_equal"
                  ],
                  "title": "Comparison",
                  "type": "string"
                },
                "threshold": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Value to compare result against (if not comparing against another series)",
                  "title": "Threshold"
                },
                "absolute": {
                  "default": false,
                  "description": "Whether to take the absolute value of the result before comparison",
                  "title": "Absolute",
                  "type": "boolean"
                },
                "return_calculation": {
                  "default": false,
                  "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
                  "title": "Return Calculation",
                  "type": "boolean"
                }
              },
              "title": "MathOperationParams",
              "type": "object"
            },
            "operation": {
              "default": "subtract",
              "description": "Type of operation to perform",
              "enum": [
                "add",
                "subtract",
                "multiply",
                "divide"
              ],
              "title": "Operation",
              "type": "string"
            },
            "comparison": {
              "default": "greater",
              "description": "Type of comparison",
              "enum": [
                "greater",
                "less",
                "equal",
                "greater_equal",
                "less_equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "threshold": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Value to compare result against (if not comparing against another series)",
              "title": "Threshold"
            },
            "absolute": {
              "default": false,
              "description": "Whether to take the absolute value of the result before comparison",
              "title": "Absolute",
              "type": "boolean"
            },
            "return_calculation": {
              "default": false,
              "description": "If True, return the numeric calculation result instead of boolean comparison result. Supports multiple operands.",
              "title": "Return Calculation",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 2
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested Subtract signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "PercentChange",
              "description": "Primitive type identifier for PercentChange"
            },
            "params": {
              "description": "Parameters for PercentChange signal.",
              "additionalProperties": false,
              "properties": {
                "periods": {
                  "default": 1,
                  "description": "Number of periods to calculate change over",
                  "exclusiveMinimum": 0,
                  "title": "Periods",
                  "type": "integer"
                },
                "threshold": {
                  "default": 0,
                  "description": "Value to compare percent change against",
                  "title": "Threshold",
                  "type": "number"
                },
                "comparison": {
                  "default": "greater",
                  "description": "Comparison type",
                  "enum": [
                    "greater",
                    "less",
                    "equal"
                  ],
                  "title": "Comparison",
                  "type": "string"
                },
                "is_absolute": {
                  "default": false,
                  "description": "Whether to use absolute value of percent change",
                  "title": "Is Absolute",
                  "type": "boolean"
                }
              },
              "title": "PercentChangeParams",
              "type": "object"
            },
            "periods": {
              "default": 1,
              "description": "Number of periods to calculate change over",
              "exclusiveMinimum": 0,
              "title": "Periods",
              "type": "integer"
            },
            "threshold": {
              "default": 0,
              "description": "Value to compare percent change against",
              "title": "Threshold",
              "type": "number"
            },
            "comparison": {
              "default": "greater",
              "description": "Comparison type",
              "enum": [
                "greater",
                "less",
                "equal"
              ],
              "title": "Comparison",
              "type": "string"
            },
            "is_absolute": {
              "default": false,
              "description": "Whether to use absolute value of percent change",
              "title": "Is Absolute",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 1
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested PercentChange signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Streak",
              "description": "Primitive type identifier for Streak"
            },
            "params": {
              "description": "Parameters for Streak pattern detection.",
              "additionalProperties": false,
              "properties": {
                "min_length": {
                  "default": 2,
                  "description": "Minimum number of consecutive occurrences required",
                  "exclusiveMinimum": 0,
                  "title": "Min Length",
                  "type": "integer"
                },
                "max_length": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Maximum number of consecutive occurrences to consider",
                  "title": "Max Length"
                },
                "match_type": {
                  "default": "true",
                  "description": "Type of streak to detect",
                  "enum": [
                    "true",
                    "false",
                    "any"
                  ],
                  "title": "Match Type",
                  "type": "string"
                }
              },
              "title": "StreakParams",
              "type": "object"
            },
            "min_length": {
              "default": 2,
              "description": "Minimum number of consecutive occurrences required",
              "exclusiveMinimum": 0,
              "title": "Min Length",
              "type": "integer"
            },
            "max_length": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Maximum number of consecutive occurrences to consider",
              "title": "Max Length"
            },
            "match_type": {
              "default": "true",
              "description": "Type of streak to detect",
              "enum": [
                "true",
                "false",
                "any"
              ],
              "title": "Match Type",
              "type": "string"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 1
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested Streak signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "StockBondSwitch",
              "description": "Primitive type identifier for StockBondSwitch"
            },
            "params": {
              "description": "Parameters for StockBondSwitch signal.",
              "additionalProperties": false,
              "properties": {
                "default_to_stock": {
                  "default": true,
                  "description": "Whether to default to stock when condition is unavailable",
                  "title": "Default To Stock",
                  "type": "boolean"
                }
              },
              "title": "StockBondSwitchParams",
              "type": "object"
            },
            "default_to_stock": {
              "default": true,
              "description": "Whether to default to stock when condition is unavailable",
              "title": "Default To Stock",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 1
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested StockBondSwitch signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Lag",
              "description": "Primitive type identifier for Lag"
            },
            "params": {
              "description": "Parameters for Lag signal primitive.",
              "additionalProperties": false,
              "properties": {
                "periods": {
                  "default": 1,
                  "description": "Number of periods to shift. Positive values shift forward (look back at past values).",
                  "minimum": 0,
                  "title": "Periods",
                  "type": "integer"
                },
                "fill_value": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Value to use for filling NaN positions created by the shift. For boolean series, use 0 (False) or 1 (True). None keeps NaN.",
                  "title": "Fill Value"
                }
              },
              "title": "LagParams",
              "type": "object"
            },
            "periods": {
              "default": 1,
              "description": "Number of periods to shift. Positive values shift forward (look back at past values).",
              "minimum": 0,
              "title": "Periods",
              "type": "integer"
            },
            "fill_value": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Value to use for filling NaN positions created by the shift. For boolean series, use 0 (False) or 1 (True). None keeps NaN.",
              "title": "Fill Value"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 1
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested Lag signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "ConditionalWeight",
              "description": "Primitive type identifier for ConditionalWeight"
            },
            "params": {
              "description": "Parameters for ConditionalWeight primitive.",
              "additionalProperties": false,
              "properties": {
                "true_weight": {
                  "description": "条件为True时的权重",
                  "maximum": 1,
                  "minimum": 0,
                  "title": "True Weight",
                  "type": "number"
                },
                "false_weight": {
                  "description": "条件为False时的权重",
                  "maximum": 1,
                  "minimum": 0,
                  "title": "False Weight",
                  "type": "number"
                }
              },
              "required": [
                "true_weight",
                "false_weight"
              ],
              "title": "ConditionalWeightParams",
              "type": "object"
            },
            "true_weight": {
              "description": "条件为True时的权重",
              "maximum": 1,
              "minimum": 0,
              "title": "True Weight",
              "type": "number"
            },
            "false_weight": {
              "description": "条件为False时的权重",
              "maximum": 1,
              "minimum": 0,
              "title": "False Weight",
              "type": "number"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 1
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested ConditionalWeight signal (id optional)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "LinearScaleWeight",
              "description": "Primitive type identifier for LinearScaleWeight"
            },
            "params": {
              "description": "Parameters for LinearScaleWeight primitive.",
              "additionalProperties": false,
              "properties": {
                "min_indicator": {
                  "description": "指标最小值",
                  "title": "Min Indicator",
                  "type": "number"
                },
                "max_indicator": {
                  "description": "指标最大值",
                  "title": "Max Indicator",
                  "type": "number"
                },
                "min_weight": {
                  "description": "映射到的最小权重",
                  "maximum": 1,
                  "minimum": 0,
                  "title": "Min Weight",
                  "type": "number"
                },
                "max_weight": {
                  "description": "映射到的最大权重",
                  "maximum": 1,
                  "minimum": 0,
                  "title": "Max Weight",
                  "type": "number"
                },
                "clip": {
                  "default": true,
                  "description": "是否裁剪超出范围的值",
                  "title": "Clip",
                  "type": "boolean"
                }
              },
              "required": [
                "min_indicator",
                "max_indicator",
                "min_weight",
                "max_weight"
              ],
              "title": "LinearScaleWeightParams",
              "type": "object"
            },
            "min_indicator": {
              "description": "指标最小值",
              "title": "Min Indicator",
              "type": "number"
            },
            "max_indicator": {
              "description": "指标最大值",
              "title": "Max Indicator",
              "type": "number"
            },
            "min_weight": {
              "description": "映射到的最小权重",
              "maximum": 1,
              "minimum": 0,
              "title": "Min Weight",
              "type": "number"
            },
            "max_weight": {
              "description": "映射到的最大权重",
              "maximum": 1,
              "minimum": 0,
              "title": "Max Weight",
              "type": "number"
            },
            "clip": {
              "default": true,
              "description": "是否裁剪超出范围的值",
              "title": "Clip",
              "type": "boolean"
            },
            "inputs": {
              "type": "array",
              "description": "Input references for the signal",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ref": {
                        "type": "string",
                        "description": "Reference to another indicator or signal ID"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "type": "string",
                        "description": "Reference to a data column (e.g., 'Close', 'Volume')"
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "market": {
                        "type": "string",
                        "description": "Reference to market indicator code"
                      },
                      "transformer": {
                        "type": "string",
                        "description": "Reference to transformer name"
                      }
                    },
                    "required": [
                      "market",
                      "transformer"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "number",
                        "description": "Canonical bare numeric literal value"
                      }
                    },
                    "required": [
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of constant value"
                      },
                      "value": {
                        "type": "number",
                        "description": "Constant numeric value"
                      }
                    },
                    "required": [
                      "type",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "$ref": "#/definitions/AnyNestedSignal",
                    "description": "Nested signal definition"
                  }
                ]
              },
              "minItems": 1
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": true,
          "description": "Nested LinearScaleWeight signal (id optional)"
        }
      ],
      "description": "Any supported signal primitive for nested use (id optional)"
    },
    "AnyMarketTransformer": {
      "oneOf": [
        {
          "$ref": "#/definitions/ChandelierExitTransformer"
        },
        {
          "$ref": "#/definitions/IdentityTransformer"
        },
        {
          "$ref": "#/definitions/MovingAverageTransformer"
        },
        {
          "$ref": "#/definitions/PercentileRankTransformer"
        },
        {
          "$ref": "#/definitions/RSITransformer"
        },
        {
          "$ref": "#/definitions/RelativeStrengthTransformer"
        },
        {
          "$ref": "#/definitions/ZScoreTransformer"
        }
      ],
      "description": "Any supported market transformer primitive"
    },
    "AnyCapitalStrategy": {
      "oneOf": [
        {
          "$ref": "#/definitions/CashSweepPercentCapitalStrategy"
        },
        {
          "$ref": "#/definitions/FixedInvestmentStrategy"
        },
        {
          "$ref": "#/definitions/PercentCapitalStrategy"
        },
        {
          "$ref": "#/definitions/ProportionalCapitalStrategy"
        },
        {
          "$ref": "#/definitions/RebalancingCapitalStrategy"
        },
        {
          "$ref": "#/definitions/SimplePercentCapitalStrategy"
        }
      ],
      "description": "Any supported capital strategy primitive"
    },
    "FundamentalInputsBody": {
      "type": "object",
      "properties": {
        "metrics": {
          "type": "array",
          "description": "需要加载的基本面指标列表",
          "items": {
            "type": "string",
            "enum": [
              "roe",
              "pe_ttm",
              "revenue_yoy",
              "operating_cashflow",
              "debt_ratio"
            ]
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "frequency": {
          "type": "string",
          "enum": [
            "daily",
            "quarterly"
          ],
          "default": "daily",
          "description": "基本面时间序列频率"
        },
        "point_in_time": {
          "type": "boolean",
          "default": true,
          "description": "是否按公告日进行PIT对齐"
        },
        "max_staleness_days": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "default": 120,
          "description": "允许的最大陈旧天数，超出后置空"
        },
        "include_metadata": {
          "type": "boolean",
          "default": false,
          "description": "是否保留上游返回的元数据"
        }
      },
      "required": [
        "metrics"
      ],
      "additionalProperties": false,
      "description": "基本面输入定义"
    },
    "TradeStrategyBody": {
      "type": "object",
      "properties": {
        "indicators": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AnyIndicator"
          },
          "description": "指标定义列表"
        },
        "signals": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AnySignal"
          },
          "description": "信号定义列表"
        },
        "outputs": {
          "type": "object",
          "properties": {
            "buy_signal": {
              "type": "string",
              "description": "引用一个已定义的信号ID作为买入信号"
            },
            "sell_signal": {
              "type": "string",
              "description": "引用一个已定义的信号ID作为卖出信号"
            },
            "target_weight": {
              "type": "string",
              "description": "（可选）引用一个已定义的权重信号ID作为目标仓位权重。用于动态仓位场景（如LinearScaleWeight、ConditionalWeight等）。非动态仓位策略不需要此字段"
            },
            "indicators": {
              "type": "array",
              "description": "（可选）指定需要额外输出的指标或信号值及其在回测结果中的名称",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "引用的指标或信号的ID"
                  },
                  "output_name": {
                    "type": "string",
                    "description": "在结果中显示的名称"
                  }
                },
                "required": [
                  "id",
                  "output_name"
                ],
                "additionalProperties": false
              }
            },
            "market_indicators": {
              "type": "array",
              "description": "（可选）指定需要额外输出的市场指标及其在回测结果中的名称",
              "items": {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "引用的市场指标代码"
                  },
                  "transformer": {
                    "type": "string",
                    "description": "引用的转换器名称"
                  },
                  "output_name": {
                    "type": "string",
                    "description": "在结果中显示的名称"
                  }
                },
                "required": [
                  "market",
                  "transformer",
                  "output_name"
                ],
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false,
          "description": "定义最终的买入和卖出信号，以及可选的额外输出指标。普通交易策略必须提供 buy_signal/sell_signal；使用 portfolio_construction 时应为空对象。"
        }
      },
      "required": [
        "indicators",
        "signals",
        "outputs"
      ],
      "additionalProperties": false,
      "description": "交易策略定义结构"
    },
    "MarketIndicatorsBody": {
      "type": "object",
      "properties": {
        "indicators": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "外部市场指标的代码 (例如 VIX)"
              },
              "source": {
                "type": "string",
                "description": "(可选) 数据源标识"
              }
            },
            "required": [
              "code"
            ],
            "additionalProperties": false
          },
          "description": "声明需要追踪的外部市场指标列表"
        },
        "transformers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AnyMarketTransformer"
          },
          "description": "定义如何转换这些外部指标数据"
        }
      },
      "required": [
        "indicators",
        "transformers"
      ],
      "additionalProperties": false,
      "description": "市场指标定义结构"
    },
    "PortfolioConstructionBody": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "TargetAllocation"
          ],
          "description": "Portfolio Construction 类型。第一版仅支持 TargetAllocation：固定 traded asset + 作者权重 + 可选布尔 permission。"
        },
        "allocations": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "properties": {
              "symbol": {
                "type": "string",
                "description": "必须属于顶层 symbols[] 中的某个 traded symbol"
              },
              "weight": {
                "type": "number",
                "minimum": 0,
                "description": "该资产的最终 executable target weight（不再乘以 gross_exposure）。与 target_signal 二选一，必须且只能提供其中一个（静态权重）。"
              },
              "target_signal": {
                "type": "string",
                "description": "（Blueprint #156 Dynamic Target Exposure）引用 trade_strategy.signals[] 中某个 \"weight\" 输出类型信号的 id（例如 ConditionalWeight、LinearScaleWeight），作为该资产逐 session 的动态 target weight 来源。与 weight 二选一，必须且只能提供其中一个（动态权重）。取值范围 [0,1]；raw 值经过标准 standing-series -> actionable-emission 判定后才会成为新的整体 re-level 触发条件之一（与 enabled_by 翻转、scheduled relevel 共同复用同一次 whole_vector_relevel 决策，不是并行的第二套 runtime）。"
              },
              "enabled_by": {
                "type": "string",
                "description": "（可选）引用 trade_strategy.signals[] 中某个布尔信号的 id 作为 permission。该信号可以引用 market_indicators 中的外部 symbol（不占用 traded symbols[] 数量上限）。省略时该资产始终 enabled。"
              },
              "direction": {
                "type": "string",
                "enum": [
                  "both",
                  "increase_only",
                  "decrease_only"
                ],
                "default": "both",
                "description": "（Blueprint #156 Directional Rebalance，可选，默认 both）Capital Request 层的方向性纪律：both=正常向 ideal target 双向 reconcile；increase_only=仅当 ideal > 当前 model weight 时才 reconcile，否则 HOLD_CURRENT（不会向下削减已经偏高的仓位）；decrease_only=仅当 ideal < 当前 model weight 时才 reconcile，否则 HOLD_CURRENT（不会向上买入使仓位更接近/超过 ideal）。HOLD_CURRENT 时该 leg 不产生任何订单，但 ideal target 本身作为 strategy/construction truth 不会被当前 realized weight 覆盖。decrease_only 从 0 仓位冷启动时会永远停留在 HOLD_CURRENT(0)（因为 ideal 不会小于 0），这是该方向性语义下预期且正确的行为，不是缺陷。"
              },
              "staged_deployment": {
                "type": "object",
                "description": "（Blueprint #156 PR2 Bounded Stateful Staged Deployment，可选）以 weight 作为上限（ceiling），按声明的 drawdown levels 分批、有界地逼近该上限，而不是在任一 actionable session 直接跳到上限。要求 weight（不能与 target_signal 同时使用）且 direction 必须显式为 decrease_only（唯一能与 staged 触发安全组合的基础 disposition：非 staged 触发的 actionable session 上，decrease_only 只会在当前仓位高于 ceiling 时下修，绝不会把仓位直接拉到 ceiling）。Engine 仅保留三类有界状态（cycle identity、frozen anchor、used levels），不支持任意可变状态。",
                "properties": {
                  "levels": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "exclusiveMaximum": 1
                    },
                    "description": "严格递增、去重的 drawdown 幅度序列（例如 [0.15, 0.25, 0.35] 表示相对 anchor 下跌 15%/25%/35%）。一个 cycle 内每个 level 只能触发一次部署；rebound 不会撤销已触发的部署；同一 session 内 gap 跌破多个新 level 时，全部按当次一并计入。"
                  },
                  "unit": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "每新触发一个 level 部署的有界单位（占组合总 NAV 的百分点，例如 0.025 = 2.5pp）。不能超过该 leg 自身的 weight 上限。"
                  },
                  "anchor_lookback_sessions": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "description": "计算 rolling-high anchor 参考值的回看 session 数。decision window 起点之前的历史数据可用于该 anchor 的 as-of 初始化（warmup），但不会让 cycle/used levels/frozen anchor 提前消费到请求窗口之前。"
                  },
                  "gate": {
                    "type": "string",
                    "description": "引用 trade_strategy.signals[] 中某个布尔信号的 id，作为 staged deployment 自身的 armed/reset gate（与 enabled_by 是两个独立概念：enabled_by 翻转会把该 leg 的 ideal target 直接清零，而此 gate 关闭只会结束当前 staged cycle——清空 used levels、解冻 anchor——不会改变该 leg 自身的 ideal target）。必填，无隐藏默认值。"
                  },
                  "reset_on_new_high": {
                    "type": "boolean",
                    "description": "必填，无隐藏默认值。为 true 时，若 frozen anchor 已存在且出现真正超过它的新高，则视为该 cycle 结束、开启新 cycle（用于表达'反弹超过前高即视为已恢复，之前的部署阶梯作废重来'的语义）。为 false 时 anchor 在 cycle 内永久保持 frozen，仅 gate 关闭才会重置。"
                  }
                },
                "required": [
                  "levels",
                  "unit",
                  "anchor_lookback_sessions",
                  "gate",
                  "reset_on_new_high"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "symbol"
            ],
            "additionalProperties": false,
            "oneOf": [
              {
                "required": [
                  "weight"
                ],
                "not": {
                  "required": [
                    "target_signal"
                  ]
                }
              },
              {
                "required": [
                  "target_signal"
                ],
                "not": {
                  "required": [
                    "weight"
                  ]
                }
              }
            ],
            "allOf": [
              {
                "if": {
                  "required": [
                    "staged_deployment"
                  ]
                },
                "then": {
                  "required": [
                    "weight",
                    "direction"
                  ],
                  "properties": {
                    "direction": {
                      "const": "decrease_only"
                    }
                  }
                }
              }
            ]
          },
          "description": "每个 traded asset 的 authored target weight（静态 weight 或动态 target_signal 二选一，恰好提供一个，由 oneOf 强制）与可选 permission/direction/staged_deployment；所有静态 allocation 的 weight 之和必须 <= 1.0，剩余部分为 residual cash（含动态 leg 时该上限由运行时 sum<=gross_exposure 校验保证）"
        },
        "rebalance": {
          "type": "object",
          "properties": {
            "frequency": {
              "type": "string",
              "enum": [
                "none",
                "monthly",
                "quarterly"
              ],
              "description": "必填，无隐藏默认值。none=仅在任一 allocation 的 permission 翻转时整体 re-level（其余时间 hold-and-drift）；monthly/quarterly=在 permission 翻转之外，额外按周期整体 re-level。"
            }
          },
          "required": [
            "frequency"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "type",
        "allocations",
        "rebalance"
      ],
      "additionalProperties": false,
      "description": "Generic Fixed Target Allocation：固定资产 + 作者权重 + 可选布尔 permission -> 一个完整 TargetPortfolioTimeline，复用现有 target-weight 原子执行路径。permission 翻转或到期 rebalance 都会把整个当前 enabled 资产恢复到各自 authored weight（而不是只调整发生变化的资产，也不参考 realized/drifted 权重）。"
    },
    "StrategyDefinitionForAI": {
      "type": "object",
      "properties": {
        "market_indicators": {
          "$ref": "#/definitions/MarketIndicatorsBody",
          "description": "市场指标定义（可选）"
        },
        "fundamental_inputs": {
          "$ref": "#/definitions/FundamentalInputsBody",
          "description": "基本面输入定义（可选）"
        },
        "reset_signal_state_at_start": {
          "type": "boolean",
          "default": false,
          "description": "已废弃，仅为向后兼容保留解析：在当前无条件的 canonical 决策窗口语义下（ISS#155），决策状态机总是在请求窗口起点重新 bootstrap，此字段不再改变任何行为，是一个 no-op"
        },
        "trade_strategy": {
          "$ref": "#/definitions/TradeStrategyBody",
          "description": "交易策略定义（指标、信号、输出）。使用 portfolio_construction 时仍然必填，用于承载 enabled_by 引用的 permission 信号；无 permission 时可以是空的 indicators/signals 数组。"
        },
        "portfolio_construction": {
          "$ref": "#/definitions/PortfolioConstructionBody",
          "description": "（可选）Generic Portfolio Construction 定义，例如 TargetAllocation。存在时，实际的目标权重由此块产生，而不是 trade_strategy.outputs.target_weight。"
        }
      },
      "required": [
        "trade_strategy"
      ],
      "additionalProperties": false,
      "description": "用于AI生成交易策略和市场指标（可选）的结构。资金策略将由用户另外指定。",
      "if": {
        "required": [
          "portfolio_construction"
        ]
      },
      "then": {
        "properties": {
          "trade_strategy": {
            "properties": {
              "outputs": {
                "maxProperties": 0
              }
            }
          }
        }
      },
      "else": {
        "properties": {
          "trade_strategy": {
            "properties": {
              "outputs": {
                "required": [
                  "buy_signal",
                  "sell_signal"
                ]
              }
            }
          }
        }
      }
    }
  }
}
