{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/quantifyme-ai/json-schema/quantifyme-ai-from-template-request-schema.json",
  "title": "FromTemplateRequest",
  "description": "Each text field (description, features, signals, model, optimization, risk, risk_function) holds at most 4,000 characters, and all of them together at most 8,000. A longer request is refused with 400 {error: prompt_too_long, field, limit, length, message} before anything is charged.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/quantifyme-ai-openapi.json#/components/schemas/FromTemplateRequest",
  "properties": {
    "aux_feeds": {
      "$ref": "#/$defs/AuxFeeds"
    },
    "claude_model": {
      "type": "string"
    },
    "end_date": {
      "format": "date",
      "type": "string"
    },
    "indicators": {
      "$ref": "#/$defs/Indicators"
    },
    "model": {
      "maxLength": 4000,
      "type": "string"
    },
    "pos_rules": {
      "$ref": "#/$defs/PosRules"
    },
    "start_date": {
      "format": "date",
      "type": "string"
    },
    "symbol": {
      "default": "EURUSD",
      "enum": [
        "EURUSD",
        "GBPUSD",
        "USDJPY",
        "USDCHF",
        "AUDUSD",
        "NZDUSD",
        "USDCAD",
        "BTCUSD"
      ],
      "type": "string"
    },
    "template": {
      "enum": [
        "macd_momentum",
        "mean_reversion",
        "trend_following",
        "scalper",
        "conservative_long"
      ],
      "type": "string"
    },
    "timeframe": {
      "default": "15min",
      "enum": [
        "1min",
        "5min",
        "15min",
        "1h"
      ],
      "type": "string"
    },
    "train_split": {
      "type": "number"
    }
  },
  "required": [
    "template"
  ],
  "type": "object",
  "$defs": {
    "AuxFeeds": {
      "description": "Extra (symbol, timeframe) feeds merged into the strategy's features as aux_* columns. Max 3; must differ from the primary.",
      "items": {
        "properties": {
          "symbol": {
            "enum": [
              "EURUSD",
              "GBPUSD",
              "USDJPY",
              "USDCHF",
              "AUDUSD",
              "NZDUSD",
              "USDCAD",
              "BTCUSD"
            ],
            "type": "string"
          },
          "timeframe": {
            "enum": [
              "1min",
              "5min",
              "15min",
              "1h"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "maxItems": 3,
      "type": "array"
    },
    "Indicators": {
      "additionalProperties": true,
      "description": "Flat indicator config. See GET /api/v1/indicator-schema for full param list.",
      "properties": {},
      "type": "object"
    },
    "PosRules": {
      "properties": {
        "cooldown": {
          "type": "integer"
        },
        "direction": {
          "enum": [
            "both",
            "long",
            "short"
          ],
          "type": "string"
        },
        "max_pos": {
          "type": "integer"
        },
        "on_opposite": {
          "enum": [
            "reverse",
            "close_only",
            "ignore"
          ],
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}