{
  "notice": "bxzxxr MCP archive: a record of what public MCP servers declared when we listed them (we never call their tools). It is data, not a rating: nothing here says a server is safe, secure, verified or trustworthy, and a server can change after we looked. Secrets we detected are redacted; redacted tool lists are withheld and only their hash is shown.",
  "infrastructure": {
    "host": "backtester.daenadigital.com",
    "site": "daenadigital.com",
    "addresses": [
      {
        "address": "172.67.141.125",
        "endpoints": 1,
        "shared_infrastructure": false,
        "network": {
          "asn": 13335,
          "name": "CLOUDFLARENET - Cloudflare, Inc.",
          "prefix": "172.67.128.0/20",
          "country": "US"
        }
      },
      {
        "address": "104.21.94.235",
        "endpoints": 1,
        "shared_infrastructure": false,
        "network": {
          "asn": 13335,
          "name": "CLOUDFLARENET - Cloudflare, Inc.",
          "prefix": "104.21.64.0/19",
          "country": "US"
        }
      },
      {
        "address": "2606:4700:3030::6815:5eeb",
        "endpoints": 1,
        "shared_infrastructure": false,
        "network": {
          "asn": 13335,
          "prefix": "2606:4700:3030::/48",
          "country": "US",
          "name": "CLOUDFLARENET - Cloudflare, Inc."
        }
      },
      {
        "address": "2606:4700:3035::ac43:8d7d",
        "endpoints": 1,
        "shared_infrastructure": false,
        "network": {
          "asn": 13335,
          "name": "CLOUDFLARENET - Cloudflare, Inc.",
          "prefix": "2606:4700:3035::/48",
          "country": "US"
        }
      }
    ],
    "addresses_recorded": true,
    "address_history": [
      {
        "addresses": [
          "172.67.141.125",
          "104.21.94.235",
          "2606:4700:3030::6815:5eeb",
          "2606:4700:3035::ac43:8d7d"
        ],
        "first_seen": "2026-11-21T16:27:02.054Z",
        "last_seen": "2026-11-21T16:27:02.054Z",
        "checks": 1
      }
    ],
    "hosting": [
      {
        "value": "Cloudflare",
        "evidence": "Server header \"cloudflare\""
      }
    ],
    "software": [],
    "server_info": {
      "name": "backtester",
      "version": "2.1.0",
      "protocol_version": "2025-06-18"
    },
    "headers": {
      "server": "cloudflare"
    },
    "auth": null
  },
  "related": {
    "same_address": {
      "total": 0,
      "sample": []
    },
    "same_site": {
      "total": 0,
      "sample": []
    },
    "same_tool_list": {
      "total": 0,
      "sample": []
    },
    "same_publisher": {
      "publisher": "io.github.morshedgit",
      "total": 0,
      "sample": []
    },
    "same_repository": null,
    "note": "Shared addresses on big platforms (Cloudflare, Vercel and the like) put unrelated servers together; those are marked shared_infrastructure. A match is a pivot, not a link between operators."
  },
  "endpoint": {
    "id": "33246",
    "server_name": "io.github.morshedgit/backtester",
    "url": "https://backtester.daenadigital.com/mcp",
    "host": "backtester.daenadigital.com",
    "transport": "streamable-http",
    "last_checked_at": "2026-11-21T16:27:02.054Z",
    "last_state": "listed",
    "last_detail": null,
    "consecutive_failures": 0,
    "current_sha": "ffb78556ccb5e94c13303ccb1cf5c22dc022d5cfab092aa3248ce11d9c4f5b01",
    "first_listed_at": "2026-11-21T16:27:02.054Z",
    "created_at": "2026-11-21T10:35:04.361Z",
    "resolved_addresses": [
      "172.67.141.125",
      "104.21.94.235",
      "2606:4700:3030::6815:5eeb",
      "2606:4700:3035::ac43:8d7d"
    ]
  },
  "server": {
    "name": "io.github.morshedgit/backtester",
    "title": "Backtester",
    "description": "Test a plain-words trading rule on historical prices and compare the trades with SPY. Not advice.",
    "version": "1.0.0",
    "registry_status": "active",
    "repository_url": null,
    "website_url": null,
    "published_at": "2026-11-08T19:57:44.357Z",
    "updated_at": "2026-11-08T19:57:44.357Z",
    "first_seen": "2026-11-21T10:35:03.890Z"
  },
  "other_endpoints": [],
  "intel": {
    "capabilities": [],
    "evm_addresses": [],
    "chains": [],
    "tokens": [],
    "computed_at": "2026-11-22T15:46:07.931Z"
  },
  "operator": null,
  "needs_sign_in": false,
  "reachability": {
    "window_days": 30,
    "checks": 1,
    "answered": 1,
    "answered_percent": 100,
    "avg_listing_latency_ms": 473,
    "first_check_in_window": "2026-11-21T16:27:02.054Z",
    "consecutive_failures_now": 0,
    "days": [
      {
        "day": "2026-11-21",
        "checks": 1,
        "answered": 1,
        "last_state": "listed"
      }
    ]
  },
  "tool_list": {
    "sha256": "ffb78556ccb5e94c13303ccb1cf5c22dc022d5cfab092aa3248ce11d9c4f5b01",
    "tools": 9,
    "resources": 2,
    "prompts": 0,
    "first_seen": "2026-11-21T16:27:02.529Z",
    "tool_names": [
      "list_data",
      "get_prices",
      "build_series",
      "build_signal",
      "simulate",
      "report",
      "share_report",
      "list_strategies",
      "save_strategy"
    ],
    "declared": {
      "tools": [
        {
          "name": "list_data",
          "title": "List available data",
          "description": "List available price data, fields, dates, limits, and whether reports can be retained for publishing.",
          "inputSchema": {
            "type": "object",
            "properties": {},
            "additionalProperties": false
          },
          "annotations": {
            "readOnlyHint": true
          }
        },
        {
          "name": "get_prices",
          "title": "Get historical prices",
          "description": "Read historical prices for a run form. Needs only version and data.",
          "inputSchema": {
            "type": "object",
            "required": [
              "run"
            ],
            "properties": {
              "run": {
                "type": "object",
                "$schema": "http://json-schema.org/draft-07/schema#",
                "required": [
                  "version",
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": [
                      "tickers",
                      "start",
                      "end",
                      "source"
                    ],
                    "properties": {
                      "end": {
                        "type": "string"
                      },
                      "start": {
                        "type": "string"
                      },
                      "source": {
                        "enum": [
                          "price-api",
                          "intraday-api"
                        ],
                        "type": "string"
                      },
                      "tickers": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                        },
                        "minItems": 1
                      },
                      "interval": {
                        "enum": [
                          "1min",
                          "5min",
                          "15min",
                          "30min",
                          "1hour"
                        ],
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  "money": {
                    "type": "object",
                    "required": [
                      "capital"
                    ],
                    "properties": {
                      "capital": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "benchmark": {
                        "type": "string",
                        "const": "SPY",
                        "default": "SPY"
                      }
                    },
                    "additionalProperties": false
                  },
                  "series": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "ticker",
                            "field",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "price"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "field": {
                              "enum": [
                                "open",
                                "high",
                                "low",
                                "close",
                                "volume"
                              ],
                              "type": "string"
                            },
                            "ticker": {
                              "type": "string",
                              "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "points",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "observations"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "points": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "observedAt",
                                  "knownAt",
                                  "value"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "number"
                                  },
                                  "knownAt": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "observedAt": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "minItems": 1
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "agg",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "session"
                            },
                            "agg": {
                              "enum": [
                                "sum",
                                "high",
                                "low",
                                "first"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "bars": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "description": "Running sum, high, low, or first value since the session start. With bars, only the first bars of each session count; the value is null until they finish, then held for the rest of the session.",
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "lag"
                            },
                            "lag": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "window",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "average",
                                "high",
                                "low",
                                "sum",
                                "change",
                                "stddev"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "window": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "window",
                            "alpha",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "smooth"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "alpha": {
                              "type": "number",
                              "maximum": 1,
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "window": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "left",
                            "right",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "add",
                                "subtract",
                                "multiply",
                                "ratio",
                                "min",
                                "max"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "left": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "right": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "peers",
                            "order",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "rank"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "order": {
                              "enum": [
                                "ascending",
                                "descending"
                              ],
                              "type": "string"
                            },
                            "peers": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                              },
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "price",
                            "direction",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "ratchet"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "price": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "direction": {
                              "enum": [
                                "up",
                                "down"
                              ],
                              "type": "string"
                            }
                          },
                          "description": "A level that moves only one way. Up: the larger of input and its own prior value, and it restarts at input after the prior price closes below it. Down is the reverse. Use it for Supertrend style bands.",
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "kind",
                            "span",
                            "back",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "pivot"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "back": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "kind": {
                              "enum": [
                                "high",
                                "low"
                              ],
                              "type": "string"
                            },
                            "read": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "span": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "description": "Swing high or low of input: a value beyond the span values before it and not passed by the span values after it. Known only span bars later. back 0 is the latest swing, 1 the one before. read returns another series at that swing bar.",
                          "additionalProperties": false
                        }
                      ]
                    },
                    "default": []
                  },
                  "signals": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "left",
                            "right"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "above",
                                "below",
                                "crossAbove",
                                "crossBelow"
                              ],
                              "type": "string"
                            },
                            "left": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "right": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "inputs"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "and",
                                "or"
                              ],
                              "type": "string"
                            },
                            "inputs": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                              },
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "not"
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "field",
                            "values"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "calendar"
                            },
                            "field": {
                              "enum": [
                                "month",
                                "day",
                                "firstSessionOfMonth",
                                "utcMinute"
                              ],
                              "type": "string"
                            },
                            "values": {
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": 0
                              },
                              "minItems": 1
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "default": []
                  },
                  "version": {
                    "type": "number",
                    "const": 2
                  },
                  "simulation": {
                    "type": "object",
                    "required": [
                      "fillTiming"
                    ],
                    "properties": {
                      "feeBps": {
                        "type": "number",
                        "default": 0,
                        "maximum": 10000,
                        "minimum": 0
                      },
                      "sleeves": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "weight"
                          ],
                          "properties": {
                            "weight": {
                              "type": "number",
                              "maximum": 1,
                              "exclusiveMinimum": 0
                            },
                            "positions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "ticker",
                                  "direction",
                                  "enter",
                                  "size"
                                ],
                                "properties": {
                                  "add": {
                                    "type": "object",
                                    "required": [
                                      "distance",
                                      "maxUnits"
                                    ],
                                    "properties": {
                                      "distance": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                          },
                                          {
                                            "type": "number"
                                          }
                                        ]
                                      },
                                      "maxUnits": {
                                        "type": "integer",
                                        "minimum": 2,
                                        "exclusiveMinimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "exit": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "size": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "required": [
                                          "kind",
                                          "fraction"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "const": "fraction"
                                          },
                                          "fraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "required": [
                                          "kind",
                                          "riskFraction",
                                          "maxFraction",
                                          "distance"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "const": "risk"
                                          },
                                          "distance": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                              },
                                              {
                                                "type": "number"
                                              }
                                            ]
                                          },
                                          "maxFraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          },
                                          "riskFraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "enter": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "option": {
                                    "type": "object",
                                    "required": [
                                      "right",
                                      "strike",
                                      "premium",
                                      "expiry"
                                    ],
                                    "properties": {
                                      "right": {
                                        "enum": [
                                          "call",
                                          "put"
                                        ],
                                        "type": "string"
                                      },
                                      "expiry": {
                                        "type": "string"
                                      },
                                      "strike": {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      },
                                      "premium": {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "ticker": {
                                    "type": "string",
                                    "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                  },
                                  "direction": {
                                    "enum": [
                                      "long",
                                      "short"
                                    ],
                                    "type": "string"
                                  },
                                  "closeStopPct": {
                                    "type": "number",
                                    "maximum": 100,
                                    "exclusiveMinimum": 0
                                  },
                                  "stopDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  },
                                  "trailDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ],
                                    "description": "Trailing stop: distance below the highest high since entry for a long, or above the lowest low for a short. It moves only in the trade's favor and applies from the next bar."
                                  },
                                  "closeTargetPct": {
                                    "type": "number",
                                    "exclusiveMinimum": 0
                                  },
                                  "targetDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "default": []
                            },
                            "allocation": {
                              "type": "object",
                              "required": [
                                "when",
                                "targets"
                              ],
                              "properties": {
                                "when": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                "targets": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "ticker",
                                      "when",
                                      "weight"
                                    ],
                                    "properties": {
                                      "when": {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      "ticker": {
                                        "type": "string",
                                        "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                      },
                                      "weight": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                          },
                                          {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        ],
                                        "description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "minItems": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": false
                        },
                        "minItems": 1
                      },
                      "positions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "ticker",
                            "direction",
                            "enter",
                            "size"
                          ],
                          "properties": {
                            "add": {
                              "type": "object",
                              "required": [
                                "distance",
                                "maxUnits"
                              ],
                              "properties": {
                                "distance": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                    },
                                    {
                                      "type": "number"
                                    }
                                  ]
                                },
                                "maxUnits": {
                                  "type": "integer",
                                  "minimum": 2,
                                  "exclusiveMinimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "exit": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "size": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "fraction"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "fraction"
                                    },
                                    "fraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "riskFraction",
                                    "maxFraction",
                                    "distance"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "risk"
                                    },
                                    "distance": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "maxFraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    },
                                    "riskFraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "enter": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "option": {
                              "type": "object",
                              "required": [
                                "right",
                                "strike",
                                "premium",
                                "expiry"
                              ],
                              "properties": {
                                "right": {
                                  "enum": [
                                    "call",
                                    "put"
                                  ],
                                  "type": "string"
                                },
                                "expiry": {
                                  "type": "string"
                                },
                                "strike": {
                                  "type": "number",
                                  "exclusiveMinimum": 0
                                },
                                "premium": {
                                  "type": "number",
                                  "exclusiveMinimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "ticker": {
                              "type": "string",
                              "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                            },
                            "direction": {
                              "enum": [
                                "long",
                                "short"
                              ],
                              "type": "string"
                            },
                            "closeStopPct": {
                              "type": "number",
                              "maximum": 100,
                              "exclusiveMinimum": 0
                            },
                            "stopDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "trailDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "description": "Trailing stop: distance below the highest high since entry for a long, or above the lowest low for a short. It moves only in the trade's favor and applies from the next bar."
                            },
                            "closeTargetPct": {
                              "type": "number",
                              "exclusiveMinimum": 0
                            },
                            "targetDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "default": []
                      },
                      "allocation": {
                        "type": "object",
                        "required": [
                          "when",
                          "targets"
                        ],
                        "properties": {
                          "when": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                          },
                          "targets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "ticker",
                                "when",
                                "weight"
                              ],
                              "properties": {
                                "when": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                "ticker": {
                                  "type": "string",
                                  "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                },
                                "weight": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                    },
                                    {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  ],
                                  "description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
                                }
                              },
                              "additionalProperties": false
                            },
                            "minItems": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      "fillTiming": {
                        "enum": [
                          "nextOpen",
                          "nextClose"
                        ],
                        "type": "string"
                      },
                      "slippageBps": {
                        "type": "number",
                        "default": 0,
                        "minimum": 0,
                        "exclusiveMaximum": 10000
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "annotations": {
            "readOnlyHint": true
          }
        },
        {
          "name": "build_series",
          "title": "Build data series",
          "description": "Build named time series from a run form. Needs version, data, and series.",
          "inputSchema": {
            "type": "object",
            "required": [
              "run"
            ],
            "properties": {
              "run": {
                "type": "object",
                "$schema": "http://json-schema.org/draft-07/schema#",
                "required": [
                  "version",
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": [
                      "tickers",
                      "start",
                      "end",
                      "source"
                    ],
                    "properties": {
                      "end": {
                        "type": "string"
                      },
                      "start": {
                        "type": "string"
                      },
                      "source": {
                        "enum": [
                          "price-api",
                          "intraday-api"
                        ],
                        "type": "string"
                      },
                      "tickers": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                        },
                        "minItems": 1
                      },
                      "interval": {
                        "enum": [
                          "1min",
                          "5min",
                          "15min",
                          "30min",
                          "1hour"
                        ],
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  "money": {
                    "type": "object",
                    "required": [
                      "capital"
                    ],
                    "properties": {
                      "capital": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "benchmark": {
                        "type": "string",
                        "const": "SPY",
                        "default": "SPY"
                      }
                    },
                    "additionalProperties": false
                  },
                  "series": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "ticker",
                            "field",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "price"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "field": {
                              "enum": [
                                "open",
                                "high",
                                "low",
                                "close",
                                "volume"
                              ],
                              "type": "string"
                            },
                            "ticker": {
                              "type": "string",
                              "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "points",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "observations"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "points": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "observedAt",
                                  "knownAt",
                                  "value"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "number"
                                  },
                                  "knownAt": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "observedAt": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "minItems": 1
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "agg",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "session"
                            },
                            "agg": {
                              "enum": [
                                "sum",
                                "high",
                                "low",
                                "first"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "bars": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "description": "Running sum, high, low, or first value since the session start. With bars, only the first bars of each session count; the value is null until they finish, then held for the rest of the session.",
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "lag"
                            },
                            "lag": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "window",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "average",
                                "high",
                                "low",
                                "sum",
                                "change",
                                "stddev"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "window": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "window",
                            "alpha",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "smooth"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "alpha": {
                              "type": "number",
                              "maximum": 1,
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "window": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "left",
                            "right",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "add",
                                "subtract",
                                "multiply",
                                "ratio",
                                "min",
                                "max"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "left": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "right": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "peers",
                            "order",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "rank"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "order": {
                              "enum": [
                                "ascending",
                                "descending"
                              ],
                              "type": "string"
                            },
                            "peers": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                              },
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "price",
                            "direction",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "ratchet"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "price": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "direction": {
                              "enum": [
                                "up",
                                "down"
                              ],
                              "type": "string"
                            }
                          },
                          "description": "A level that moves only one way. Up: the larger of input and its own prior value, and it restarts at input after the prior price closes below it. Down is the reverse. Use it for Supertrend style bands.",
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "kind",
                            "span",
                            "back",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "pivot"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "back": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "kind": {
                              "enum": [
                                "high",
                                "low"
                              ],
                              "type": "string"
                            },
                            "read": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "span": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "description": "Swing high or low of input: a value beyond the span values before it and not passed by the span values after it. Known only span bars later. back 0 is the latest swing, 1 the one before. read returns another series at that swing bar.",
                          "additionalProperties": false
                        }
                      ]
                    },
                    "default": []
                  },
                  "signals": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "left",
                            "right"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "above",
                                "below",
                                "crossAbove",
                                "crossBelow"
                              ],
                              "type": "string"
                            },
                            "left": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "right": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "inputs"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "and",
                                "or"
                              ],
                              "type": "string"
                            },
                            "inputs": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                              },
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "not"
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "field",
                            "values"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "calendar"
                            },
                            "field": {
                              "enum": [
                                "month",
                                "day",
                                "firstSessionOfMonth",
                                "utcMinute"
                              ],
                              "type": "string"
                            },
                            "values": {
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": 0
                              },
                              "minItems": 1
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "default": []
                  },
                  "version": {
                    "type": "number",
                    "const": 2
                  },
                  "simulation": {
                    "type": "object",
                    "required": [
                      "fillTiming"
                    ],
                    "properties": {
                      "feeBps": {
                        "type": "number",
                        "default": 0,
                        "maximum": 10000,
                        "minimum": 0
                      },
                      "sleeves": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "weight"
                          ],
                          "properties": {
                            "weight": {
                              "type": "number",
                              "maximum": 1,
                              "exclusiveMinimum": 0
                            },
                            "positions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "ticker",
                                  "direction",
                                  "enter",
                                  "size"
                                ],
                                "properties": {
                                  "add": {
                                    "type": "object",
                                    "required": [
                                      "distance",
                                      "maxUnits"
                                    ],
                                    "properties": {
                                      "distance": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                          },
                                          {
                                            "type": "number"
                                          }
                                        ]
                                      },
                                      "maxUnits": {
                                        "type": "integer",
                                        "minimum": 2,
                                        "exclusiveMinimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "exit": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "size": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "required": [
                                          "kind",
                                          "fraction"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "const": "fraction"
                                          },
                                          "fraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "required": [
                                          "kind",
                                          "riskFraction",
                                          "maxFraction",
                                          "distance"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "const": "risk"
                                          },
                                          "distance": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                              },
                                              {
                                                "type": "number"
                                              }
                                            ]
                                          },
                                          "maxFraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          },
                                          "riskFraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "enter": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "option": {
                                    "type": "object",
                                    "required": [
                                      "right",
                                      "strike",
                                      "premium",
                                      "expiry"
                                    ],
                                    "properties": {
                                      "right": {
                                        "enum": [
                                          "call",
                                          "put"
                                        ],
                                        "type": "string"
                                      },
                                      "expiry": {
                                        "type": "string"
                                      },
                                      "strike": {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      },
                                      "premium": {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "ticker": {
                                    "type": "string",
                                    "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                  },
                                  "direction": {
                                    "enum": [
                                      "long",
                                      "short"
                                    ],
                                    "type": "string"
                                  },
                                  "closeStopPct": {
                                    "type": "number",
                                    "maximum": 100,
                                    "exclusiveMinimum": 0
                                  },
                                  "stopDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  },
                                  "trailDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ],
                                    "description": "Trailing stop: distance below the highest high since entry for a long, or above the lowest low for a short. It moves only in the trade's favor and applies from the next bar."
                                  },
                                  "closeTargetPct": {
                                    "type": "number",
                                    "exclusiveMinimum": 0
                                  },
                                  "targetDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "default": []
                            },
                            "allocation": {
                              "type": "object",
                              "required": [
                                "when",
                                "targets"
                              ],
                              "properties": {
                                "when": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                "targets": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "ticker",
                                      "when",
                                      "weight"
                                    ],
                                    "properties": {
                                      "when": {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      "ticker": {
                                        "type": "string",
                                        "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                      },
                                      "weight": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                          },
                                          {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        ],
                                        "description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "minItems": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": false
                        },
                        "minItems": 1
                      },
                      "positions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "ticker",
                            "direction",
                            "enter",
                            "size"
                          ],
                          "properties": {
                            "add": {
                              "type": "object",
                              "required": [
                                "distance",
                                "maxUnits"
                              ],
                              "properties": {
                                "distance": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                    },
                                    {
                                      "type": "number"
                                    }
                                  ]
                                },
                                "maxUnits": {
                                  "type": "integer",
                                  "minimum": 2,
                                  "exclusiveMinimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "exit": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "size": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "fraction"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "fraction"
                                    },
                                    "fraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "riskFraction",
                                    "maxFraction",
                                    "distance"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "risk"
                                    },
                                    "distance": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "maxFraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    },
                                    "riskFraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "enter": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "option": {
                              "type": "object",
                              "required": [
                                "right",
                                "strike",
                                "premium",
                                "expiry"
                              ],
                              "properties": {
                                "right": {
                                  "enum": [
                                    "call",
                                    "put"
                                  ],
                                  "type": "string"
                                },
                                "expiry": {
                                  "type": "string"
                                },
                                "strike": {
                                  "type": "number",
                                  "exclusiveMinimum": 0
                                },
                                "premium": {
                                  "type": "number",
                                  "exclusiveMinimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "ticker": {
                              "type": "string",
                              "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                            },
                            "direction": {
                              "enum": [
                                "long",
                                "short"
                              ],
                              "type": "string"
                            },
                            "closeStopPct": {
                              "type": "number",
                              "maximum": 100,
                              "exclusiveMinimum": 0
                            },
                            "stopDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "trailDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "description": "Trailing stop: distance below the highest high since entry for a long, or above the lowest low for a short. It moves only in the trade's favor and applies from the next bar."
                            },
                            "closeTargetPct": {
                              "type": "number",
                              "exclusiveMinimum": 0
                            },
                            "targetDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "default": []
                      },
                      "allocation": {
                        "type": "object",
                        "required": [
                          "when",
                          "targets"
                        ],
                        "properties": {
                          "when": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                          },
                          "targets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "ticker",
                                "when",
                                "weight"
                              ],
                              "properties": {
                                "when": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                "ticker": {
                                  "type": "string",
                                  "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                },
                                "weight": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                    },
                                    {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  ],
                                  "description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
                                }
                              },
                              "additionalProperties": false
                            },
                            "minItems": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      "fillTiming": {
                        "enum": [
                          "nextOpen",
                          "nextClose"
                        ],
                        "type": "string"
                      },
                      "slippageBps": {
                        "type": "number",
                        "default": 0,
                        "minimum": 0,
                        "exclusiveMaximum": 10000
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "annotations": {
            "readOnlyHint": true
          }
        },
        {
          "name": "build_signal",
          "title": "Build trading signals",
          "description": "Build named trading signals from a run form. Needs version, data, series, and signals.",
          "inputSchema": {
            "type": "object",
            "required": [
              "run"
            ],
            "properties": {
              "run": {
                "type": "object",
                "$schema": "http://json-schema.org/draft-07/schema#",
                "required": [
                  "version",
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": [
                      "tickers",
                      "start",
                      "end",
                      "source"
                    ],
                    "properties": {
                      "end": {
                        "type": "string"
                      },
                      "start": {
                        "type": "string"
                      },
                      "source": {
                        "enum": [
                          "price-api",
                          "intraday-api"
                        ],
                        "type": "string"
                      },
                      "tickers": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                        },
                        "minItems": 1
                      },
                      "interval": {
                        "enum": [
                          "1min",
                          "5min",
                          "15min",
                          "30min",
                          "1hour"
                        ],
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  "money": {
                    "type": "object",
                    "required": [
                      "capital"
                    ],
                    "properties": {
                      "capital": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "benchmark": {
                        "type": "string",
                        "const": "SPY",
                        "default": "SPY"
                      }
                    },
                    "additionalProperties": false
                  },
                  "series": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "ticker",
                            "field",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "price"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "field": {
                              "enum": [
                                "open",
                                "high",
                                "low",
                                "close",
                                "volume"
                              ],
                              "type": "string"
                            },
                            "ticker": {
                              "type": "string",
                              "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "points",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "observations"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "points": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "observedAt",
                                  "knownAt",
                                  "value"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "number"
                                  },
                                  "knownAt": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "observedAt": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "minItems": 1
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "agg",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "session"
                            },
                            "agg": {
                              "enum": [
                                "sum",
                                "high",
                                "low",
                                "first"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "bars": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "description": "Running sum, high, low, or first value since the session start. With bars, only the first bars of each session count; the value is null until they finish, then held for the rest of the session.",
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "lag"
                            },
                            "lag": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "window",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "average",
                                "high",
                                "low",
                                "sum",
                                "change",
                                "stddev"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "window": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "window",
                            "alpha",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "smooth"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "alpha": {
                              "type": "number",
                              "maximum": 1,
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "window": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "left",
                            "right",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "add",
                                "subtract",
                                "multiply",
                                "ratio",
                                "min",
                                "max"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "left": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "right": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "peers",
                            "order",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "rank"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "order": {
                              "enum": [
                                "ascending",
                                "descending"
                              ],
                              "type": "string"
                            },
                            "peers": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                              },
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "price",
                            "direction",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "ratchet"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "price": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "direction": {
                              "enum": [
                                "up",
                                "down"
                              ],
                              "type": "string"
                            }
                          },
                          "description": "A level that moves only one way. Up: the larger of input and its own prior value, and it restarts at input after the prior price closes below it. Down is the reverse. Use it for Supertrend style bands.",
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "kind",
                            "span",
                            "back",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "pivot"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "back": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "kind": {
                              "enum": [
                                "high",
                                "low"
                              ],
                              "type": "string"
                            },
                            "read": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "span": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "description": "Swing high or low of input: a value beyond the span values before it and not passed by the span values after it. Known only span bars later. back 0 is the latest swing, 1 the one before. read returns another series at that swing bar.",
                          "additionalProperties": false
                        }
                      ]
                    },
                    "default": []
                  },
                  "signals": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "left",
                            "right"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "above",
                                "below",
                                "crossAbove",
                                "crossBelow"
                              ],
                              "type": "string"
                            },
                            "left": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "right": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "inputs"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "and",
                                "or"
                              ],
                              "type": "string"
                            },
                            "inputs": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                              },
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "not"
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "field",
                            "values"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "calendar"
                            },
                            "field": {
                              "enum": [
                                "month",
                                "day",
                                "firstSessionOfMonth",
                                "utcMinute"
                              ],
                              "type": "string"
                            },
                            "values": {
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": 0
                              },
                              "minItems": 1
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "default": []
                  },
                  "version": {
                    "type": "number",
                    "const": 2
                  },
                  "simulation": {
                    "type": "object",
                    "required": [
                      "fillTiming"
                    ],
                    "properties": {
                      "feeBps": {
                        "type": "number",
                        "default": 0,
                        "maximum": 10000,
                        "minimum": 0
                      },
                      "sleeves": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "weight"
                          ],
                          "properties": {
                            "weight": {
                              "type": "number",
                              "maximum": 1,
                              "exclusiveMinimum": 0
                            },
                            "positions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "ticker",
                                  "direction",
                                  "enter",
                                  "size"
                                ],
                                "properties": {
                                  "add": {
                                    "type": "object",
                                    "required": [
                                      "distance",
                                      "maxUnits"
                                    ],
                                    "properties": {
                                      "distance": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                          },
                                          {
                                            "type": "number"
                                          }
                                        ]
                                      },
                                      "maxUnits": {
                                        "type": "integer",
                                        "minimum": 2,
                                        "exclusiveMinimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "exit": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "size": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "required": [
                                          "kind",
                                          "fraction"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "const": "fraction"
                                          },
                                          "fraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "required": [
                                          "kind",
                                          "riskFraction",
                                          "maxFraction",
                                          "distance"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "const": "risk"
                                          },
                                          "distance": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                              },
                                              {
                                                "type": "number"
                                              }
                                            ]
                                          },
                                          "maxFraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          },
                                          "riskFraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "enter": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "option": {
                                    "type": "object",
                                    "required": [
                                      "right",
                                      "strike",
                                      "premium",
                                      "expiry"
                                    ],
                                    "properties": {
                                      "right": {
                                        "enum": [
                                          "call",
                                          "put"
                                        ],
                                        "type": "string"
                                      },
                                      "expiry": {
                                        "type": "string"
                                      },
                                      "strike": {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      },
                                      "premium": {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "ticker": {
                                    "type": "string",
                                    "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                  },
                                  "direction": {
                                    "enum": [
                                      "long",
                                      "short"
                                    ],
                                    "type": "string"
                                  },
                                  "closeStopPct": {
                                    "type": "number",
                                    "maximum": 100,
                                    "exclusiveMinimum": 0
                                  },
                                  "stopDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  },
                                  "trailDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ],
                                    "description": "Trailing stop: distance below the highest high since entry for a long, or above the lowest low for a short. It moves only in the trade's favor and applies from the next bar."
                                  },
                                  "closeTargetPct": {
                                    "type": "number",
                                    "exclusiveMinimum": 0
                                  },
                                  "targetDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "default": []
                            },
                            "allocation": {
                              "type": "object",
                              "required": [
                                "when",
                                "targets"
                              ],
                              "properties": {
                                "when": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                "targets": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "ticker",
                                      "when",
                                      "weight"
                                    ],
                                    "properties": {
                                      "when": {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      "ticker": {
                                        "type": "string",
                                        "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                      },
                                      "weight": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                          },
                                          {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        ],
                                        "description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "minItems": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": false
                        },
                        "minItems": 1
                      },
                      "positions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "ticker",
                            "direction",
                            "enter",
                            "size"
                          ],
                          "properties": {
                            "add": {
                              "type": "object",
                              "required": [
                                "distance",
                                "maxUnits"
                              ],
                              "properties": {
                                "distance": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                    },
                                    {
                                      "type": "number"
                                    }
                                  ]
                                },
                                "maxUnits": {
                                  "type": "integer",
                                  "minimum": 2,
                                  "exclusiveMinimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "exit": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "size": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "fraction"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "fraction"
                                    },
                                    "fraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "riskFraction",
                                    "maxFraction",
                                    "distance"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "risk"
                                    },
                                    "distance": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "maxFraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    },
                                    "riskFraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "enter": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "option": {
                              "type": "object",
                              "required": [
                                "right",
                                "strike",
                                "premium",
                                "expiry"
                              ],
                              "properties": {
                                "right": {
                                  "enum": [
                                    "call",
                                    "put"
                                  ],
                                  "type": "string"
                                },
                                "expiry": {
                                  "type": "string"
                                },
                                "strike": {
                                  "type": "number",
                                  "exclusiveMinimum": 0
                                },
                                "premium": {
                                  "type": "number",
                                  "exclusiveMinimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "ticker": {
                              "type": "string",
                              "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                            },
                            "direction": {
                              "enum": [
                                "long",
                                "short"
                              ],
                              "type": "string"
                            },
                            "closeStopPct": {
                              "type": "number",
                              "maximum": 100,
                              "exclusiveMinimum": 0
                            },
                            "stopDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "trailDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "description": "Trailing stop: distance below the highest high since entry for a long, or above the lowest low for a short. It moves only in the trade's favor and applies from the next bar."
                            },
                            "closeTargetPct": {
                              "type": "number",
                              "exclusiveMinimum": 0
                            },
                            "targetDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "default": []
                      },
                      "allocation": {
                        "type": "object",
                        "required": [
                          "when",
                          "targets"
                        ],
                        "properties": {
                          "when": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                          },
                          "targets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "ticker",
                                "when",
                                "weight"
                              ],
                              "properties": {
                                "when": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                "ticker": {
                                  "type": "string",
                                  "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                },
                                "weight": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                    },
                                    {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  ],
                                  "description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
                                }
                              },
                              "additionalProperties": false
                            },
                            "minItems": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      "fillTiming": {
                        "enum": [
                          "nextOpen",
                          "nextClose"
                        ],
                        "type": "string"
                      },
                      "slippageBps": {
                        "type": "number",
                        "default": 0,
                        "minimum": 0,
                        "exclusiveMaximum": 10000
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "annotations": {
            "readOnlyHint": true
          }
        },
        {
          "name": "simulate",
          "title": "Simulate past trades",
          "description": "Simulate historical fills and account balances. Needs the full run form.",
          "inputSchema": {
            "type": "object",
            "required": [
              "run"
            ],
            "properties": {
              "run": {
                "type": "object",
                "$schema": "http://json-schema.org/draft-07/schema#",
                "required": [
                  "version",
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": [
                      "tickers",
                      "start",
                      "end",
                      "source"
                    ],
                    "properties": {
                      "end": {
                        "type": "string"
                      },
                      "start": {
                        "type": "string"
                      },
                      "source": {
                        "enum": [
                          "price-api",
                          "intraday-api"
                        ],
                        "type": "string"
                      },
                      "tickers": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                        },
                        "minItems": 1
                      },
                      "interval": {
                        "enum": [
                          "1min",
                          "5min",
                          "15min",
                          "30min",
                          "1hour"
                        ],
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  "money": {
                    "type": "object",
                    "required": [
                      "capital"
                    ],
                    "properties": {
                      "capital": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "benchmark": {
                        "type": "string",
                        "const": "SPY",
                        "default": "SPY"
                      }
                    },
                    "additionalProperties": false
                  },
                  "series": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "ticker",
                            "field",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "price"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "field": {
                              "enum": [
                                "open",
                                "high",
                                "low",
                                "close",
                                "volume"
                              ],
                              "type": "string"
                            },
                            "ticker": {
                              "type": "string",
                              "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "points",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "observations"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "points": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "observedAt",
                                  "knownAt",
                                  "value"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "number"
                                  },
                                  "knownAt": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "observedAt": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "minItems": 1
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "agg",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "session"
                            },
                            "agg": {
                              "enum": [
                                "sum",
                                "high",
                                "low",
                                "first"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "bars": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "description": "Running sum, high, low, or first value since the session start. With bars, only the first bars of each session count; the value is null until they finish, then held for the rest of the session.",
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "lag"
                            },
                            "lag": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "window",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "average",
                                "high",
                                "low",
                                "sum",
                                "change",
                                "stddev"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "window": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "window",
                            "alpha",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "smooth"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "alpha": {
                              "type": "number",
                              "maximum": 1,
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "window": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "left",
                            "right",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "add",
                                "subtract",
                                "multiply",
                                "ratio",
                                "min",
                                "max"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "left": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "right": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "peers",
                            "order",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "rank"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "order": {
                              "enum": [
                                "ascending",
                                "descending"
                              ],
                              "type": "string"
                            },
                            "peers": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                              },
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "price",
                            "direction",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "ratchet"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "price": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "direction": {
                              "enum": [
                                "up",
                                "down"
                              ],
                              "type": "string"
                            }
                          },
                          "description": "A level that moves only one way. Up: the larger of input and its own prior value, and it restarts at input after the prior price closes below it. Down is the reverse. Use it for Supertrend style bands.",
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "kind",
                            "span",
                            "back",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "pivot"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "back": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "kind": {
                              "enum": [
                                "high",
                                "low"
                              ],
                              "type": "string"
                            },
                            "read": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "span": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "description": "Swing high or low of input: a value beyond the span values before it and not passed by the span values after it. Known only span bars later. back 0 is the latest swing, 1 the one before. read returns another series at that swing bar.",
                          "additionalProperties": false
                        }
                      ]
                    },
                    "default": []
                  },
                  "signals": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "left",
                            "right"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "above",
                                "below",
                                "crossAbove",
                                "crossBelow"
                              ],
                              "type": "string"
                            },
                            "left": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "right": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "inputs"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "and",
                                "or"
                              ],
                              "type": "string"
                            },
                            "inputs": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                              },
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "not"
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "field",
                            "values"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "calendar"
                            },
                            "field": {
                              "enum": [
                                "month",
                                "day",
                                "firstSessionOfMonth",
                                "utcMinute"
                              ],
                              "type": "string"
                            },
                            "values": {
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": 0
                              },
                              "minItems": 1
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "default": []
                  },
                  "version": {
                    "type": "number",
                    "const": 2
                  },
                  "simulation": {
                    "type": "object",
                    "required": [
                      "fillTiming"
                    ],
                    "properties": {
                      "feeBps": {
                        "type": "number",
                        "default": 0,
                        "maximum": 10000,
                        "minimum": 0
                      },
                      "sleeves": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "weight"
                          ],
                          "properties": {
                            "weight": {
                              "type": "number",
                              "maximum": 1,
                              "exclusiveMinimum": 0
                            },
                            "positions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "ticker",
                                  "direction",
                                  "enter",
                                  "size"
                                ],
                                "properties": {
                                  "add": {
                                    "type": "object",
                                    "required": [
                                      "distance",
                                      "maxUnits"
                                    ],
                                    "properties": {
                                      "distance": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                          },
                                          {
                                            "type": "number"
                                          }
                                        ]
                                      },
                                      "maxUnits": {
                                        "type": "integer",
                                        "minimum": 2,
                                        "exclusiveMinimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "exit": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "size": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "required": [
                                          "kind",
                                          "fraction"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "const": "fraction"
                                          },
                                          "fraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "required": [
                                          "kind",
                                          "riskFraction",
                                          "maxFraction",
                                          "distance"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "const": "risk"
                                          },
                                          "distance": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                              },
                                              {
                                                "type": "number"
                                              }
                                            ]
                                          },
                                          "maxFraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          },
                                          "riskFraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "enter": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "option": {
                                    "type": "object",
                                    "required": [
                                      "right",
                                      "strike",
                                      "premium",
                                      "expiry"
                                    ],
                                    "properties": {
                                      "right": {
                                        "enum": [
                                          "call",
                                          "put"
                                        ],
                                        "type": "string"
                                      },
                                      "expiry": {
                                        "type": "string"
                                      },
                                      "strike": {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      },
                                      "premium": {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "ticker": {
                                    "type": "string",
                                    "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                  },
                                  "direction": {
                                    "enum": [
                                      "long",
                                      "short"
                                    ],
                                    "type": "string"
                                  },
                                  "closeStopPct": {
                                    "type": "number",
                                    "maximum": 100,
                                    "exclusiveMinimum": 0
                                  },
                                  "stopDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  },
                                  "trailDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ],
                                    "description": "Trailing stop: distance below the highest high since entry for a long, or above the lowest low for a short. It moves only in the trade's favor and applies from the next bar."
                                  },
                                  "closeTargetPct": {
                                    "type": "number",
                                    "exclusiveMinimum": 0
                                  },
                                  "targetDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "default": []
                            },
                            "allocation": {
                              "type": "object",
                              "required": [
                                "when",
                                "targets"
                              ],
                              "properties": {
                                "when": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                "targets": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "ticker",
                                      "when",
                                      "weight"
                                    ],
                                    "properties": {
                                      "when": {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      "ticker": {
                                        "type": "string",
                                        "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                      },
                                      "weight": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                          },
                                          {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        ],
                                        "description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "minItems": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": false
                        },
                        "minItems": 1
                      },
                      "positions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "ticker",
                            "direction",
                            "enter",
                            "size"
                          ],
                          "properties": {
                            "add": {
                              "type": "object",
                              "required": [
                                "distance",
                                "maxUnits"
                              ],
                              "properties": {
                                "distance": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                    },
                                    {
                                      "type": "number"
                                    }
                                  ]
                                },
                                "maxUnits": {
                                  "type": "integer",
                                  "minimum": 2,
                                  "exclusiveMinimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "exit": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "size": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "fraction"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "fraction"
                                    },
                                    "fraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "riskFraction",
                                    "maxFraction",
                                    "distance"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "risk"
                                    },
                                    "distance": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "maxFraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    },
                                    "riskFraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "enter": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "option": {
                              "type": "object",
                              "required": [
                                "right",
                                "strike",
                                "premium",
                                "expiry"
                              ],
                              "properties": {
                                "right": {
                                  "enum": [
                                    "call",
                                    "put"
                                  ],
                                  "type": "string"
                                },
                                "expiry": {
                                  "type": "string"
                                },
                                "strike": {
                                  "type": "number",
                                  "exclusiveMinimum": 0
                                },
                                "premium": {
                                  "type": "number",
                                  "exclusiveMinimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "ticker": {
                              "type": "string",
                              "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                            },
                            "direction": {
                              "enum": [
                                "long",
                                "short"
                              ],
                              "type": "string"
                            },
                            "closeStopPct": {
                              "type": "number",
                              "maximum": 100,
                              "exclusiveMinimum": 0
                            },
                            "stopDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "trailDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "description": "Trailing stop: distance below the highest high since entry for a long, or above the lowest low for a short. It moves only in the trade's favor and applies from the next bar."
                            },
                            "closeTargetPct": {
                              "type": "number",
                              "exclusiveMinimum": 0
                            },
                            "targetDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "default": []
                      },
                      "allocation": {
                        "type": "object",
                        "required": [
                          "when",
                          "targets"
                        ],
                        "properties": {
                          "when": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                          },
                          "targets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "ticker",
                                "when",
                                "weight"
                              ],
                              "properties": {
                                "when": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                "ticker": {
                                  "type": "string",
                                  "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                },
                                "weight": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                    },
                                    {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  ],
                                  "description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
                                }
                              },
                              "additionalProperties": false
                            },
                            "minItems": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      "fillTiming": {
                        "enum": [
                          "nextOpen",
                          "nextClose"
                        ],
                        "type": "string"
                      },
                      "slippageBps": {
                        "type": "number",
                        "default": 0,
                        "minimum": 0,
                        "exclusiveMaximum": 10000
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "annotations": {
            "readOnlyHint": true
          }
        },
        {
          "name": "report",
          "title": "Run a backtest report",
          "description": "Run a backtest and show its results. Supply strategyExplanation in plain terms for the widget. In your reply, explain the rule, always show Return vs. SPY (summary.returnVsSpyPct in percentage points, or Unavailable), and give one takeaway or limit supported by the report. Choose any additional cards using stats. Use scoreSeries for a separate score panel. Use chartSeries to select named report series and set their legend labels, line or bar types, colors, and line patterns. Keep the interpretation about this historical test. To publish this exact result later, pass its reportId to save_strategy after the user asks to save it to the website.",
          "inputSchema": {
            "type": "object",
            "required": [
              "run"
            ],
            "properties": {
              "run": {
                "type": "object",
                "$schema": "http://json-schema.org/draft-07/schema#",
                "required": [
                  "version",
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": [
                      "tickers",
                      "start",
                      "end",
                      "source"
                    ],
                    "properties": {
                      "end": {
                        "type": "string"
                      },
                      "start": {
                        "type": "string"
                      },
                      "source": {
                        "enum": [
                          "price-api",
                          "intraday-api"
                        ],
                        "type": "string"
                      },
                      "tickers": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                        },
                        "minItems": 1
                      },
                      "interval": {
                        "enum": [
                          "1min",
                          "5min",
                          "15min",
                          "30min",
                          "1hour"
                        ],
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  "money": {
                    "type": "object",
                    "required": [
                      "capital"
                    ],
                    "properties": {
                      "capital": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "benchmark": {
                        "type": "string",
                        "const": "SPY",
                        "default": "SPY"
                      }
                    },
                    "additionalProperties": false
                  },
                  "series": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "ticker",
                            "field",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "price"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "field": {
                              "enum": [
                                "open",
                                "high",
                                "low",
                                "close",
                                "volume"
                              ],
                              "type": "string"
                            },
                            "ticker": {
                              "type": "string",
                              "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "points",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "observations"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "points": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "observedAt",
                                  "knownAt",
                                  "value"
                                ],
                                "properties": {
                                  "value": {
                                    "type": "number"
                                  },
                                  "knownAt": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "observedAt": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "string"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "minItems": 1
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "agg",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "session"
                            },
                            "agg": {
                              "enum": [
                                "sum",
                                "high",
                                "low",
                                "first"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "bars": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "description": "Running sum, high, low, or first value since the session start. With bars, only the first bars of each session count; the value is null until they finish, then held for the rest of the session.",
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "lag"
                            },
                            "lag": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "window",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "average",
                                "high",
                                "low",
                                "sum",
                                "change",
                                "stddev"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "window": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "window",
                            "alpha",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "smooth"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "alpha": {
                              "type": "number",
                              "maximum": 1,
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "window": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "left",
                            "right",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "add",
                                "subtract",
                                "multiply",
                                "ratio",
                                "min",
                                "max"
                              ],
                              "type": "string"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "left": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "right": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "peers",
                            "order",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "rank"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "order": {
                              "enum": [
                                "ascending",
                                "descending"
                              ],
                              "type": "string"
                            },
                            "peers": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                              },
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "price",
                            "direction",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "ratchet"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "price": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "direction": {
                              "enum": [
                                "up",
                                "down"
                              ],
                              "type": "string"
                            }
                          },
                          "description": "A level that moves only one way. Up: the larger of input and its own prior value, and it restarts at input after the prior price closes below it. Down is the reverse. Use it for Supertrend style bands.",
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input",
                            "kind",
                            "span",
                            "back",
                            "lag"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "pivot"
                            },
                            "lag": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "back": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "kind": {
                              "enum": [
                                "high",
                                "low"
                              ],
                              "type": "string"
                            },
                            "read": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "span": {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "description": "Swing high or low of input: a value beyond the span values before it and not passed by the span values after it. Known only span bars later. back 0 is the latest swing, 1 the one before. read returns another series at that swing bar.",
                          "additionalProperties": false
                        }
                      ]
                    },
                    "default": []
                  },
                  "signals": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "left",
                            "right"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "above",
                                "below",
                                "crossAbove",
                                "crossBelow"
                              ],
                              "type": "string"
                            },
                            "left": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "right": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "inputs"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "enum": [
                                "and",
                                "or"
                              ],
                              "type": "string"
                            },
                            "inputs": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                              },
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "input"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "not"
                            },
                            "input": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "op",
                            "field",
                            "values"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "op": {
                              "type": "string",
                              "const": "calendar"
                            },
                            "field": {
                              "enum": [
                                "month",
                                "day",
                                "firstSessionOfMonth",
                                "utcMinute"
                              ],
                              "type": "string"
                            },
                            "values": {
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": 0
                              },
                              "minItems": 1
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "default": []
                  },
                  "version": {
                    "type": "number",
                    "const": 2
                  },
                  "simulation": {
                    "type": "object",
                    "required": [
                      "fillTiming"
                    ],
                    "properties": {
                      "feeBps": {
                        "type": "number",
                        "default": 0,
                        "maximum": 10000,
                        "minimum": 0
                      },
                      "sleeves": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "weight"
                          ],
                          "properties": {
                            "weight": {
                              "type": "number",
                              "maximum": 1,
                              "exclusiveMinimum": 0
                            },
                            "positions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "ticker",
                                  "direction",
                                  "enter",
                                  "size"
                                ],
                                "properties": {
                                  "add": {
                                    "type": "object",
                                    "required": [
                                      "distance",
                                      "maxUnits"
                                    ],
                                    "properties": {
                                      "distance": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                          },
                                          {
                                            "type": "number"
                                          }
                                        ]
                                      },
                                      "maxUnits": {
                                        "type": "integer",
                                        "minimum": 2,
                                        "exclusiveMinimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "exit": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "size": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "required": [
                                          "kind",
                                          "fraction"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "const": "fraction"
                                          },
                                          "fraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "required": [
                                          "kind",
                                          "riskFraction",
                                          "maxFraction",
                                          "distance"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "const": "risk"
                                          },
                                          "distance": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                              },
                                              {
                                                "type": "number"
                                              }
                                            ]
                                          },
                                          "maxFraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          },
                                          "riskFraction": {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "enter": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                  },
                                  "option": {
                                    "type": "object",
                                    "required": [
                                      "right",
                                      "strike",
                                      "premium",
                                      "expiry"
                                    ],
                                    "properties": {
                                      "right": {
                                        "enum": [
                                          "call",
                                          "put"
                                        ],
                                        "type": "string"
                                      },
                                      "expiry": {
                                        "type": "string"
                                      },
                                      "strike": {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      },
                                      "premium": {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "ticker": {
                                    "type": "string",
                                    "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                  },
                                  "direction": {
                                    "enum": [
                                      "long",
                                      "short"
                                    ],
                                    "type": "string"
                                  },
                                  "closeStopPct": {
                                    "type": "number",
                                    "maximum": 100,
                                    "exclusiveMinimum": 0
                                  },
                                  "stopDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  },
                                  "trailDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ],
                                    "description": "Trailing stop: distance below the highest high since entry for a long, or above the lowest low for a short. It moves only in the trade's favor and applies from the next bar."
                                  },
                                  "closeTargetPct": {
                                    "type": "number",
                                    "exclusiveMinimum": 0
                                  },
                                  "targetDistance": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "default": []
                            },
                            "allocation": {
                              "type": "object",
                              "required": [
                                "when",
                                "targets"
                              ],
                              "properties": {
                                "when": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                "targets": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "ticker",
                                      "when",
                                      "weight"
                                    ],
                                    "properties": {
                                      "when": {
                                        "type": "string",
                                        "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                      },
                                      "ticker": {
                                        "type": "string",
                                        "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                      },
                                      "weight": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                          },
                                          {
                                            "type": "number",
                                            "maximum": 1,
                                            "exclusiveMinimum": 0
                                          }
                                        ],
                                        "description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "minItems": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": false
                        },
                        "minItems": 1
                      },
                      "positions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "ticker",
                            "direction",
                            "enter",
                            "size"
                          ],
                          "properties": {
                            "add": {
                              "type": "object",
                              "required": [
                                "distance",
                                "maxUnits"
                              ],
                              "properties": {
                                "distance": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                    },
                                    {
                                      "type": "number"
                                    }
                                  ]
                                },
                                "maxUnits": {
                                  "type": "integer",
                                  "minimum": 2,
                                  "exclusiveMinimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "exit": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "size": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "fraction"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "fraction"
                                    },
                                    "fraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "riskFraction",
                                    "maxFraction",
                                    "distance"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "risk"
                                    },
                                    "distance": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "maxFraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    },
                                    "riskFraction": {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "enter": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                            },
                            "option": {
                              "type": "object",
                              "required": [
                                "right",
                                "strike",
                                "premium",
                                "expiry"
                              ],
                              "properties": {
                                "right": {
                                  "enum": [
                                    "call",
                                    "put"
                                  ],
                                  "type": "string"
                                },
                                "expiry": {
                                  "type": "string"
                                },
                                "strike": {
                                  "type": "number",
                                  "exclusiveMinimum": 0
                                },
                                "premium": {
                                  "type": "number",
                                  "exclusiveMinimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "ticker": {
                              "type": "string",
                              "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                            },
                            "direction": {
                              "enum": [
                                "long",
                                "short"
                              ],
                              "type": "string"
                            },
                            "closeStopPct": {
                              "type": "number",
                              "maximum": 100,
                              "exclusiveMinimum": 0
                            },
                            "stopDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            },
                            "trailDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "description": "Trailing stop: distance below the highest high since entry for a long, or above the lowest low for a short. It moves only in the trade's favor and applies from the next bar."
                            },
                            "closeTargetPct": {
                              "type": "number",
                              "exclusiveMinimum": 0
                            },
                            "targetDistance": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "default": []
                      },
                      "allocation": {
                        "type": "object",
                        "required": [
                          "when",
                          "targets"
                        ],
                        "properties": {
                          "when": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                          },
                          "targets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "ticker",
                                "when",
                                "weight"
                              ],
                              "properties": {
                                "when": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                },
                                "ticker": {
                                  "type": "string",
                                  "pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$"
                                },
                                "weight": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                                    },
                                    {
                                      "type": "number",
                                      "maximum": 1,
                                      "exclusiveMinimum": 0
                                    }
                                  ],
                                  "description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
                                }
                              },
                              "additionalProperties": false
                            },
                            "minItems": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      "fillTiming": {
                        "enum": [
                          "nextOpen",
                          "nextClose"
                        ],
                        "type": "string"
                      },
                      "slippageBps": {
                        "type": "number",
                        "default": 0,
                        "minimum": 0,
                        "exclusiveMaximum": 10000
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              "stats": {
                "type": "array",
                "items": {
                  "enum": [
                    "period",
                    "tradeCount",
                    "fillCount",
                    "finalValue",
                    "returnPct",
                    "maxDrawdownPct",
                    "benchmarkFinalValue",
                    "returnVsSpyPct",
                    "winRatePct"
                  ],
                  "type": "string"
                },
                "$schema": "http://json-schema.org/draft-07/schema#",
                "maxItems": 9
              },
              "chartSeries": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "seriesId"
                  ],
                  "properties": {
                    "type": {
                      "enum": [
                        "line",
                        "bar"
                      ],
                      "type": "string",
                      "default": "line"
                    },
                    "color": {
                      "type": "string",
                      "pattern": "^#[0-9a-fA-F]{6}$"
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 80,
                      "minLength": 1
                    },
                    "style": {
                      "enum": [
                        "solid",
                        "dashed",
                        "dotted"
                      ],
                      "type": "string",
                      "default": "solid"
                    },
                    "seriesId": {
                      "type": "string",
                      "maxLength": 100,
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "$schema": "http://json-schema.org/draft-07/schema#",
                "maxItems": 12,
                "description": "Additional price-panel plots. Reference named engine report series. Set a legend label, line or bar type, line pattern, and optional hex color."
              },
              "scoreSeries": {
                "type": "string",
                "maxLength": 100,
                "minLength": 1,
                "description": "Named report series to draw in the separate score panel."
              },
              "strategyExplanation": {
                "type": "string",
                "$schema": "http://json-schema.org/draft-07/schema#",
                "maxLength": 600,
                "minLength": 1,
                "description": "In 1 to 3 plain sentences, explain what the strategy trades, what triggers buys and sells or rebalancing, and one key assumption when relevant. Use the run rules. Leave historical results for the report."
              }
            },
            "additionalProperties": false
          },
          "annotations": {
            "readOnlyHint": true
          }
        },
        {
          "name": "share_report",
          "title": "Share a report publicly",
          "description": "PUBLIC: the report is listed in the public strategy library, and anyone can see it. Make a report public so it can be shared, and return its page URL. Needs only the reportId returned by report. The page text comes from the report itself. Sharing the same report again returns the same URL. The report widget calls this when the visitor presses its share icon.",
          "inputSchema": {
            "type": "object",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "required": [
              "reportId"
            ],
            "properties": {
              "reportId": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$",
                "description": "The reportId returned by report."
              }
            },
            "additionalProperties": false
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "list_strategies",
          "title": "List saved strategies",
          "description": "List published website strategies, their URLs, and their current keys. Use a current key as expectedKey only when the user asks to replace that saved strategy.",
          "inputSchema": {
            "type": "object",
            "properties": {},
            "additionalProperties": false
          },
          "annotations": {
            "readOnlyHint": true
          }
        },
        {
          "name": "save_strategy",
          "title": "Publish a report to the public website",
          "description": "PUBLIC: anyone can see the saved page. Publish a completed report to the public website after the user asks to save it. Use the reportId returned by report, a public slug, and client-authored page and presentation choices. Never submit or invent result numbers. Adds it to the strategy directory without rerunning the strategy. Existing slugs require expectedKey to replace a different result. setAsHome changes the home page only when explicitly requested.",
          "inputSchema": {
            "type": "object",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "required": [
              "reportId",
              "id",
              "presentation",
              "page"
            ],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]{0,63}$",
                "description": "Public page slug. New slugs add a page; existing slugs require expectedKey to replace."
              },
              "page": {
                "type": "object",
                "required": [
                  "title",
                  "description",
                  "category"
                ],
                "properties": {
                  "exit": {
                    "type": "string",
                    "minLength": 1
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "signal": {
                    "type": "string",
                    "minLength": 1
                  },
                  "category": {
                    "type": "string",
                    "minLength": 1
                  },
                  "headline": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              "reportId": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$",
                "description": "The reportId returned by report. Do not submit prices, trades, or statistics."
              },
              "setAsHome": {
                "type": "boolean",
                "default": false,
                "description": "Also select this strategy for the home page. Otherwise preserve the current home strategy."
              },
              "expectedKey": {
                "type": "string",
                "pattern": "^reports\\/[a-f0-9]{64}\\.json$",
                "description": "Current published key, required only when replacing a different saved result at this slug."
              },
              "presentation": {
                "type": "object",
                "required": [
                  "mainTicker",
                  "company",
                  "stats",
                  "strategyExplanation",
                  "sections"
                ],
                "properties": {
                  "stats": {
                    "type": "array",
                    "items": {
                      "enum": [
                        "period",
                        "tradeCount",
                        "fillCount",
                        "finalValue",
                        "returnPct",
                        "maxDrawdownPct",
                        "benchmarkFinalValue",
                        "returnVsSpyPct",
                        "winRatePct"
                      ],
                      "type": "string"
                    },
                    "maxItems": 9
                  },
                  "company": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sections": {
                    "type": "array",
                    "items": {
                      "enum": [
                        "rule",
                        "performance",
                        "equity",
                        "widget"
                      ],
                      "type": "string"
                    },
                    "maxItems": 4
                  },
                  "mainTicker": {
                    "type": "string",
                    "minLength": 1
                  },
                  "chartSeries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "seriesId"
                      ],
                      "properties": {
                        "type": {
                          "enum": [
                            "line",
                            "bar"
                          ],
                          "type": "string",
                          "default": "line"
                        },
                        "color": {
                          "type": "string",
                          "pattern": "^#[0-9a-fA-F]{6}$"
                        },
                        "label": {
                          "type": "string",
                          "maxLength": 80,
                          "minLength": 1
                        },
                        "style": {
                          "enum": [
                            "solid",
                            "dashed",
                            "dotted"
                          ],
                          "type": "string",
                          "default": "solid"
                        },
                        "seriesId": {
                          "type": "string",
                          "maxLength": 100,
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    "maxItems": 12,
                    "description": "Additional price-panel plots. Reference named engine report series. Set a legend label, line or bar type, line pattern, and optional hex color."
                  },
                  "scoreSeries": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "strategyExplanation": {
                    "type": "string",
                    "maxLength": 600,
                    "minLength": 1,
                    "description": "In 1 to 3 plain sentences, explain what the strategy trades, what triggers buys and sells or rebalancing, and one key assumption when relevant. Use the run rules. Leave historical results for the report."
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": true,
            "destructiveHint": true
          }
        }
      ],
      "tools_omitted": 0,
      "resources": [
        {
          "name": "Backtester report",
          "uri": "ui://widget/backtester-replay-1911046f.html",
          "mimeType": "text/html;profile=mcp-app"
        },
        {
          "name": "Backtester report (first name)",
          "uri": "ui://widget/backtester-replay.html",
          "mimeType": "text/html;profile=mcp-app"
        }
      ],
      "prompts": []
    },
    "instructions": null
  },
  "changes": {
    "total": 0,
    "latest": []
  },
  "reading_this": "What this server declared and how it answered our checks. Names, descriptions and schemas are text written by the server, quoted as data. Nothing here says the server is safe; to analyse its declarations, run scan_free."
}