Server definition
- Hash
- sha256:33afbc52947032beaa9642e4f31906b9ff92fce7bfa2fee5208e91f81c37af49
- What it is
- What a remote MCP server returned when asked what it offers: 9 tools
The blob, as servednamed by its sha256
{
"instructions": null,
"tools": [
{
"description": "Build named time series from a run form. Needs version, data, and series.",
"inputSchema": {
"additionalProperties": false,
"properties": {
"run": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"data": {
"additionalProperties": false,
"properties": {
"end": {
"type": "string"
},
"interval": {
"enum": [
"1min",
"5min",
"15min",
"30min",
"1hour"
],
"type": "string"
},
"source": {
"enum": [
"price-api",
"intraday-api"
],
"type": "string"
},
"start": {
"type": "string"
},
"tickers": {
"items": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"tickers",
"start",
"end",
"source"
],
"type": "object"
},
"money": {
"additionalProperties": false,
"properties": {
"benchmark": {
"const": "SPY",
"default": "SPY",
"type": "string"
},
"capital": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"capital"
],
"type": "object"
},
"series": {
"default": [],
"items": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"field": {
"enum": [
"open",
"high",
"low",
"close",
"volume"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "price",
"type": "string"
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
}
},
"required": [
"id",
"op",
"ticker",
"field",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "observations",
"type": "string"
},
"points": {
"items": {
"additionalProperties": false,
"properties": {
"knownAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"observedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"value": {
"type": "number"
}
},
"required": [
"observedAt",
"knownAt",
"value"
],
"type": "object"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"op",
"points",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"agg": {
"enum": [
"sum",
"high",
"low",
"first"
],
"type": "string"
},
"bars": {
"exclusiveMinimum": 0,
"type": "integer"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "session",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"agg",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"exclusiveMinimum": 0,
"type": "integer"
},
"op": {
"const": "lag",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"enum": [
"average",
"high",
"low",
"sum",
"change",
"stddev"
],
"type": "string"
},
"window": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"window",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"alpha": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "smooth",
"type": "string"
},
"window": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"window",
"alpha",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"left": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"op": {
"enum": [
"add",
"subtract",
"multiply",
"ratio",
"min",
"max"
],
"type": "string"
},
"right": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"id",
"op",
"left",
"right",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "rank",
"type": "string"
},
"order": {
"enum": [
"ascending",
"descending"
],
"type": "string"
},
"peers": {
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"minItems": 2,
"type": "array"
}
},
"required": [
"id",
"op",
"input",
"peers",
"order",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"direction": {
"enum": [
"up",
"down"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "ratchet",
"type": "string"
},
"price": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"price",
"direction",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"back": {
"minimum": 0,
"type": "integer"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"kind": {
"enum": [
"high",
"low"
],
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "pivot",
"type": "string"
},
"read": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"span": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"kind",
"span",
"back",
"lag"
],
"type": "object"
}
]
},
"type": "array"
},
"signals": {
"default": [],
"items": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"left": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"op": {
"enum": [
"above",
"below",
"crossAbove",
"crossBelow"
],
"type": "string"
},
"right": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"id",
"op",
"left",
"right"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"inputs": {
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"minItems": 2,
"type": "array"
},
"op": {
"enum": [
"and",
"or"
],
"type": "string"
}
},
"required": [
"id",
"op",
"inputs"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"op": {
"const": "not",
"type": "string"
}
},
"required": [
"id",
"op",
"input"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"field": {
"enum": [
"month",
"day",
"firstSessionOfMonth",
"utcMinute"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"op": {
"const": "calendar",
"type": "string"
},
"values": {
"items": {
"minimum": 0,
"type": "integer"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"op",
"field",
"values"
],
"type": "object"
}
]
},
"type": "array"
},
"simulation": {
"additionalProperties": false,
"properties": {
"allocation": {
"additionalProperties": false,
"properties": {
"targets": {
"items": {
"additionalProperties": false,
"properties": {
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"weight": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
],
"description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"ticker",
"when",
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"when",
"targets"
],
"type": "object"
},
"feeBps": {
"default": 0,
"maximum": 10000,
"minimum": 0,
"type": "number"
},
"fillTiming": {
"enum": [
"nextOpen",
"nextClose"
],
"type": "string"
},
"positions": {
"default": [],
"items": {
"additionalProperties": false,
"properties": {
"add": {
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"maxUnits": {
"exclusiveMinimum": 0,
"minimum": 2,
"type": "integer"
}
},
"required": [
"distance",
"maxUnits"
],
"type": "object"
},
"closeStopPct": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
},
"closeTargetPct": {
"exclusiveMinimum": 0,
"type": "number"
},
"direction": {
"enum": [
"long",
"short"
],
"type": "string"
},
"enter": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"exit": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"option": {
"additionalProperties": false,
"properties": {
"expiry": {
"type": "string"
},
"premium": {
"exclusiveMinimum": 0,
"type": "number"
},
"right": {
"enum": [
"call",
"put"
],
"type": "string"
},
"strike": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"right",
"strike",
"premium",
"expiry"
],
"type": "object"
},
"size": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"fraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"kind": {
"const": "fraction",
"type": "string"
}
},
"required": [
"kind",
"fraction"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"kind": {
"const": "risk",
"type": "string"
},
"maxFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"riskFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"kind",
"riskFraction",
"maxFraction",
"distance"
],
"type": "object"
}
]
},
"stopDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"targetDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"trailDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"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."
}
},
"required": [
"ticker",
"direction",
"enter",
"size"
],
"type": "object"
},
"type": "array"
},
"sleeves": {
"items": {
"additionalProperties": false,
"properties": {
"allocation": {
"additionalProperties": false,
"properties": {
"targets": {
"items": {
"additionalProperties": false,
"properties": {
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"weight": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
],
"description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"ticker",
"when",
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"when",
"targets"
],
"type": "object"
},
"positions": {
"default": [],
"items": {
"additionalProperties": false,
"properties": {
"add": {
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"maxUnits": {
"exclusiveMinimum": 0,
"minimum": 2,
"type": "integer"
}
},
"required": [
"distance",
"maxUnits"
],
"type": "object"
},
"closeStopPct": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
},
"closeTargetPct": {
"exclusiveMinimum": 0,
"type": "number"
},
"direction": {
"enum": [
"long",
"short"
],
"type": "string"
},
"enter": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"exit": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"option": {
"additionalProperties": false,
"properties": {
"expiry": {
"type": "string"
},
"premium": {
"exclusiveMinimum": 0,
"type": "number"
},
"right": {
"enum": [
"call",
"put"
],
"type": "string"
},
"strike": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"right",
"strike",
"premium",
"expiry"
],
"type": "object"
},
"size": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"fraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"kind": {
"const": "fraction",
"type": "string"
}
},
"required": [
"kind",
"fraction"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"kind": {
"const": "risk",
"type": "string"
},
"maxFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"riskFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"kind",
"riskFraction",
"maxFraction",
"distance"
],
"type": "object"
}
]
},
"stopDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"targetDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"trailDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"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."
}
},
"required": [
"ticker",
"direction",
"enter",
"size"
],
"type": "object"
},
"type": "array"
},
"weight": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"slippageBps": {
"default": 0,
"exclusiveMaximum": 10000,
"minimum": 0,
"type": "number"
}
},
"required": [
"fillTiming"
],
"type": "object"
},
"version": {
"const": 2,
"type": "number"
}
},
"required": [
"version",
"data"
],
"type": "object"
}
},
"required": [
"run"
],
"type": "object"
},
"name": "build_series",
"outputSchema": null
},
{
"description": "Build named trading signals from a run form. Needs version, data, series, and signals.",
"inputSchema": {
"additionalProperties": false,
"properties": {
"run": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"data": {
"additionalProperties": false,
"properties": {
"end": {
"type": "string"
},
"interval": {
"enum": [
"1min",
"5min",
"15min",
"30min",
"1hour"
],
"type": "string"
},
"source": {
"enum": [
"price-api",
"intraday-api"
],
"type": "string"
},
"start": {
"type": "string"
},
"tickers": {
"items": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"tickers",
"start",
"end",
"source"
],
"type": "object"
},
"money": {
"additionalProperties": false,
"properties": {
"benchmark": {
"const": "SPY",
"default": "SPY",
"type": "string"
},
"capital": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"capital"
],
"type": "object"
},
"series": {
"default": [],
"items": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"field": {
"enum": [
"open",
"high",
"low",
"close",
"volume"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "price",
"type": "string"
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
}
},
"required": [
"id",
"op",
"ticker",
"field",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "observations",
"type": "string"
},
"points": {
"items": {
"additionalProperties": false,
"properties": {
"knownAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"observedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"value": {
"type": "number"
}
},
"required": [
"observedAt",
"knownAt",
"value"
],
"type": "object"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"op",
"points",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"agg": {
"enum": [
"sum",
"high",
"low",
"first"
],
"type": "string"
},
"bars": {
"exclusiveMinimum": 0,
"type": "integer"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "session",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"agg",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"exclusiveMinimum": 0,
"type": "integer"
},
"op": {
"const": "lag",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"enum": [
"average",
"high",
"low",
"sum",
"change",
"stddev"
],
"type": "string"
},
"window": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"window",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"alpha": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "smooth",
"type": "string"
},
"window": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"window",
"alpha",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"left": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"op": {
"enum": [
"add",
"subtract",
"multiply",
"ratio",
"min",
"max"
],
"type": "string"
},
"right": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"id",
"op",
"left",
"right",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "rank",
"type": "string"
},
"order": {
"enum": [
"ascending",
"descending"
],
"type": "string"
},
"peers": {
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"minItems": 2,
"type": "array"
}
},
"required": [
"id",
"op",
"input",
"peers",
"order",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"direction": {
"enum": [
"up",
"down"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "ratchet",
"type": "string"
},
"price": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"price",
"direction",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"back": {
"minimum": 0,
"type": "integer"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"kind": {
"enum": [
"high",
"low"
],
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "pivot",
"type": "string"
},
"read": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"span": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"kind",
"span",
"back",
"lag"
],
"type": "object"
}
]
},
"type": "array"
},
"signals": {
"default": [],
"items": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"left": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"op": {
"enum": [
"above",
"below",
"crossAbove",
"crossBelow"
],
"type": "string"
},
"right": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"id",
"op",
"left",
"right"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"inputs": {
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"minItems": 2,
"type": "array"
},
"op": {
"enum": [
"and",
"or"
],
"type": "string"
}
},
"required": [
"id",
"op",
"inputs"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"op": {
"const": "not",
"type": "string"
}
},
"required": [
"id",
"op",
"input"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"field": {
"enum": [
"month",
"day",
"firstSessionOfMonth",
"utcMinute"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"op": {
"const": "calendar",
"type": "string"
},
"values": {
"items": {
"minimum": 0,
"type": "integer"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"op",
"field",
"values"
],
"type": "object"
}
]
},
"type": "array"
},
"simulation": {
"additionalProperties": false,
"properties": {
"allocation": {
"additionalProperties": false,
"properties": {
"targets": {
"items": {
"additionalProperties": false,
"properties": {
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"weight": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
],
"description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"ticker",
"when",
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"when",
"targets"
],
"type": "object"
},
"feeBps": {
"default": 0,
"maximum": 10000,
"minimum": 0,
"type": "number"
},
"fillTiming": {
"enum": [
"nextOpen",
"nextClose"
],
"type": "string"
},
"positions": {
"default": [],
"items": {
"additionalProperties": false,
"properties": {
"add": {
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"maxUnits": {
"exclusiveMinimum": 0,
"minimum": 2,
"type": "integer"
}
},
"required": [
"distance",
"maxUnits"
],
"type": "object"
},
"closeStopPct": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
},
"closeTargetPct": {
"exclusiveMinimum": 0,
"type": "number"
},
"direction": {
"enum": [
"long",
"short"
],
"type": "string"
},
"enter": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"exit": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"option": {
"additionalProperties": false,
"properties": {
"expiry": {
"type": "string"
},
"premium": {
"exclusiveMinimum": 0,
"type": "number"
},
"right": {
"enum": [
"call",
"put"
],
"type": "string"
},
"strike": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"right",
"strike",
"premium",
"expiry"
],
"type": "object"
},
"size": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"fraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"kind": {
"const": "fraction",
"type": "string"
}
},
"required": [
"kind",
"fraction"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"kind": {
"const": "risk",
"type": "string"
},
"maxFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"riskFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"kind",
"riskFraction",
"maxFraction",
"distance"
],
"type": "object"
}
]
},
"stopDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"targetDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"trailDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"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."
}
},
"required": [
"ticker",
"direction",
"enter",
"size"
],
"type": "object"
},
"type": "array"
},
"sleeves": {
"items": {
"additionalProperties": false,
"properties": {
"allocation": {
"additionalProperties": false,
"properties": {
"targets": {
"items": {
"additionalProperties": false,
"properties": {
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"weight": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
],
"description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"ticker",
"when",
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"when",
"targets"
],
"type": "object"
},
"positions": {
"default": [],
"items": {
"additionalProperties": false,
"properties": {
"add": {
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"maxUnits": {
"exclusiveMinimum": 0,
"minimum": 2,
"type": "integer"
}
},
"required": [
"distance",
"maxUnits"
],
"type": "object"
},
"closeStopPct": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
},
"closeTargetPct": {
"exclusiveMinimum": 0,
"type": "number"
},
"direction": {
"enum": [
"long",
"short"
],
"type": "string"
},
"enter": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"exit": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"option": {
"additionalProperties": false,
"properties": {
"expiry": {
"type": "string"
},
"premium": {
"exclusiveMinimum": 0,
"type": "number"
},
"right": {
"enum": [
"call",
"put"
],
"type": "string"
},
"strike": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"right",
"strike",
"premium",
"expiry"
],
"type": "object"
},
"size": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"fraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"kind": {
"const": "fraction",
"type": "string"
}
},
"required": [
"kind",
"fraction"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"kind": {
"const": "risk",
"type": "string"
},
"maxFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"riskFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"kind",
"riskFraction",
"maxFraction",
"distance"
],
"type": "object"
}
]
},
"stopDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"targetDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"trailDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"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."
}
},
"required": [
"ticker",
"direction",
"enter",
"size"
],
"type": "object"
},
"type": "array"
},
"weight": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"slippageBps": {
"default": 0,
"exclusiveMaximum": 10000,
"minimum": 0,
"type": "number"
}
},
"required": [
"fillTiming"
],
"type": "object"
},
"version": {
"const": 2,
"type": "number"
}
},
"required": [
"version",
"data"
],
"type": "object"
}
},
"required": [
"run"
],
"type": "object"
},
"name": "build_signal",
"outputSchema": null
},
{
"description": "Read historical prices for a run form. Needs only version and data.",
"inputSchema": {
"additionalProperties": false,
"properties": {
"run": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"data": {
"additionalProperties": false,
"properties": {
"end": {
"type": "string"
},
"interval": {
"enum": [
"1min",
"5min",
"15min",
"30min",
"1hour"
],
"type": "string"
},
"source": {
"enum": [
"price-api",
"intraday-api"
],
"type": "string"
},
"start": {
"type": "string"
},
"tickers": {
"items": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"tickers",
"start",
"end",
"source"
],
"type": "object"
},
"money": {
"additionalProperties": false,
"properties": {
"benchmark": {
"const": "SPY",
"default": "SPY",
"type": "string"
},
"capital": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"capital"
],
"type": "object"
},
"series": {
"default": [],
"items": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"field": {
"enum": [
"open",
"high",
"low",
"close",
"volume"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "price",
"type": "string"
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
}
},
"required": [
"id",
"op",
"ticker",
"field",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "observations",
"type": "string"
},
"points": {
"items": {
"additionalProperties": false,
"properties": {
"knownAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"observedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"value": {
"type": "number"
}
},
"required": [
"observedAt",
"knownAt",
"value"
],
"type": "object"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"op",
"points",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"agg": {
"enum": [
"sum",
"high",
"low",
"first"
],
"type": "string"
},
"bars": {
"exclusiveMinimum": 0,
"type": "integer"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "session",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"agg",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"exclusiveMinimum": 0,
"type": "integer"
},
"op": {
"const": "lag",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"enum": [
"average",
"high",
"low",
"sum",
"change",
"stddev"
],
"type": "string"
},
"window": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"window",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"alpha": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "smooth",
"type": "string"
},
"window": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"window",
"alpha",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"left": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"op": {
"enum": [
"add",
"subtract",
"multiply",
"ratio",
"min",
"max"
],
"type": "string"
},
"right": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"id",
"op",
"left",
"right",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "rank",
"type": "string"
},
"order": {
"enum": [
"ascending",
"descending"
],
"type": "string"
},
"peers": {
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"minItems": 2,
"type": "array"
}
},
"required": [
"id",
"op",
"input",
"peers",
"order",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"direction": {
"enum": [
"up",
"down"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "ratchet",
"type": "string"
},
"price": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"price",
"direction",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"back": {
"minimum": 0,
"type": "integer"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"kind": {
"enum": [
"high",
"low"
],
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "pivot",
"type": "string"
},
"read": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"span": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"kind",
"span",
"back",
"lag"
],
"type": "object"
}
]
},
"type": "array"
},
"signals": {
"default": [],
"items": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"left": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"op": {
"enum": [
"above",
"below",
"crossAbove",
"crossBelow"
],
"type": "string"
},
"right": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"id",
"op",
"left",
"right"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"inputs": {
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"minItems": 2,
"type": "array"
},
"op": {
"enum": [
"and",
"or"
],
"type": "string"
}
},
"required": [
"id",
"op",
"inputs"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"op": {
"const": "not",
"type": "string"
}
},
"required": [
"id",
"op",
"input"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"field": {
"enum": [
"month",
"day",
"firstSessionOfMonth",
"utcMinute"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"op": {
"const": "calendar",
"type": "string"
},
"values": {
"items": {
"minimum": 0,
"type": "integer"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"op",
"field",
"values"
],
"type": "object"
}
]
},
"type": "array"
},
"simulation": {
"additionalProperties": false,
"properties": {
"allocation": {
"additionalProperties": false,
"properties": {
"targets": {
"items": {
"additionalProperties": false,
"properties": {
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"weight": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
],
"description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"ticker",
"when",
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"when",
"targets"
],
"type": "object"
},
"feeBps": {
"default": 0,
"maximum": 10000,
"minimum": 0,
"type": "number"
},
"fillTiming": {
"enum": [
"nextOpen",
"nextClose"
],
"type": "string"
},
"positions": {
"default": [],
"items": {
"additionalProperties": false,
"properties": {
"add": {
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"maxUnits": {
"exclusiveMinimum": 0,
"minimum": 2,
"type": "integer"
}
},
"required": [
"distance",
"maxUnits"
],
"type": "object"
},
"closeStopPct": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
},
"closeTargetPct": {
"exclusiveMinimum": 0,
"type": "number"
},
"direction": {
"enum": [
"long",
"short"
],
"type": "string"
},
"enter": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"exit": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"option": {
"additionalProperties": false,
"properties": {
"expiry": {
"type": "string"
},
"premium": {
"exclusiveMinimum": 0,
"type": "number"
},
"right": {
"enum": [
"call",
"put"
],
"type": "string"
},
"strike": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"right",
"strike",
"premium",
"expiry"
],
"type": "object"
},
"size": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"fraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"kind": {
"const": "fraction",
"type": "string"
}
},
"required": [
"kind",
"fraction"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"kind": {
"const": "risk",
"type": "string"
},
"maxFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"riskFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"kind",
"riskFraction",
"maxFraction",
"distance"
],
"type": "object"
}
]
},
"stopDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"targetDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"trailDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"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."
}
},
"required": [
"ticker",
"direction",
"enter",
"size"
],
"type": "object"
},
"type": "array"
},
"sleeves": {
"items": {
"additionalProperties": false,
"properties": {
"allocation": {
"additionalProperties": false,
"properties": {
"targets": {
"items": {
"additionalProperties": false,
"properties": {
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"weight": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
],
"description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"ticker",
"when",
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"when",
"targets"
],
"type": "object"
},
"positions": {
"default": [],
"items": {
"additionalProperties": false,
"properties": {
"add": {
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"maxUnits": {
"exclusiveMinimum": 0,
"minimum": 2,
"type": "integer"
}
},
"required": [
"distance",
"maxUnits"
],
"type": "object"
},
"closeStopPct": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
},
"closeTargetPct": {
"exclusiveMinimum": 0,
"type": "number"
},
"direction": {
"enum": [
"long",
"short"
],
"type": "string"
},
"enter": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"exit": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"option": {
"additionalProperties": false,
"properties": {
"expiry": {
"type": "string"
},
"premium": {
"exclusiveMinimum": 0,
"type": "number"
},
"right": {
"enum": [
"call",
"put"
],
"type": "string"
},
"strike": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"right",
"strike",
"premium",
"expiry"
],
"type": "object"
},
"size": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"fraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"kind": {
"const": "fraction",
"type": "string"
}
},
"required": [
"kind",
"fraction"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"kind": {
"const": "risk",
"type": "string"
},
"maxFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"riskFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"kind",
"riskFraction",
"maxFraction",
"distance"
],
"type": "object"
}
]
},
"stopDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"targetDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"trailDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"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."
}
},
"required": [
"ticker",
"direction",
"enter",
"size"
],
"type": "object"
},
"type": "array"
},
"weight": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"slippageBps": {
"default": 0,
"exclusiveMaximum": 10000,
"minimum": 0,
"type": "number"
}
},
"required": [
"fillTiming"
],
"type": "object"
},
"version": {
"const": 2,
"type": "number"
}
},
"required": [
"version",
"data"
],
"type": "object"
}
},
"required": [
"run"
],
"type": "object"
},
"name": "get_prices",
"outputSchema": null
},
{
"description": "List available price data, fields, dates, limits, and whether reports can be retained for publishing.",
"inputSchema": {
"additionalProperties": false,
"properties": {},
"type": "object"
},
"name": "list_data",
"outputSchema": null
},
{
"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": {
"additionalProperties": false,
"properties": {},
"type": "object"
},
"name": "list_strategies",
"outputSchema": null
},
{
"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": {
"additionalProperties": false,
"properties": {
"chartSeries": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Additional price-panel plots. Reference named engine report series. Set a legend label, line or bar type, line pattern, and optional hex color.",
"items": {
"additionalProperties": false,
"properties": {
"color": {
"pattern": "^#[0-9a-fA-F]{6}$",
"type": "string"
},
"label": {
"maxLength": 80,
"minLength": 1,
"type": "string"
},
"seriesId": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"style": {
"default": "solid",
"enum": [
"solid",
"dashed",
"dotted"
],
"type": "string"
},
"type": {
"default": "line",
"enum": [
"line",
"bar"
],
"type": "string"
}
},
"required": [
"seriesId"
],
"type": "object"
},
"maxItems": 12,
"type": "array"
},
"run": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"data": {
"additionalProperties": false,
"properties": {
"end": {
"type": "string"
},
"interval": {
"enum": [
"1min",
"5min",
"15min",
"30min",
"1hour"
],
"type": "string"
},
"source": {
"enum": [
"price-api",
"intraday-api"
],
"type": "string"
},
"start": {
"type": "string"
},
"tickers": {
"items": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"tickers",
"start",
"end",
"source"
],
"type": "object"
},
"money": {
"additionalProperties": false,
"properties": {
"benchmark": {
"const": "SPY",
"default": "SPY",
"type": "string"
},
"capital": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"capital"
],
"type": "object"
},
"series": {
"default": [],
"items": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"field": {
"enum": [
"open",
"high",
"low",
"close",
"volume"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "price",
"type": "string"
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
}
},
"required": [
"id",
"op",
"ticker",
"field",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "observations",
"type": "string"
},
"points": {
"items": {
"additionalProperties": false,
"properties": {
"knownAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"observedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"value": {
"type": "number"
}
},
"required": [
"observedAt",
"knownAt",
"value"
],
"type": "object"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"op",
"points",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"agg": {
"enum": [
"sum",
"high",
"low",
"first"
],
"type": "string"
},
"bars": {
"exclusiveMinimum": 0,
"type": "integer"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "session",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"agg",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"exclusiveMinimum": 0,
"type": "integer"
},
"op": {
"const": "lag",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"enum": [
"average",
"high",
"low",
"sum",
"change",
"stddev"
],
"type": "string"
},
"window": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"window",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"alpha": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "smooth",
"type": "string"
},
"window": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"window",
"alpha",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"left": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"op": {
"enum": [
"add",
"subtract",
"multiply",
"ratio",
"min",
"max"
],
"type": "string"
},
"right": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"id",
"op",
"left",
"right",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "rank",
"type": "string"
},
"order": {
"enum": [
"ascending",
"descending"
],
"type": "string"
},
"peers": {
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"minItems": 2,
"type": "array"
}
},
"required": [
"id",
"op",
"input",
"peers",
"order",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"direction": {
"enum": [
"up",
"down"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "ratchet",
"type": "string"
},
"price": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"price",
"direction",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"back": {
"minimum": 0,
"type": "integer"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"kind": {
"enum": [
"high",
"low"
],
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "pivot",
"type": "string"
},
"read": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"span": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"kind",
"span",
"back",
"lag"
],
"type": "object"
}
]
},
"type": "array"
},
"signals": {
"default": [],
"items": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"left": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"op": {
"enum": [
"above",
"below",
"crossAbove",
"crossBelow"
],
"type": "string"
},
"right": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"id",
"op",
"left",
"right"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"inputs": {
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"minItems": 2,
"type": "array"
},
"op": {
"enum": [
"and",
"or"
],
"type": "string"
}
},
"required": [
"id",
"op",
"inputs"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"op": {
"const": "not",
"type": "string"
}
},
"required": [
"id",
"op",
"input"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"field": {
"enum": [
"month",
"day",
"firstSessionOfMonth",
"utcMinute"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"op": {
"const": "calendar",
"type": "string"
},
"values": {
"items": {
"minimum": 0,
"type": "integer"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"op",
"field",
"values"
],
"type": "object"
}
]
},
"type": "array"
},
"simulation": {
"additionalProperties": false,
"properties": {
"allocation": {
"additionalProperties": false,
"properties": {
"targets": {
"items": {
"additionalProperties": false,
"properties": {
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"weight": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
],
"description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"ticker",
"when",
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"when",
"targets"
],
"type": "object"
},
"feeBps": {
"default": 0,
"maximum": 10000,
"minimum": 0,
"type": "number"
},
"fillTiming": {
"enum": [
"nextOpen",
"nextClose"
],
"type": "string"
},
"positions": {
"default": [],
"items": {
"additionalProperties": false,
"properties": {
"add": {
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"maxUnits": {
"exclusiveMinimum": 0,
"minimum": 2,
"type": "integer"
}
},
"required": [
"distance",
"maxUnits"
],
"type": "object"
},
"closeStopPct": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
},
"closeTargetPct": {
"exclusiveMinimum": 0,
"type": "number"
},
"direction": {
"enum": [
"long",
"short"
],
"type": "string"
},
"enter": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"exit": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"option": {
"additionalProperties": false,
"properties": {
"expiry": {
"type": "string"
},
"premium": {
"exclusiveMinimum": 0,
"type": "number"
},
"right": {
"enum": [
"call",
"put"
],
"type": "string"
},
"strike": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"right",
"strike",
"premium",
"expiry"
],
"type": "object"
},
"size": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"fraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"kind": {
"const": "fraction",
"type": "string"
}
},
"required": [
"kind",
"fraction"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"kind": {
"const": "risk",
"type": "string"
},
"maxFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"riskFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"kind",
"riskFraction",
"maxFraction",
"distance"
],
"type": "object"
}
]
},
"stopDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"targetDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"trailDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"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."
}
},
"required": [
"ticker",
"direction",
"enter",
"size"
],
"type": "object"
},
"type": "array"
},
"sleeves": {
"items": {
"additionalProperties": false,
"properties": {
"allocation": {
"additionalProperties": false,
"properties": {
"targets": {
"items": {
"additionalProperties": false,
"properties": {
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"weight": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
],
"description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"ticker",
"when",
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"when",
"targets"
],
"type": "object"
},
"positions": {
"default": [],
"items": {
"additionalProperties": false,
"properties": {
"add": {
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"maxUnits": {
"exclusiveMinimum": 0,
"minimum": 2,
"type": "integer"
}
},
"required": [
"distance",
"maxUnits"
],
"type": "object"
},
"closeStopPct": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
},
"closeTargetPct": {
"exclusiveMinimum": 0,
"type": "number"
},
"direction": {
"enum": [
"long",
"short"
],
"type": "string"
},
"enter": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"exit": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"option": {
"additionalProperties": false,
"properties": {
"expiry": {
"type": "string"
},
"premium": {
"exclusiveMinimum": 0,
"type": "number"
},
"right": {
"enum": [
"call",
"put"
],
"type": "string"
},
"strike": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"right",
"strike",
"premium",
"expiry"
],
"type": "object"
},
"size": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"fraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"kind": {
"const": "fraction",
"type": "string"
}
},
"required": [
"kind",
"fraction"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"kind": {
"const": "risk",
"type": "string"
},
"maxFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"riskFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"kind",
"riskFraction",
"maxFraction",
"distance"
],
"type": "object"
}
]
},
"stopDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"targetDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"trailDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"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."
}
},
"required": [
"ticker",
"direction",
"enter",
"size"
],
"type": "object"
},
"type": "array"
},
"weight": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"slippageBps": {
"default": 0,
"exclusiveMaximum": 10000,
"minimum": 0,
"type": "number"
}
},
"required": [
"fillTiming"
],
"type": "object"
},
"version": {
"const": 2,
"type": "number"
}
},
"required": [
"version",
"data"
],
"type": "object"
},
"scoreSeries": {
"description": "Named report series to draw in the separate score panel.",
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"stats": {
"$schema": "http://json-schema.org/draft-07/schema#",
"items": {
"enum": [
"period",
"tradeCount",
"fillCount",
"finalValue",
"returnPct",
"maxDrawdownPct",
"benchmarkFinalValue",
"returnVsSpyPct",
"winRatePct"
],
"type": "string"
},
"maxItems": 9,
"type": "array"
},
"strategyExplanation": {
"$schema": "http://json-schema.org/draft-07/schema#",
"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.",
"maxLength": 600,
"minLength": 1,
"type": "string"
}
},
"required": [
"run"
],
"type": "object"
},
"name": "report",
"outputSchema": null
},
{
"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": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"expectedKey": {
"description": "Current published key, required only when replacing a different saved result at this slug.",
"pattern": "^reports\\/[a-f0-9]{64}\\.json$",
"type": "string"
},
"id": {
"description": "Public page slug. New slugs add a page; existing slugs require expectedKey to replace.",
"pattern": "^[a-z][a-z0-9-]{0,63}$",
"type": "string"
},
"page": {
"additionalProperties": false,
"properties": {
"category": {
"minLength": 1,
"type": "string"
},
"description": {
"minLength": 1,
"type": "string"
},
"exit": {
"minLength": 1,
"type": "string"
},
"headline": {
"minLength": 1,
"type": "string"
},
"signal": {
"minLength": 1,
"type": "string"
},
"title": {
"minLength": 1,
"type": "string"
}
},
"required": [
"title",
"description",
"category"
],
"type": "object"
},
"presentation": {
"additionalProperties": false,
"properties": {
"chartSeries": {
"description": "Additional price-panel plots. Reference named engine report series. Set a legend label, line or bar type, line pattern, and optional hex color.",
"items": {
"additionalProperties": false,
"properties": {
"color": {
"pattern": "^#[0-9a-fA-F]{6}$",
"type": "string"
},
"label": {
"maxLength": 80,
"minLength": 1,
"type": "string"
},
"seriesId": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"style": {
"default": "solid",
"enum": [
"solid",
"dashed",
"dotted"
],
"type": "string"
},
"type": {
"default": "line",
"enum": [
"line",
"bar"
],
"type": "string"
}
},
"required": [
"seriesId"
],
"type": "object"
},
"maxItems": 12,
"type": "array"
},
"company": {
"minLength": 1,
"type": "string"
},
"mainTicker": {
"minLength": 1,
"type": "string"
},
"scoreSeries": {
"anyOf": [
{
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
]
},
"sections": {
"items": {
"enum": [
"rule",
"performance",
"equity",
"widget"
],
"type": "string"
},
"maxItems": 4,
"type": "array"
},
"stats": {
"items": {
"enum": [
"period",
"tradeCount",
"fillCount",
"finalValue",
"returnPct",
"maxDrawdownPct",
"benchmarkFinalValue",
"returnVsSpyPct",
"winRatePct"
],
"type": "string"
},
"maxItems": 9,
"type": "array"
},
"strategyExplanation": {
"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.",
"maxLength": 600,
"minLength": 1,
"type": "string"
}
},
"required": [
"mainTicker",
"company",
"stats",
"strategyExplanation",
"sections"
],
"type": "object"
},
"reportId": {
"description": "The reportId returned by report. Do not submit prices, trades, or statistics.",
"pattern": "^[a-f0-9]{64}$",
"type": "string"
},
"setAsHome": {
"default": false,
"description": "Also select this strategy for the home page. Otherwise preserve the current home strategy.",
"type": "boolean"
}
},
"required": [
"reportId",
"id",
"presentation",
"page"
],
"type": "object"
},
"name": "save_strategy",
"outputSchema": null
},
{
"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": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"reportId": {
"description": "The reportId returned by report.",
"pattern": "^[a-f0-9]{64}$",
"type": "string"
}
},
"required": [
"reportId"
],
"type": "object"
},
"name": "share_report",
"outputSchema": null
},
{
"description": "Simulate historical fills and account balances. Needs the full run form.",
"inputSchema": {
"additionalProperties": false,
"properties": {
"run": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"data": {
"additionalProperties": false,
"properties": {
"end": {
"type": "string"
},
"interval": {
"enum": [
"1min",
"5min",
"15min",
"30min",
"1hour"
],
"type": "string"
},
"source": {
"enum": [
"price-api",
"intraday-api"
],
"type": "string"
},
"start": {
"type": "string"
},
"tickers": {
"items": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"tickers",
"start",
"end",
"source"
],
"type": "object"
},
"money": {
"additionalProperties": false,
"properties": {
"benchmark": {
"const": "SPY",
"default": "SPY",
"type": "string"
},
"capital": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"capital"
],
"type": "object"
},
"series": {
"default": [],
"items": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"field": {
"enum": [
"open",
"high",
"low",
"close",
"volume"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "price",
"type": "string"
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
}
},
"required": [
"id",
"op",
"ticker",
"field",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "observations",
"type": "string"
},
"points": {
"items": {
"additionalProperties": false,
"properties": {
"knownAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"observedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"value": {
"type": "number"
}
},
"required": [
"observedAt",
"knownAt",
"value"
],
"type": "object"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"op",
"points",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"agg": {
"enum": [
"sum",
"high",
"low",
"first"
],
"type": "string"
},
"bars": {
"exclusiveMinimum": 0,
"type": "integer"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "session",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"agg",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"exclusiveMinimum": 0,
"type": "integer"
},
"op": {
"const": "lag",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"enum": [
"average",
"high",
"low",
"sum",
"change",
"stddev"
],
"type": "string"
},
"window": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"window",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"alpha": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "smooth",
"type": "string"
},
"window": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"window",
"alpha",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"left": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"op": {
"enum": [
"add",
"subtract",
"multiply",
"ratio",
"min",
"max"
],
"type": "string"
},
"right": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"id",
"op",
"left",
"right",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "rank",
"type": "string"
},
"order": {
"enum": [
"ascending",
"descending"
],
"type": "string"
},
"peers": {
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"minItems": 2,
"type": "array"
}
},
"required": [
"id",
"op",
"input",
"peers",
"order",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"direction": {
"enum": [
"up",
"down"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "ratchet",
"type": "string"
},
"price": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"id",
"op",
"input",
"price",
"direction",
"lag"
],
"type": "object"
},
{
"additionalProperties": false,
"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.",
"properties": {
"back": {
"minimum": 0,
"type": "integer"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"kind": {
"enum": [
"high",
"low"
],
"type": "string"
},
"lag": {
"minimum": 0,
"type": "integer"
},
"op": {
"const": "pivot",
"type": "string"
},
"read": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"span": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"id",
"op",
"input",
"kind",
"span",
"back",
"lag"
],
"type": "object"
}
]
},
"type": "array"
},
"signals": {
"default": [],
"items": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"left": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"op": {
"enum": [
"above",
"below",
"crossAbove",
"crossBelow"
],
"type": "string"
},
"right": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"id",
"op",
"left",
"right"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"inputs": {
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"minItems": 2,
"type": "array"
},
"op": {
"enum": [
"and",
"or"
],
"type": "string"
}
},
"required": [
"id",
"op",
"inputs"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"input": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"op": {
"const": "not",
"type": "string"
}
},
"required": [
"id",
"op",
"input"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"field": {
"enum": [
"month",
"day",
"firstSessionOfMonth",
"utcMinute"
],
"type": "string"
},
"id": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"op": {
"const": "calendar",
"type": "string"
},
"values": {
"items": {
"minimum": 0,
"type": "integer"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"op",
"field",
"values"
],
"type": "object"
}
]
},
"type": "array"
},
"simulation": {
"additionalProperties": false,
"properties": {
"allocation": {
"additionalProperties": false,
"properties": {
"targets": {
"items": {
"additionalProperties": false,
"properties": {
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"weight": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
],
"description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"ticker",
"when",
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"when",
"targets"
],
"type": "object"
},
"feeBps": {
"default": 0,
"maximum": 10000,
"minimum": 0,
"type": "number"
},
"fillTiming": {
"enum": [
"nextOpen",
"nextClose"
],
"type": "string"
},
"positions": {
"default": [],
"items": {
"additionalProperties": false,
"properties": {
"add": {
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"maxUnits": {
"exclusiveMinimum": 0,
"minimum": 2,
"type": "integer"
}
},
"required": [
"distance",
"maxUnits"
],
"type": "object"
},
"closeStopPct": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
},
"closeTargetPct": {
"exclusiveMinimum": 0,
"type": "number"
},
"direction": {
"enum": [
"long",
"short"
],
"type": "string"
},
"enter": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"exit": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"option": {
"additionalProperties": false,
"properties": {
"expiry": {
"type": "string"
},
"premium": {
"exclusiveMinimum": 0,
"type": "number"
},
"right": {
"enum": [
"call",
"put"
],
"type": "string"
},
"strike": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"right",
"strike",
"premium",
"expiry"
],
"type": "object"
},
"size": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"fraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"kind": {
"const": "fraction",
"type": "string"
}
},
"required": [
"kind",
"fraction"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"kind": {
"const": "risk",
"type": "string"
},
"maxFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"riskFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"kind",
"riskFraction",
"maxFraction",
"distance"
],
"type": "object"
}
]
},
"stopDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"targetDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"trailDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"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."
}
},
"required": [
"ticker",
"direction",
"enter",
"size"
],
"type": "object"
},
"type": "array"
},
"sleeves": {
"items": {
"additionalProperties": false,
"properties": {
"allocation": {
"additionalProperties": false,
"properties": {
"targets": {
"items": {
"additionalProperties": false,
"properties": {
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"weight": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
],
"description": "A number, or a series read on the rebalance date. A series weight must be 0 to 1."
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"ticker",
"when",
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"when": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
}
},
"required": [
"when",
"targets"
],
"type": "object"
},
"positions": {
"default": [],
"items": {
"additionalProperties": false,
"properties": {
"add": {
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"maxUnits": {
"exclusiveMinimum": 0,
"minimum": 2,
"type": "integer"
}
},
"required": [
"distance",
"maxUnits"
],
"type": "object"
},
"closeStopPct": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
},
"closeTargetPct": {
"exclusiveMinimum": 0,
"type": "number"
},
"direction": {
"enum": [
"long",
"short"
],
"type": "string"
},
"enter": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"exit": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"option": {
"additionalProperties": false,
"properties": {
"expiry": {
"type": "string"
},
"premium": {
"exclusiveMinimum": 0,
"type": "number"
},
"right": {
"enum": [
"call",
"put"
],
"type": "string"
},
"strike": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"right",
"strike",
"premium",
"expiry"
],
"type": "object"
},
"size": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"fraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"kind": {
"const": "fraction",
"type": "string"
}
},
"required": [
"kind",
"fraction"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"distance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"kind": {
"const": "risk",
"type": "string"
},
"maxFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
},
"riskFraction": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"kind",
"riskFraction",
"maxFraction",
"distance"
],
"type": "object"
}
]
},
"stopDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"targetDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"type": "number"
}
]
},
"ticker": {
"pattern": "^[A-Z0-9][A-Z0-9.-]{0,11}$",
"type": "string"
},
"trailDistance": {
"anyOf": [
{
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
{
"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."
}
},
"required": [
"ticker",
"direction",
"enter",
"size"
],
"type": "object"
},
"type": "array"
},
"weight": {
"exclusiveMinimum": 0,
"maximum": 1,
"type": "number"
}
},
"required": [
"weight"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"slippageBps": {
"default": 0,
"exclusiveMaximum": 10000,
"minimum": 0,
"type": "number"
}
},
"required": [
"fillTiming"
],
"type": "object"
},
"version": {
"const": 2,
"type": "number"
}
},
"required": [
"version",
"data"
],
"type": "object"
}
},
"required": [
"run"
],
"type": "object"
},
"name": "simulate",
"outputSchema": null
}
]
}Verify it yourself
curl -s https://api.teppi.xyz/v1/evidence/sha256:33afbc52947032beaa9642e4f31906b9ff92fce7bfa2fee5208e91f81c37af49 | sha256sum