{
  "E-FILE-NOT-REGULAR": {
    "severity": "error",
    "title": "Not a regular file",
    "fix": "Pick a plain .js file on disk.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-file-not-regular"
  },
  "E-FILE-EXTENSION": {
    "severity": "error",
    "title": "Unsupported file extension",
    "fix": "Save the indicator as a .js or .mjs file.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-file-extension"
  },
  "E-FILE-TOO-LARGE": {
    "severity": "error",
    "title": "File too large",
    "fix": "Keep the file under 256 KiB; remove data tables or generated code.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-file-too-large"
  },
  "E-FILE-EMPTY": {
    "severity": "error",
    "title": "File is empty",
    "fix": "The file must contain a default export.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-file-empty"
  },
  "E-FILE-ENCODING": {
    "severity": "error",
    "title": "File is not UTF-8",
    "fix": "Save the file as UTF-8 text.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-file-encoding"
  },
  "E-SOURCE-BIDI": {
    "severity": "error",
    "title": "Hidden control characters",
    "fix": "Remove NUL and bidirectional control characters from the source.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-source-bidi"
  },
  "E-SOURCE-MISSING": {
    "severity": "error",
    "title": "Source file missing",
    "fix": "The original file was moved or deleted; re-import it from its new location.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-source-missing"
  },
  "E-SYNTAX": {
    "severity": "error",
    "title": "Syntax error",
    "fix": "Fix the JavaScript syntax error at the reported position.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-syntax"
  },
  "E-AST-TOO-COMPLEX": {
    "severity": "error",
    "title": "Source too complex",
    "fix": "Reduce nesting depth and total size of the file.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-ast-too-complex"
  },
  "E-IDENT-NON-ASCII": {
    "severity": "error",
    "title": "Non-ASCII identifier",
    "fix": "Use ASCII letters, digits and underscores in identifiers.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-ident-non-ascii"
  },
  "E-IMPORT": {
    "severity": "error",
    "title": "Imports are not allowed",
    "fix": "Remove the import and inline the helper into the file.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-import"
  },
  "E-IMPORT-DYNAMIC": {
    "severity": "error",
    "title": "Dynamic import is not allowed",
    "fix": "Remove the import() call.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-import-dynamic"
  },
  "E-IMPORT-META": {
    "severity": "error",
    "title": "import.meta is not allowed",
    "fix": "Remove the import.meta reference.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-import-meta"
  },
  "E-EXPORT-NAMED": {
    "severity": "error",
    "title": "Only a default export is allowed",
    "fix": "Remove named exports and re-exports; keep a single export default.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-export-named"
  },
  "E-EXPORT-DEFAULT-MISSING": {
    "severity": "error",
    "title": "Exactly one default export is required",
    "fix": "Add `export default { ... }` with the manifest and calculate.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-export-default-missing"
  },
  "E-EXPORT-DEFAULT-SHAPE": {
    "severity": "error",
    "title": "Default export must be an object literal",
    "fix": "Export a plain object literal directly: `export default { schemaVersion: 3, ... }`.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-export-default-shape"
  },
  "E-TOP-LEVEL-STATEMENT": {
    "severity": "error",
    "title": "Unsupported top-level statement",
    "fix": "Keep only function declarations, const helpers and the default export at top level.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-top-level-statement"
  },
  "E-ASYNC": {
    "severity": "error",
    "title": "Async code is not allowed",
    "fix": "Remove async/await, generators, Promise, .then/.catch/.finally, thenables and FinalizationRegistry; calculate must be synchronous and nothing may run after it returns.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-async"
  },
  "E-DEBUGGER": {
    "severity": "error",
    "title": "debugger is not allowed",
    "fix": "Remove the debugger statement.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-debugger"
  },
  "E-THIS-TOP": {
    "severity": "error",
    "title": "Top-level this is not allowed",
    "fix": "Do not reference `this` outside functions.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-this-top"
  },
  "E-CODEGEN": {
    "severity": "error",
    "title": "Code generation is not allowed",
    "fix": "Remove eval and Function constructor usage.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-codegen"
  },
  "E-FORBIDDEN-GLOBAL": {
    "severity": "error",
    "title": "Forbidden global",
    "fix": "Indicator code may only use ctx, Math and plain JavaScript; remove the global reference. Your own variable may reuse a name like close or fetch if you declare it in the scope that uses it, but not self, globalThis, window, performance or crypto: rename those.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-forbidden-global"
  },
  "E-UNDECLARED-IDENTIFIER": {
    "severity": "error",
    "title": "Undefined name",
    "fix": "Declare the name with const inside calculate (top level allows only const helpers, as functions or literal values), or fix the typo; it would throw a ReferenceError when calculate runs.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-undeclared-identifier"
  },
  "E-PROTOTYPE-ACCESS": {
    "severity": "error",
    "title": "Prototype access is not allowed",
    "fix": "Remove constructor/prototype/__proto__ member access.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-prototype-access"
  },
  "E-BUILTIN-WRITE": {
    "severity": "error",
    "title": "Writes to a built-in are not allowed",
    "fix": "Do not write from calculate into a built-in (Math, Array, Object, a built-in prototype, …): every indicator shares them. Create every value inside calculate, or change a copy (such as .slice().sort()).",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-builtin-write"
  },
  "E-MANIFEST-KEY-UNKNOWN": {
    "severity": "error",
    "title": "Unknown manifest key",
    "fix": "Remove the key or check its spelling against the manifest reference.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-manifest-key-unknown"
  },
  "E-MANIFEST-NOT-LITERAL": {
    "severity": "error",
    "title": "Manifest value must be a literal",
    "fix": "Write manifest values as plain literals (strings, numbers, booleans, arrays, objects); no expressions or functions.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-manifest-not-literal"
  },
  "E-CALCULATE-MISSING": {
    "severity": "error",
    "title": "calculate is missing",
    "fix": "Add a synchronous `calculate(ctx) { ... }` method to the default export.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-calculate-missing"
  },
  "E-CALCULATE-SHAPE": {
    "severity": "error",
    "title": "calculate has the wrong shape",
    "fix": "calculate must be a synchronous function taking one parameter (ctx).",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-calculate-shape"
  },
  "E-SCHEMA-VERSION-INVALID": {
    "severity": "error",
    "title": "Invalid schemaVersion",
    "fix": "Set `schemaVersion: 3`.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-schema-version-invalid"
  },
  "E-SCHEMA-VERSION-UNSUPPORTED": {
    "severity": "error",
    "title": "schemaVersion needs a newer Spectral",
    "fix": "Update Spectral, or ask for a schemaVersion 3 file.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-schema-version-unsupported"
  },
  "E-MANIFEST-KEY-MISSING": {
    "severity": "error",
    "title": "Required manifest key missing",
    "fix": "Add the missing key.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-manifest-key-missing"
  },
  "E-ID-INVALID": {
    "severity": "error",
    "title": "Invalid id",
    "fix": "Use 3-48 lowercase letters, digits and single hyphens, starting with a letter.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-id-invalid"
  },
  "E-ID-EXISTS": {
    "severity": "error",
    "title": "An indicator with this id already exists",
    "fix": "Change the id, or replace the existing indicator.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-id-exists"
  },
  "E-TEXT-INVALID": {
    "severity": "error",
    "title": "Invalid text field",
    "fix": "Provide a non-empty string within the length limit.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-text-invalid"
  },
  "E-TEXT-UNSAFE": {
    "severity": "error",
    "title": "Text looks like an identifier or hash",
    "fix": "Avoid long hexadecimal or alphanumeric runs and account-like tokens in text fields.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-text-unsafe"
  },
  "E-PANE-INVALID": {
    "severity": "error",
    "title": "Invalid pane",
    "fix": "Set pane to 'price' or 'oscillator'.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-pane-invalid"
  },
  "E-LIVE-INVALID": {
    "severity": "error",
    "title": "Invalid live mode",
    "fix": "Set live to { lookback: <bars calculate reads before the forming bar> } or 'none', or omit it.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-live-invalid"
  },
  "E-LIVE-LOOKBACK": {
    "severity": "error",
    "title": "Invalid live lookback",
    "fix": "Write live.lookback as whole bars or a sum of whole numbers and integer inputs that have a max (e.g. 'length + 1' or '2*length'), at most 5,000 bars with those inputs at their max.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-live-lookback"
  },
  "E-LIVE-NONDETERMINISTIC": {
    "severity": "error",
    "title": "Non-deterministic code in a live indicator",
    "fix": "Remove Date and Math.random, and do not write from calculate into values declared at the top of the file (create every value inside calculate): a live update must give the same values as a full recalculation (ctx.time has New York dates and times), or set live: 'none'.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-live-nondeterministic"
  },
  "E-LIVE-BAR-CLOSE": {
    "severity": "error",
    "title": "Invalid bar-close condition",
    "fix": "Set live.barCloseWhen to a boolean input key, or { input: '<select key>', in: [<some of its options>] }; settings that match update at bar close only, every other setting on every tick. The default inputs and every preset must not all match it (nothing added from the toolbox would update live): make the default a live setting, or set live to 'none'.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-live-bar-close"
  },
  "E-INPUT-KEY-INVALID": {
    "severity": "error",
    "title": "Invalid input key",
    "fix": "Input keys are camelCase, start with a lowercase letter and are at most 21 characters.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-input-key-invalid"
  },
  "E-INPUT-TYPE-INVALID": {
    "severity": "error",
    "title": "Invalid input type",
    "fix": "Use one of 'integer', 'number', 'boolean', 'select', 'source', 'text', 'time'.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-input-type-invalid"
  },
  "E-INPUT-DEFAULT-INVALID": {
    "severity": "error",
    "title": "Invalid input default",
    "fix": "Provide a default that matches the input type and lies inside its range or options.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-input-default-invalid"
  },
  "E-INPUT-RANGE-INVALID": {
    "severity": "error",
    "title": "Invalid input range",
    "fix": "min must be <= max, step must be positive, and integer inputs need integer bounds.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-input-range-invalid"
  },
  "E-INPUT-OPTIONS-INVALID": {
    "severity": "error",
    "title": "Invalid select options",
    "fix": "Provide 1-16 unique non-empty option strings.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-input-options-invalid"
  },
  "E-INPUT-LIMIT": {
    "severity": "error",
    "title": "Too many inputs",
    "fix": "Declare at most 24 inputs.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-input-limit"
  },
  "E-PLOT-KEY-INVALID": {
    "severity": "error",
    "title": "Invalid output key",
    "fix": "Output keys are camelCase, start with a lowercase letter and are at most 14 characters.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-plot-key-invalid"
  },
  "E-PLOT-PRIMARY": {
    "severity": "error",
    "title": "Primary plot ambiguity",
    "fix": "Mark exactly one plot as primary (or none; the first plot is primary).",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-plot-primary"
  },
  "E-OUTPUT-LIMIT": {
    "severity": "error",
    "title": "Too many outputs",
    "fix": "Reduce the number of plots, levels, zones, markers, columns, profiles or (schema v3) tables, labels, barColors, bgColors, segments or boxes.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-output-limit"
  },
  "E-OUTPUT-EMPTY": {
    "severity": "error",
    "title": "Indicator produces nothing",
    "fix": "Declare at least one plot, level, zone, marker, column or profile (schema v3: or a table, labels, barColors, bgColors, segments or boxes).",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-output-empty"
  },
  "E-OUTPUT-PANE-MISMATCH": {
    "severity": "error",
    "title": "Output not allowed on this pane",
    "fix": "Columns are only available on the 'oscillator' pane, profiles, barColors, inline level labels and aboveBar/belowBar markers only on the 'price' pane.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-output-pane-mismatch"
  },
  "E-COLOR-INVALID": {
    "severity": "error",
    "title": "Invalid color",
    "fix": "Use a 6-digit hex color like #8AA9C3.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-color-invalid"
  },
  "E-STYLE-INVALID": {
    "severity": "error",
    "title": "Invalid style value",
    "fix": "Check lineWidth (0.5-8), lineStyle, gaps, opacity (0-0.8 for zones, 0-1 for profiles, tables and boxes, 0-0.6 for bgColors), radius (2-8), offset (a whole number from -500 to 500, or an integer input key such as displacement, -displacement or displacement-1), a profile placement (range or visible) and a plot style (line, step, circles, cross, area or histogram).",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-style-invalid"
  },
  "E-KEY-COLLISION": {
    "severity": "error",
    "title": "Key collision",
    "fix": "Rename the input so it does not collide with a generated style setting (e.g. <plot>Color).",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-key-collision"
  },
  "E-PRESET-INVALID": {
    "severity": "error",
    "title": "Invalid preset",
    "fix": "Each preset needs id, name, shortName and inputs that match declared inputs.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-preset-invalid"
  },
  "E-PRESET-LIMIT": {
    "severity": "error",
    "title": "Too many presets",
    "fix": "Declare at most 8 presets.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-preset-limit"
  },
  "E-DOCS-INVALID": {
    "severity": "error",
    "title": "Invalid docs",
    "fix": "docs.overview is required; each docs field is a string up to 2000 characters.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-docs-invalid"
  },
  "E-PROFILE-UNSUPPORTED": {
    "severity": "error",
    "title": "Profiles need schemaVersion 2",
    "fix": "Set `schemaVersion: 2` to draw volume profiles, or remove the profiles field.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-profile-unsupported"
  },
  "E-AUX-UNSUPPORTED": {
    "severity": "error",
    "title": "Auxiliary bars need schemaVersion 2",
    "fix": "Set `schemaVersion: 2` to read auxiliary bars, or remove the auxiliary field.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-aux-unsupported"
  },
  "E-AUX-INVALID": {
    "severity": "error",
    "title": "Invalid auxiliary source",
    "fix": "Give each auxiliary source a barSize and a duration, and only the documented fields: useRth, whatToShow, keepUpToDate, when.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-aux-invalid"
  },
  "E-AUX-KEY-INVALID": {
    "severity": "error",
    "title": "Invalid auxiliary key",
    "fix": "Auxiliary keys are camelCase, start with a lowercase letter and are at most 14 characters.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-aux-key-invalid"
  },
  "E-AUX-LIMIT": {
    "severity": "error",
    "title": "Too many auxiliary sources",
    "fix": "Declare at most 4 auxiliary sources.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-aux-limit"
  },
  "E-AUX-BAR-SIZE": {
    "severity": "error",
    "title": "Unsupported auxiliary bar size",
    "fix": "Use a Spectral bar size of 1 min or longer, e.g. '1 day' or '1 week'.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-aux-bar-size"
  },
  "E-AUX-DURATION": {
    "severity": "error",
    "title": "Invalid auxiliary duration",
    "fix": "Write the duration as a count and a unit, e.g. '2 Y' (at most 365 D, 52 W or 12 M; use Y beyond), within the limit for its bar size.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-aux-duration"
  },
  "E-FORMAT-UNSUPPORTED": {
    "severity": "error",
    "title": "ctx.format needs schemaVersion 3",
    "fix": "Set `schemaVersion: 3` to write numbers with ctx.format, or build the text without it.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-format-unsupported"
  },
  "E-ANNOTATION-UNSUPPORTED": {
    "severity": "error",
    "title": "Drawing elements need schemaVersion 3",
    "fix": "Set `schemaVersion: 3` to use palettes, tables, labels, barColors, bgColors, segments, boxes, a plot style or palette, a level labelStyle, a zone palette, or a marker shape, char, size, placement, palette or hideBelowBarWidth, or remove them.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-annotation-unsupported"
  },
  "E-PALETTE-INVALID": {
    "severity": "error",
    "title": "Invalid palette",
    "fix": "Declare at most 8 palettes, each { label, colors } with 1-8 6-digit hex colors like #4CAF7A, keyed like an output.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-palette-invalid"
  },
  "E-PALETTE-REF": {
    "severity": "error",
    "title": "Unknown palette",
    "fix": "Set palette to the key of a palette declared under palettes (barColors and bgColors need one).",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-palette-ref"
  },
  "E-TABLE-INVALID": {
    "severity": "error",
    "title": "Invalid table",
    "fix": "Give each table a label, a position ('top-left' to 'bottom-right'), 1-12 columns { align?, width? } (width 2-32 characters), border true or false and offsetX/offsetY from 0 to 200 pixels.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-table-invalid"
  },
  "E-LABEL-INVALID": {
    "severity": "error",
    "title": "Invalid label",
    "fix": "Check style ('none', 'box', 'pin', 'arrow'), placement ('above', 'below', 'left', 'right', 'center'), hideBelowBarWidth (0-40) and maxVisible (1-2000).",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-label-invalid"
  },
  "E-SHAPE-INVALID": {
    "severity": "error",
    "title": "Invalid marker shape",
    "fix": "Check shape, size ('tiny', 'small', 'normal', 'large'), placement ('absolute', 'aboveBar', 'belowBar') and hideBelowBarWidth (0-40); shape: 'char' needs char, one visible character.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-shape-invalid"
  },
  "E-SEGMENT-INVALID": {
    "severity": "error",
    "title": "Invalid segment",
    "fix": "Set extend to 'none', 'right', 'left' or 'both'.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-segment-invalid"
  },
  "E-BOX-INVALID": {
    "severity": "error",
    "title": "Invalid box",
    "fix": "Set extend to 'none' or 'right' and hideBelowBarWidth from 0 to 40.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-box-invalid"
  },
  "E-TEXT-SIZE-INVALID": {
    "severity": "error",
    "title": "Invalid text size or font",
    "fix": "Set textSize to 'small', 'normal' or 'large' and font to 'mono' or 'sans'.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-text-size-invalid"
  },
  "E-AUX-WHEN": {
    "severity": "error",
    "title": "Invalid auxiliary condition",
    "fix": "List conditions in when.all and when.any, at least one in total: a declared boolean input key, or { input: '<select key>', in: [<its options>] }.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#e-aux-when"
  },
  "W-NONDETERMINISTIC": {
    "severity": "warning",
    "title": "Non-deterministic code",
    "fix": "Avoid Date, Math.random and writes from calculate into values declared at the top of the file; results should depend only on bars and inputs.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#w-nondeterministic"
  },
  "W-LIVE-HELD": {
    "severity": "warning",
    "title": "Updates at bar close while a kept-up-to-date series forms",
    "fix": "calculate carries values through ctx.ta and reads an auxiliary series with keepUpToDate: while its forming bar changes, the chart shows bar-close values. Set keepUpToDate: false on it, or compute the carried values from completed bars of it only.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#w-live-held"
  },
  "W-LIVE-MARKER": {
    "severity": "warning",
    "title": "A marker moves with the newest bar",
    "fix": "calculate returns a marker only on the last bar (if (cond[last]) markers.push({ index: last })): the chart keeps it on that bar until the next bar closes, then drops it. Return the marker on every bar the condition holds on, not only the last.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#w-live-marker"
  },
  "W-CONSOLE": {
    "severity": "warning",
    "title": "console usage",
    "fix": "Remove console calls; they are not visible to the user.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#w-console"
  },
  "W-VOLUME-UNDECLARED": {
    "severity": "warning",
    "title": "Volume used without usesVolume",
    "fix": "Set `usesVolume: true` when calculate reads bar.volume.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#w-volume-undeclared"
  },
  "W-DOCS-MISSING": {
    "severity": "warning",
    "title": "No docs",
    "fix": "Add docs (overview, howToRead, settings) so the info page can explain the indicator.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#w-docs-missing"
  },
  "W-DOCS-INCOMPLETE": {
    "severity": "warning",
    "title": "Info page incomplete",
    "fix": "Add docs.howToRead, docs.settings and a description for every input; they fill the indicator info page.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#w-docs-incomplete"
  },
  "R-LOAD-FAILED": {
    "severity": "error",
    "title": "Module failed to load",
    "fix": "Reload the indicator; if it persists, re-import the file.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-load-failed"
  },
  "R-EXPORT-MISMATCH": {
    "severity": "error",
    "title": "Module does not match its manifest",
    "fix": "Re-import the file; the stored copy and the manifest disagree.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-export-mismatch"
  },
  "R-THROW": {
    "severity": "error",
    "title": "calculate threw an error",
    "fix": "Fix the error in calculate, then Reload.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-throw"
  },
  "R-OUTPUT-INVALID": {
    "severity": "error",
    "title": "calculate returned an invalid result",
    "fix": "Return only declared keys with numeric arrays or nulls.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-output-invalid"
  },
  "R-OUTPUT-LENGTH": {
    "severity": "error",
    "title": "Series length mismatch",
    "fix": "Every series must have exactly bars.length entries.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-output-length"
  },
  "R-OUTPUT-TEXT": {
    "severity": "error",
    "title": "Drawn text too long",
    "fix": "Shorten the text or return fewer items: a table cell holds at most 32 characters and a table at most 4,096 (cell tooltips included); a label at most 48 characters in 3 lines, a box text 32, a tooltip 48 in 3 lines; all labels, all boxes (texts and tooltips) and all shape-marker tooltips of one indicator at most 65,536 each. Abbreviate, or drop decimals with ctx.format. The import checks 30,000 bars and scrolling back can hold more: draw text only on bars that matter, never on every bar.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-output-text"
  },
  "R-TEXT-UNSAFE": {
    "severity": "error",
    "title": "Drawn text looks like an identifier",
    "fix": "Drawn text must not hold 8 or more hexadecimal characters in a row, an account-like code (U, DU or F and digits) or a 22-character token. Write numbers with ctx.format (it groups long integers) instead of String(value).",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-text-unsafe"
  },
  "R-SLOW": {
    "severity": "error",
    "title": "calculate is too slow",
    "fix": "Keep a full run linear in the bar count (30,000 bars in about 50 ms is comfortable; the import allows a quarter of a second with every input at its max, the chart turns those settings off at that bar size for the session above a second, counting the conversion of the result): no loop over all bars inside a loop over all bars, and a lower max for inputs that set long windows.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-slow"
  },
  "R-LIVE-INEXACT": {
    "severity": "error",
    "title": "Live update differs from a full recalculation",
    "fix": "Raise live.lookback to the number of bars calculate reads back, carry values from bar to bar only through ctx.ta.scan or ctx.ta.cum, keep no value between runs (create every value inside calculate), or set live: 'none'.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-live-inexact"
  },
  "R-SCAN-STATE": {
    "severity": "error",
    "title": "ta.scan keeps too much state",
    "fix": "Keep a ta.scan state small (a few numbers): over a whole run one scan may copy at most 2,000,000 state values (about 66 per bar on 30,000 bars). Return the same state object from a step that changes nothing; it costs no copy.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-scan-state"
  },
  "R-LIVE-SLOW": {
    "severity": "error",
    "title": "Live update is too slow",
    "fix": "Lower live.lookback or remove loops over all bars from calculate, or set live: 'none'; until then the indicator updates when a bar completes.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-live-slow"
  },
  "R-LIVE-STATE": {
    "severity": "error",
    "title": "ctx.ta calls differ between runs",
    "fix": "Call the ctx.ta helpers in the same order with the same lengths on every run, on series as long as ctx.bars; do not make the calls depend on bars.length or on the data.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-live-state"
  },
  "R-TIMEOUT": {
    "severity": "error",
    "title": "Indicator timed out",
    "fix": "The indicator was disabled for this session; fix the infinite loop and Reload.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-timeout"
  },
  "R-NOT-INSTALLED": {
    "severity": "error",
    "title": "Custom indicator not installed",
    "fix": "Re-import it from the toolbox or remove it from the chart.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-not-installed"
  },
  "R-INCOMPATIBLE": {
    "severity": "error",
    "title": "Indicator incompatible with this Spectral version",
    "fix": "Update Spectral or re-generate the file against the current docs.",
    "docsUrl": "https://spectral.trade/docs/custom-indicators#r-incompatible"
  }
}
