SeriesPage v1

Forge API 1

Fields

NameTypeRequired
vanyRequired
series_keysha256Required
indicator_keysha256Required
indicatorone of severalRequired
i0integerRequired
nintegerRequired
warmupintegerRequired
outputsobjectRequired
levelsarrayRequired
panestringRequired
drawingsarrayRequired
repaintsbooleanRequired
versionsobjectRequired
completebooleanRequired

sha256

style

NameTypeRequired
styleline | step | line_gaps | histogram | columns | area | area_gaps | dots | cross | square | dash | marker | zigzag | background | bar_colorRequired
widthnumberOptional
dashsolid | dot | dashOptional
colorstringOptional
color_upstringOptional
color_downstringOptional
shiftintegerOptional
showarrayOptional
shapestringOptional
whereabove_bar | below_bar | at_priceOptional
basenumberOptional

output

point

NameTypeRequired
barintegerOptional
timeintegerOptional
pricenumberOptional

drawing

NameTypeRequired
typelabel | line | hline | vline | level | boxRequired
idstringOptional
p1pointOptional
p2pointOptional
pricenumberOptional
barintegerOptional
textstringOptional
extendnone | left | right | bothOptional
untiltouched | nullOptional
styleobjectOptional

Schema

json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "SeriesPage v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "v",
    "series_key",
    "indicator",
    "indicator_key",
    "i0",
    "n",
    "warmup",
    "outputs",
    "levels",
    "pane",
    "drawings",
    "repaints",
    "versions",
    "complete"
  ],
  "properties": {
    "v": {
      "const": 1
    },
    "series_key": {
      "$ref": "#/$defs/sha256"
    },
    "indicator_key": {
      "$ref": "#/$defs/sha256"
    },
    "indicator": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "kind",
            "name",
            "inputs"
          ],
          "properties": {
            "kind": {
              "const": "builtin"
            },
            "name": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]*$"
            },
            "inputs": {
              "type": "object"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "kind",
            "script",
            "inputs"
          ],
          "properties": {
            "kind": {
              "const": "user"
            },
            "script": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "version",
                "sha256"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "version": {
                  "type": "integer",
                  "minimum": 1
                },
                "sha256": {
                  "$ref": "#/$defs/sha256"
                }
              }
            },
            "inputs": {
              "type": "object"
            }
          }
        }
      ]
    },
    "i0": {
      "type": "integer",
      "minimum": 0
    },
    "n": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5000
    },
    "warmup": {
      "type": "integer",
      "minimum": 0
    },
    "outputs": {
      "type": "object",
      "maxProperties": 64,
      "additionalProperties": {
        "$ref": "#/$defs/output"
      }
    },
    "levels": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "value"
        ],
        "properties": {
          "value": {
            "type": "number"
          },
          "label": {
            "type": "string"
          },
          "color": {
            "type": "string"
          }
        }
      }
    },
    "pane": {
      "type": "string",
      "minLength": 1
    },
    "drawings": {
      "type": "array",
      "maxItems": 3000,
      "items": {
        "$ref": "#/$defs/drawing"
      }
    },
    "repaints": {
      "type": "boolean"
    },
    "versions": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "forge_indicators",
        "script",
        "engine"
      ],
      "properties": {
        "forge_indicators": {
          "type": [
            "string",
            "null"
          ]
        },
        "script": {
          "type": [
            "integer",
            "null"
          ]
        },
        "engine": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "complete": {
      "type": "boolean"
    }
  },
  "$defs": {
    "sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "style": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "style"
      ],
      "properties": {
        "style": {
          "enum": [
            "line",
            "step",
            "line_gaps",
            "histogram",
            "columns",
            "area",
            "area_gaps",
            "dots",
            "cross",
            "square",
            "dash",
            "marker",
            "zigzag",
            "background",
            "bar_color"
          ]
        },
        "width": {
          "type": "number",
          "minimum": 0
        },
        "dash": {
          "enum": [
            "solid",
            "dot",
            "dash"
          ]
        },
        "color": {
          "type": "string"
        },
        "color_up": {
          "type": "string"
        },
        "color_down": {
          "type": "string"
        },
        "shift": {
          "type": "integer"
        },
        "show": {
          "type": "array",
          "items": {
            "enum": [
              "pane",
              "scale",
              "legend",
              "data_window"
            ]
          }
        },
        "shape": {
          "type": "string"
        },
        "where": {
          "enum": [
            "above_bar",
            "below_bar",
            "at_price"
          ]
        },
        "base": {
          "type": "number"
        }
      }
    },
    "output": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "kind",
            "style",
            "values"
          ],
          "properties": {
            "kind": {
              "const": "value"
            },
            "label": {
              "type": "string"
            },
            "hidden": {
              "type": "boolean"
            },
            "style": {
              "$ref": "#/$defs/style"
            },
            "values": {
              "type": "array",
              "items": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "kind",
            "style",
            "values"
          ],
          "properties": {
            "kind": {
              "const": "state"
            },
            "label": {
              "type": "string"
            },
            "style": {
              "$ref": "#/$defs/style"
            },
            "values": {
              "type": "array",
              "items": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "kind",
            "style",
            "values"
          ],
          "properties": {
            "kind": {
              "const": "event"
            },
            "label": {
              "type": "string"
            },
            "style": {
              "$ref": "#/$defs/style"
            },
            "values": {
              "type": "array",
              "items": {
                "enum": [
                  -1,
                  0,
                  1,
                  null
                ]
              }
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "kind",
            "style",
            "top",
            "bottom",
            "active"
          ],
          "properties": {
            "kind": {
              "const": "zone"
            },
            "label": {
              "type": "string"
            },
            "style": {
              "$ref": "#/$defs/style"
            },
            "top": {
              "type": "array",
              "items": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "bottom": {
              "type": "array",
              "items": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "active": {
              "type": "array",
              "items": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            }
          }
        }
      ]
    },
    "point": {
      "type": "object",
      "additionalProperties": false,
      "minProperties": 2,
      "properties": {
        "bar": {
          "type": "integer"
        },
        "time": {
          "type": "integer"
        },
        "price": {
          "type": "number"
        }
      }
    },
    "drawing": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "enum": [
            "label",
            "line",
            "hline",
            "vline",
            "level",
            "box"
          ]
        },
        "id": {
          "type": "string"
        },
        "p1": {
          "$ref": "#/$defs/point"
        },
        "p2": {
          "$ref": "#/$defs/point"
        },
        "price": {
          "type": "number"
        },
        "bar": {
          "type": "integer"
        },
        "text": {
          "type": "string",
          "maxLength": 500
        },
        "extend": {
          "enum": [
            "none",
            "left",
            "right",
            "both"
          ]
        },
        "until": {
          "enum": [
            "touched",
            null
          ]
        },
        "style": {
          "type": "object"
        }
      }
    }
  }
}