Backtester MCP
An MCP server that allows AI agents to test trading rules on historical daily prices. It simulates fills with user-defined fees and slippage, compares results against the SPY benchmark, and provides detailed trade logs and equity curves without placing live trades.
Endpoint and access
No sign-in to connect and list tools. Individual tools may still need a vendor account, credentials, or permissions; check the documented prerequisites.
https://backtester.daenadigital.com/mcpWhat its tools do
9 tools, grouped by the hints the server advertises. Hints are self-declared, not verified behavior.
Can change data (2)
Checks and signals
Each line is separate evidence, not a trust score.
- Passed Endpoint answered the live check ·
- Uptime 100% over 90 days
- Availability 3 of 3 checks passed in 30 days
About Backtester MCP
The Backtester MCP server enables AI agents to evaluate trading strategies using historical daily price data. It simulates trade fills based on user-defined fees and slippage parameters, then compares the resulting performance against the SPY benchmark. The server generates detailed trade logs and equity curves to help analyze strategy effectiveness without executing live market orders.
This server is suitable for testing plain-words trading rules, replaying saved backtest trades, and integrating a backtesting engine into agents such as Claude or ChatGPT. It allows users to build series, define signals, and report on strategy performance using a set of nine specific tools.
Connection to the server requires no sign-in or authentication. However, individual tools may still require a vendor account, credentials, or specific permissions. Users must check the documented prerequisites for each tool before attempting to execute tasks.
What you can do with it
- Test a plain-words trading rule on historical prices
- Compare strategy performance against SPY benchmark
- Replay saved backtest trades and equity curves
- Integrate backtesting engine into Claude or ChatGPT agents
Source and maintenance
Protocol and capabilities
- Server
- backtester 2.1.0
- MCP protocol negotiated in check
- 2025-11-25
- Tools
- 9 advertised
- Resources
- 2 advertised
- Resource templates
- 1 advertised
- Prompts
- Not advertised
{
"tools": {
"listChanged": true
},
"resources": {
"listChanged": true
}
}Tools
9 advertised
list_data — List available data
List available price data, fields, dates, limits, and whether reports can be retained for publishing.
{
"type": "object",
"properties": {},
"additionalProperties": false
}{
"readOnlyHint": true
}get_prices — Get historical prices
Read historical prices for a run form. Needs only version and data.
{
"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
}{
"readOnlyHint": true
}build_series — Build data series
Build named time series from a run form. Needs version, data, and series.
{
"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
}{
"readOnlyHint": true
}build_signal — Build trading signals
Build named trading signals from a run form. Needs version, data, series, and signals.
{
"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
}{
"readOnlyHint": true
}simulate — Simulate past trades
Simulate historical fills and account balances. Needs the full run form.
{
"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
}{
"readOnlyHint": true
}report — Run a backtest report
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.
{
"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
}{
"readOnlyHint": true
}share_report — Share a report publicly
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.
{
"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
}{
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}list_strategies — List saved strategies
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.
{
"type": "object",
"properties": {},
"additionalProperties": false
}{
"readOnlyHint": true
}save_strategy — Publish a report to the public website
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.
{
"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
}{
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": true
}Prompts
Not advertised
Resources
2 advertised
Backtester report
ui://widget/backtester-replay-1911046f.htmlBacktester report (first name)
ui://widget/backtester-replay.htmlBacktester report (earlier versions)
ui://widget/backtester-replay-{version}.html90-day uptime
A lightweight connection check about every six hours, sampled on hosts with many listings. It shows the server answered, not that its tools work.
- 2026-11-09: 2 of 2 checks answered
- 2026-11-10: 2 of 2 checks answered
- 2026-11-11: 1 of 1 checks answered
- 2026-11-12: 1 of 1 checks answered
- 2026-11-14: 1 of 1 checks answered
- 2026-11-15: 2 of 2 checks answered
- 2026-11-16: 4 of 4 checks answered
- 2026-11-17: 5 of 5 checks answered
- 2026-11-18: 5 of 5 checks answered
- 2026-11-19: 4 of 4 checks answered
- 2026-11-20: 2 of 2 checks answered
- 2026-11-21: 4 of 4 checks answered
- 2026-11-22: 4 of 4 checks answered
- 2026-11-23: 4 of 4 checks answered
- 2026-11-24: 4 of 4 checks answered
- 2026-11-25: 4 of 4 checks answered
- 2026-11-26: 4 of 4 checks answered
- 2026-11-27: 2 of 2 checks answered
30-day availability
Aggregated from read-only remote checks; this is not a tool-execution or security guarantee.
- Successful checks
- 3 of 3 (100%)
- Average latency
- 1407 ms
- 95th percentile latency
- 1856 ms
Maintenance history
Public check and source-refresh events. Editorial and ownership records remain private.
- · probe · passed · 1901 ms · 9 tool(s), 2 resource(s), 1 resource template(s)
- · probe · passed · 1454 ms · metadata changed · 9 tool(s), 2 resource(s), 1 resource template(s)
- · probe · passed · 865 ms · metadata changed · 9 tool(s), 2 resource(s), 1 resource template(s)
Connect from your client
Each snippet registers the same endpoint; pick the client you use.
Claude Code
claude mcp add --transport http backtester-mcp https://backtester.daenadigital.com/mcpCodex
codex mcp add backtester-mcp --url https://backtester.daenadigital.com/mcpCursor
{
"mcpServers": {
"backtester-mcp": {
"url": "https://backtester.daenadigital.com/mcp"
}
}
}Cline
{
"mcpServers": {
"backtester-mcp": {
"type": "streamableHttp",
"url": "https://backtester.daenadigital.com/mcp",
"disabled": false
}
}
}VS Code
{
"servers": {
"backtester-mcp": {
"type": "http",
"url": "https://backtester.daenadigital.com/mcp"
}
}
}Gemini CLI
gemini mcp add --transport http backtester-mcp https://backtester.daenadigital.com/mcpClaude Desktop
https://backtester.daenadigital.com/mcpWindsurf
{
"mcpServers": {
"backtester-mcp": {
"serverUrl": "https://backtester.daenadigital.com/mcp"
}
}
}Let your agent find its tools
Find servers like Backtester MCP from your agent. Add Koskamo once to search the index for endpoints, access requirements, and client setup. Public discovery needs no key.
Other data and analytics servers
Frequently asked questions
- Does the server execute live trades?
- No. The server simulates fills and provides trade logs and equity curves without placing live trades. It is designed for historical analysis and strategy testing only.
- What are the prerequisites for using the tools?
- While connecting to the server requires no sign-in, individual tools may still need a vendor account, credentials, or permissions. You must check the documented prerequisites for each specific tool before use.
- Can I compare my strategy against a benchmark?
- Yes. The server compares simulation results against the SPY benchmark. This allows you to evaluate strategy performance relative to a standard market index during the backtesting process.
- What types of trading rules can be tested?
- You can test plain-words trading rules on historical prices. The server supports building series, defining signals, and simulating outcomes based on these defined rules using historical daily data.