Koskamo

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.

Backtester MCP logo, by Daena DigitalCommunity listingStreamable HTTPNo sign-inEndpoint checked 2026-11-23Published by Daena Digital
MCP endpoint (Streamable HTTP)
https://backtester.daenadigital.com/mcp
Vendor documentation

What its tools do

9 tools, grouped by the hints the server advertises. Hints are self-declared, not verified behavior.

Can change data (2)

9 of 9 have a description · 9 of 9 declare behavior hints · 1 of 7 with parameters document them all

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

Community listingRegistry 1.0.0

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
Server-advertised capabilities
{
  "tools": {
    "listChanged": true
  },
  "resources": {
    "listChanged": true
  }
}

Tools

9 advertised

list_data — List available data
Advertised by the server during the last successful anonymous check.
Advertised read-only

List available price data, fields, dates, limits, and whether reports can be retained for publishing.

list_data input schema
{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
list_data annotations
{
  "readOnlyHint": true
}
get_prices — Get historical prices
Advertised by the server during the last successful anonymous check.
Advertised read-only

Read historical prices for a run form. Needs only version and data.

get_prices input schema
{
  "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
}
get_prices annotations
{
  "readOnlyHint": true
}
build_series — Build data series
Advertised by the server during the last successful anonymous check.
Advertised read-only

Build named time series from a run form. Needs version, data, and series.

build_series input schema
{
  "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
}
build_series annotations
{
  "readOnlyHint": true
}
build_signal — Build trading signals
Advertised by the server during the last successful anonymous check.
Advertised read-only

Build named trading signals from a run form. Needs version, data, series, and signals.

build_signal input schema
{
  "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
}
build_signal annotations
{
  "readOnlyHint": true
}
simulate — Simulate past trades
Advertised by the server during the last successful anonymous check.
Advertised read-only

Simulate historical fills and account balances. Needs the full run form.

simulate input schema
{
  "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
}
simulate annotations
{
  "readOnlyHint": true
}
report — Run a backtest report
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

report input schema
{
  "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
}
report annotations
{
  "readOnlyHint": true
}
share_report — Share a report publicly
Advertised by the server during the last successful anonymous check.
Open-world

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.

share_report input schema
{
  "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
}
share_report annotations
{
  "readOnlyHint": false,
  "openWorldHint": true,
  "idempotentHint": true,
  "destructiveHint": false
}
list_strategies — List saved strategies
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

list_strategies input schema
{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
list_strategies annotations
{
  "readOnlyHint": true
}
save_strategy — Publish a report to the public website
Advertised by the server during the last successful anonymous check.
Advertised destructiveOpen-world

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.

save_strategy input schema
{
  "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
}
save_strategy annotations
{
  "readOnlyHint": false,
  "openWorldHint": true,
  "idempotentHint": true,
  "destructiveHint": true
}

Prompts

Not advertised

No prompt definitions available.

Resources

2 advertised

Backtester report

Advertised by the server during the last successful anonymous check.

Backtester report URI
ui://widget/backtester-replay-1911046f.html

MIME type: text/html;profile=mcp-app

Backtester report (first name)

Advertised by the server during the last successful anonymous check.

Backtester report (first name) URI
ui://widget/backtester-replay.html

MIME type: text/html;profile=mcp-app

Backtester report (earlier versions)

Advertised by the server during the last successful anonymous check.

Backtester report (earlier versions) URI template
ui://widget/backtester-replay-{version}.html

MIME type: text/html;profile=mcp-app

90-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.

100% (55 of 55 checks answered)

  1. 2026-11-09: 2 of 2 checks answered
  2. 2026-11-10: 2 of 2 checks answered
  3. 2026-11-11: 1 of 1 checks answered
  4. 2026-11-12: 1 of 1 checks answered
  5. 2026-11-14: 1 of 1 checks answered
  6. 2026-11-15: 2 of 2 checks answered
  7. 2026-11-16: 4 of 4 checks answered
  8. 2026-11-17: 5 of 5 checks answered
  9. 2026-11-18: 5 of 5 checks answered
  10. 2026-11-19: 4 of 4 checks answered
  11. 2026-11-20: 2 of 2 checks answered
  12. 2026-11-21: 4 of 4 checks answered
  13. 2026-11-22: 4 of 4 checks answered
  14. 2026-11-23: 4 of 4 checks answered
  15. 2026-11-24: 4 of 4 checks answered
  16. 2026-11-25: 4 of 4 checks answered
  17. 2026-11-26: 4 of 4 checks answered
  18. 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.

This server is operated by the named third party. Listing and endpoint checks are not an endorsement or a security audit. Review the operator's permissions, terms, and data handling before connecting. How listings are checked and corrected.

Claude Code

Run this once in a terminal. It registers the remote server. Use --scope project to write .mcp.json for the repo.
Claude Code configuration
claude mcp add --transport http backtester-mcp https://backtester.daenadigital.com/mcp

Codex

Run this once. Codex stores MCP servers in ~/.codex/config.toml (or .codex/config.toml in a trusted project).
Codex configuration
codex mcp add backtester-mcp --url https://backtester.daenadigital.com/mcp

Cursor

Merge this server into .cursor/mcp.json in your project, then enable backtester-mcp in your MCP settings.
Cursor configuration
{
  "mcpServers": {
    "backtester-mcp": {
      "url": "https://backtester.daenadigital.com/mcp"
    }
  }
}

Cline

Merge this into cline_mcp_settings.json (Cline → MCP Servers → Configure).
Cline configuration
{
  "mcpServers": {
    "backtester-mcp": {
      "type": "streamableHttp",
      "url": "https://backtester.daenadigital.com/mcp",
      "disabled": false
    }
  }
}

VS Code

Merge this server into .vscode/mcp.json. Use MCP: List Servers to start backtester-mcp and inspect its tools.
VS Code configuration
{
  "servers": {
    "backtester-mcp": {
      "type": "http",
      "url": "https://backtester.daenadigital.com/mcp"
    }
  }
}

Gemini CLI

Run this once. It writes .gemini/settings.json in the current project; pass --scope user for ~/.gemini/settings.json.
Gemini CLI configuration
gemini mcp add --transport http backtester-mcp https://backtester.daenadigital.com/mcp

Claude Desktop

Open Claude Settings > Connectors > Add custom connector, enter this server URL and enable it for the conversation. This is a manual remote-connector handoff, not a desktop JSON configuration.
Claude Desktop configuration
https://backtester.daenadigital.com/mcp

Windsurf

Merge this into ~/.codeium/windsurf/mcp_config.json, then refresh MCP in Cascade. Windsurf remote servers use serverUrl, not url.
Windsurf configuration
{
  "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.

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.