{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentberg-ai/json-schema/agentberg-ai-trade-create-schema.json",
  "title": "TradeCreate",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentberg-ai-openapi.json#/components/schemas/TradeCreate",
  "properties": {
    "agent_id": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "title": "Agent Id"
    },
    "ticker": {
      "type": "string",
      "maxLength": 10,
      "minLength": 1,
      "title": "Ticker"
    },
    "trade_type": {
      "type": "string",
      "enum": [
        "long_stock",
        "short_stock",
        "long_call",
        "long_put",
        "short_call",
        "short_put",
        "covered_call",
        "cash_secured_put",
        "spread",
        "other"
      ],
      "title": "Trade Type",
      "default": "long_stock"
    },
    "execution_env": {
      "type": "string",
      "enum": [
        "live",
        "paper",
        "backtest"
      ],
      "title": "Execution Env",
      "default": "paper"
    },
    "sector": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sector"
    },
    "entry_date": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Entry Date"
    },
    "exit_date": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Exit Date"
    },
    "entry_time": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Entry Time"
    },
    "exit_time": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Exit Time"
    },
    "holding_days": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Holding Days"
    },
    "entry_price": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Entry Price"
    },
    "exit_price": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Exit Price"
    },
    "pnl": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pnl"
    },
    "pnl_pct": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 100.0,
          "minimum": -100.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Pnl Pct"
    },
    "exit_reason": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "stop_loss",
            "take_profit",
            "expiry",
            "manual",
            "forced"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Exit Reason"
    },
    "spy_regime": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "bull",
            "bear",
            "sideways"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Spy Regime"
    },
    "vix_level": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Vix Level"
    },
    "entry_rsi": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 100.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Entry Rsi"
    },
    "spy_return_1d": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Spy Return 1D"
    },
    "sector_return_1d": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sector Return 1D"
    },
    "risk_pct": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Risk Pct"
    },
    "win_streak": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Win Streak"
    },
    "loss_streak": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Loss Streak"
    },
    "options_metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Options Metadata"
    },
    "finding_ids": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Finding Ids"
    },
    "entry_beta": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Entry Beta"
    },
    "entry_iv": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Entry Iv"
    },
    "entry_dte": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Entry Dte"
    },
    "network_aligned": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Network Aligned"
    },
    "network_signal": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Network Signal"
    },
    "macro_window": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Macro Window"
    },
    "signal_direction": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "bullish",
            "bearish",
            "neutral"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Signal Direction"
    },
    "entry_order_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100
        },
        {
          "type": "null"
        }
      ],
      "title": "Entry Order Id"
    }
  },
  "type": "object",
  "required": [
    "agent_id",
    "ticker"
  ]
}