/** The shape of spec/errors.json that this file was generated from. */ export declare const CATALOGUE_SCHEMA_VERSION = 1; /** The language version the catalogue describes. */ export declare const CATALOGUE_LANGUAGE_VERSION = 1; /** The word each stage is printed as, so a reader is told which part of the compiler spoke. */ export declare const STAGE_LABELS: { readonly lex: "lexer"; readonly parse: "parser"; readonly check: "checker"; readonly runtime: "engine"; readonly host: "host"; readonly import: "importer"; }; export declare const ENTRIES: { readonly OS1001: { readonly code: "OS1001"; readonly title: "Unexpected character"; readonly severity: "error"; readonly stage: "lex"; readonly since: 1; readonly autofix: true; readonly message: "Unexpected character {char}. {suggestion}"; readonly fix: "Delete the character or replace it with the plain ASCII spelling the message names: a plain space for a non-breaking space, a straight quote for a typographic one, not for !, and for &&, or for ||, pow(a, b) for ^."; readonly placeholders: readonly ["char", "suggestion"]; }; readonly OS1002: { readonly code: "OS1002"; readonly title: "Tab in indentation"; readonly severity: "error"; readonly stage: "lex"; readonly since: 1; readonly autofix: true; readonly message: "This line is indented with a tab."; readonly fix: "Replace the leading tabs with spaces. Four spaces per level is the convention and the formatter's output."; readonly placeholders: readonly []; }; readonly OS1003: { readonly code: "OS1003"; readonly title: "Indentation does not match this block"; readonly severity: "error"; readonly stage: "lex"; readonly since: 1; readonly autofix: true; readonly message: "This line is indented {found} spaces; the block opened at line {line} is indented {expected}."; readonly fix: "Indent this line to {expected} spaces to keep it in the block, or to {line}'s own indentation to end the block here."; readonly placeholders: readonly ["found", "expected", "line"]; }; readonly OS1004: { readonly code: "OS1004"; readonly title: "Unterminated string literal"; readonly severity: "error"; readonly stage: "lex"; readonly since: 1; readonly autofix: false; readonly message: "This string literal opens with {quote} and the line ends before a matching {quote}."; readonly fix: "Close the string with a matching {quote} before the end of the line, and join text across lines with + and a continuation."; readonly placeholders: readonly ["quote"]; }; readonly OS1005: { readonly code: "OS1005"; readonly title: "Unknown escape sequence"; readonly severity: "error"; readonly stage: "lex"; readonly since: 1; readonly autofix: true; readonly message: "{sequence} is not an escape sequence."; readonly fix: "Double the backslash to write one literally, or use one of the escapes the language defines."; readonly placeholders: readonly ["sequence"]; }; readonly OS1006: { readonly code: "OS1006"; readonly title: "Assignment used as a condition"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: true; readonly message: "= assigns a value, and a condition needs a comparison."; readonly fix: "Write == to compare, or move the assignment to its own line above the if."; readonly placeholders: readonly []; }; readonly OS1007: { readonly code: "OS1007"; readonly title: "Semicolon"; readonly severity: "error"; readonly stage: "lex"; readonly since: 1; readonly autofix: true; readonly message: "; is not part of the language."; readonly fix: "Delete the ; and put the second statement on its own line."; readonly placeholders: readonly []; }; readonly OS1008: { readonly code: "OS1008"; readonly title: "Chained comparison"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "A comparison cannot be chained: {op1} is already applied before {op2}."; readonly fix: "Split it with and, naming the middle value twice: a < b and b < c."; readonly placeholders: readonly ["op1", "op2"]; }; readonly OS1009: { readonly code: "OS1009"; readonly title: "break or continue outside a loop"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "{word} is only valid inside a for or a while body."; readonly fix: "Move it inside the loop body, or write return to leave a function early."; readonly placeholders: readonly ["word"]; }; readonly OS1010: { readonly code: "OS1010"; readonly title: "Block header with no body"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: true; readonly message: "{header} opens a block, and the next line is not indented more deeply."; readonly fix: "Indent the body under the header, or delete the header line if the body is genuinely empty."; readonly placeholders: readonly ["header"]; }; readonly OS1011: { readonly code: "OS1011"; readonly title: "var with no initial value"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: true; readonly message: "var {name} has no initial value."; readonly fix: "Give it a starting value; var {name} = none is the empty start."; readonly placeholders: readonly ["name"]; }; readonly OS1012: { readonly code: "OS1012"; readonly title: "Bracket is never closed"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "The {bracket} opened at line {line} is never closed."; readonly fix: "Add the matching closer at the end of the argument list on line {line}."; readonly placeholders: readonly ["bracket", "line"]; }; readonly OS1013: { readonly code: "OS1013"; readonly title: "Mismatched closing bracket"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: true; readonly message: "Found {found} where {expected} was expected, closing the {opener} opened at line {line}."; readonly fix: "Change {found} to {expected}, which is what closes the {opener} opened at line {line}."; readonly placeholders: readonly ["found", "expected", "opener", "line"]; }; readonly OS1014: { readonly code: "OS1014"; readonly title: "Missing comma between arguments"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: true; readonly message: "Two arguments run together; a comma is missing before {token}."; readonly fix: "Put a comma between the two arguments."; readonly placeholders: readonly ["token"]; }; readonly OS1015: { readonly code: "OS1015"; readonly title: "Ternary with no second arm"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "This ? has no matching :"; readonly fix: "Give the ternary both arms, and use none for the arm that should draw nothing."; readonly placeholders: readonly []; }; readonly OS1016: { readonly code: "OS1016"; readonly title: "else does not follow an if"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: true; readonly message: "This else is indented {found} spaces and the nearest if is indented {expected}."; readonly fix: "Line the else up with its if, at {expected} spaces."; readonly placeholders: readonly ["found", "expected"]; }; readonly OS1017: { readonly code: "OS1017"; readonly title: "case or default in the wrong place"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "{word} is only valid inside a switch, and default must be its last arm."; readonly fix: "Move the arm inside the switch block, and put default after every case."; readonly placeholders: readonly ["word"]; }; readonly OS1018: { readonly code: "OS1018"; readonly title: "More than one statement on a line"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "Unexpected {token} after the end of this statement."; readonly fix: "Put {token} and what follows it on its own line, or supply the operator that was meant to join them."; readonly placeholders: readonly ["token"]; }; readonly OS1019: { readonly code: "OS1019"; readonly title: "Reserved word used as a name"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "{word} is a reserved word and cannot be used as a name."; readonly fix: "Rename it; {suggestion} keeps the meaning and is not reserved."; readonly placeholders: readonly ["word", "suggestion"]; }; readonly OS1020: { readonly code: "OS1020"; readonly title: "Incomplete for header"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "A for header needs = start to end or in array; found {token}."; readonly fix: "Write for i = 0 to size(values) - 1 for a counted loop, or for v in values to visit elements."; readonly placeholders: readonly ["token"]; }; readonly OS1021: { readonly code: "OS1021"; readonly title: "The version declaration is not first"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: true; readonly message: "version must be the first line that is not blank and not a comment; line {line} came before it."; readonly fix: "Move the version line to the top of the file, above the study or strategy declaration."; readonly placeholders: readonly ["line"]; }; readonly OS1022: { readonly code: "OS1022"; readonly title: "Expression expected"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "An expression was expected after {token}."; readonly fix: "Supply the missing operand, or delete the trailing {token}."; readonly placeholders: readonly ["token"]; }; readonly OS1023: { readonly code: "OS1023"; readonly title: "A function declared inside a block"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "fn {name} is declared inside a block, and a function is declared at the top level of the file."; readonly fix: "Move the whole declaration out to the top level of the file, and call {name} from inside the block."; readonly placeholders: readonly ["name"]; }; readonly OS1024: { readonly code: "OS1024"; readonly title: "Assignment to an indexed element"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "An assignment writes to a name, and this target is an index into {name}."; readonly fix: "Change an array element with set({name}, i, v), or assign to a plain name: the past of a series is computed and never written."; readonly placeholders: readonly ["name"]; }; readonly OS1025: { readonly code: "OS1025"; readonly title: "Assignment to a member"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "An assignment writes to a name, and this target is the member {member} of {name}."; readonly fix: "Assign to a plain name. Version 1 has no member assignment: a dot reads a member, and the members a script can reach are facts and functions the library and the host supply."; readonly placeholders: readonly ["name", "member"]; }; readonly OS1026: { readonly code: "OS1026"; readonly title: "Block comment"; readonly severity: "error"; readonly stage: "lex"; readonly since: 1; readonly autofix: false; readonly message: "{marker} does not open or close a comment. A comment is written // and runs to the end of its line."; readonly fix: "Write // instead, and give every line of a commented region its own //, which every editor does with one keystroke."; readonly placeholders: readonly ["marker"]; }; readonly OS1027: { readonly code: "OS1027"; readonly title: "Malformed colour literal"; readonly severity: "error"; readonly stage: "lex"; readonly since: 1; readonly autofix: false; readonly message: "{written} is not a colour: a colour literal is # and six or eight hexadecimal digits."; readonly fix: "Give it six hexadecimal digits, or eight where the last two are the alpha byte. A named colour or rgb(r, g, b) says the same thing without the digits."; readonly placeholders: readonly ["written"]; }; readonly OS1028: { readonly code: "OS1028"; readonly title: "A continuation line is not indented past its statement"; readonly severity: "error"; readonly stage: "lex"; readonly since: 1; readonly autofix: true; readonly message: "A continuation line must be indented more deeply than the line its statement began on; line {line} is indented {statement} and this line is indented {found}."; readonly fix: "Indent this line further than the {statement} spaces on line {line}. Four more is the convention and the formatter's output."; readonly placeholders: readonly ["found", "statement", "line"]; }; readonly OS1029: { readonly code: "OS1029"; readonly title: "A name written against a number"; readonly severity: "error"; readonly stage: "lex"; readonly since: 1; readonly autofix: false; readonly message: "{written} is neither a number nor a name: the number literal ends at {number}, and a name cannot begin with a digit."; readonly fix: "Write the value in a form the language has: a decimal literal, or 0x and hexadecimal digits. There is no binary form and no octal form, and an underscore separates digit groups only where a digit follows it. Where a number and a name were meant as two things, put an operator between them."; readonly placeholders: readonly ["written", "number"]; }; readonly OS2001: { readonly code: "OS2001"; readonly title: "Name is not defined here"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} is not defined at this point in the file."; readonly fix: "Assign {name} above this line, move this line below its assignment, or correct the spelling to {suggestion}."; readonly placeholders: readonly ["name", "suggestion"]; }; readonly OS2002: { readonly code: "OS2002"; readonly title: "The name already exists in an enclosing scope"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} is already declared at line {line}, so a second one cannot be declared here."; readonly fix: "Rename this one, or drop the inner declaration and let the assignment update the {name} at line {line}."; readonly placeholders: readonly ["name", "line"]; }; readonly OS2003: { readonly code: "OS2003"; readonly title: "Types do not match"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{leftType} and {rightType} do not mix here."; readonly fix: "Convert explicitly: text(x) for a string, or text(x, decimals) to fix the decimals. Where no conversion applies, write the value in the type the line needs, or give the second value a name of its own. A plot, fill or level handle converts to nothing: leave it named at the top level, pass it to fill(), and use draw.line() or draw.box() where the script needs something it can keep."; readonly placeholders: readonly ["leftType", "rightType"]; }; readonly OS2004: { readonly code: "OS2004"; readonly title: "This value has no history"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{expr} has no history, so [] cannot read a past value of it."; readonly fix: "If the value is a per-bar number computed inside a block or left as a temporary, assign it at the top level of the file and read the history of that top level name. If it is a declaration handle, a runtime object or a library fact that is not a series, no name gives it a history: assign what you want to look back at to a top level name of its own, and read that."; readonly placeholders: readonly ["expr"]; }; readonly OS2005: { readonly code: "OS2005"; readonly title: "Recursive call"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} calls itself: {cycle}."; readonly fix: "Rewrite it as a loop, or split the work into two functions that do not call each other."; readonly placeholders: readonly ["name", "cycle"]; }; readonly OS2006: { readonly code: "OS2006"; readonly title: "Assignment to a loop variable"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} is this loop's variable and cannot be assigned inside the body."; readonly fix: "Use break to leave early, or keep a separate name for the value the body changes."; readonly placeholders: readonly ["name"]; }; readonly OS2007: { readonly code: "OS2007"; readonly title: "The file has no declaration"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "A file needs one study() or strategy() declaration before any other statement."; readonly fix: "Add study(\"Name\") as the first statement, or strategy(\"Name\") if the file places orders."; readonly placeholders: readonly []; }; readonly OS2008: { readonly code: "OS2008"; readonly title: "More than one declaration"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "This file already declares {kind} at line {line}."; readonly fix: "Delete this declaration and move the options you wanted onto the one at line {line}."; readonly placeholders: readonly ["kind", "line"]; }; readonly OS2009: { readonly code: "OS2009"; readonly title: "Unknown member of a namespace"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{namespace} has no member named {member}."; readonly fix: "Use one of {namespace}'s members; {suggestion} is the closest match to what was written."; readonly placeholders: readonly ["namespace", "member", "suggestion"]; }; readonly OS2010: { readonly code: "OS2010"; readonly title: "This name is not a function"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} is {type}, not a function, so it cannot be called."; readonly fix: "Remove the argument list to read the value, or call the function that was meant: {suggestion}."; readonly placeholders: readonly ["name", "type", "suggestion"]; }; readonly OS2011: { readonly code: "OS2011"; readonly title: "A condition must be a bool"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "This condition is {type}; a condition must be bool or none."; readonly fix: "Write the test out: {name} > 0 for a count, isNone({name}) for absence, {name} != \"\" for a string."; readonly placeholders: readonly ["type", "name"]; }; readonly OS2012: { readonly code: "OS2012"; readonly title: "The two arms of the ternary have different types"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "The arms of this ? : are {leftType} and {rightType}."; readonly fix: "Make both arms the same type with text() or toNumber(), or use none for the empty arm."; readonly placeholders: readonly ["leftType", "rightType"]; }; readonly OS2013: { readonly code: "OS2013"; readonly title: "An array literal mixes types"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "This array holds {firstType} at index 0 and {otherType} at index {index}."; readonly fix: "Make every element {firstType}, or keep two arrays and index them together."; readonly placeholders: readonly ["firstType", "otherType", "index"]; }; readonly OS2014: { readonly code: "OS2014"; readonly title: "A function cannot be used as a value"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} is a function, and version 1 has no function values."; readonly fix: "Call {name} with its arguments and use the value it returns."; readonly placeholders: readonly ["name"]; }; readonly OS2015: { readonly code: "OS2015"; readonly title: "The element type of this empty array is unknown"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "An empty array literal needs its element type from an annotation or from a first use."; readonly fix: "Annotate the declaration, var hits: array = [], or put the first element in with push(), unshift(), insert() or set() and let the type be read from that call."; readonly placeholders: readonly []; }; readonly OS2016: { readonly code: "OS2016"; readonly title: "Unknown type in an annotation"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{type} is not a type."; readonly fix: "Use number, string, bool, color, array, or an object type (line, label, box, polyline, table), with series in front for a per-bar value."; readonly placeholders: readonly ["type"]; }; readonly OS2017: { readonly code: "OS2017"; readonly title: "A function with this name is already declared"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} is already declared as a function at line {line}."; readonly fix: "Rename one of them, or give the one function a default argument that covers both uses."; readonly placeholders: readonly ["name", "line"]; }; readonly OS2018: { readonly code: "OS2018"; readonly title: "Duplicate parameter name"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} appears twice in this parameter list."; readonly fix: "Rename the second parameter, so every name in the list appears once."; readonly placeholders: readonly ["name"]; }; readonly OS2019: { readonly code: "OS2019"; readonly title: "This type cannot be an array element"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "array<{type}> is not a type: {type} cannot be an array element."; readonly fix: "Use an element type an array holds: number, string, bool, color, line, label, box, polyline or table. A plot cannot be kept anywhere, so declare each plot at the top level and give it its own name."; readonly placeholders: readonly ["type"]; }; readonly OS2020: { readonly code: "OS2020"; readonly title: "Name is planned, not implemented"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} is planned and is not implemented in this version."; readonly fix: "Compute what {name} would give from names the library implements today, or take the line out until a version implements it. Do not reach for the nearest name that compiles: a neighbour computes something else, and a plot that quietly changes meaning is worse than one that refuses to compile."; readonly placeholders: readonly ["name"]; }; readonly OS3001: { readonly code: "OS3001"; readonly title: "Wrong number of arguments"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} takes {expected} arguments and {found} were given."; readonly fix: "Pass the arguments the signature names: {signature}."; readonly placeholders: readonly ["name", "expected", "found", "signature"]; }; readonly OS3002: { readonly code: "OS3002"; readonly title: "Unknown named argument"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} has no argument called {argument}."; readonly fix: "Use one of {names}; {suggestion} is the closest to what was written."; readonly placeholders: readonly ["name", "argument", "names", "suggestion"]; }; readonly OS3003: { readonly code: "OS3003"; readonly title: "This option must be a constant"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{option} is read once, before the first bar, so it cannot depend on bar data."; readonly fix: "Use a literal, or make it tunable with an input(): {option} = input(2, \"{option}\")."; readonly placeholders: readonly ["option"]; }; readonly OS3004: { readonly code: "OS3004"; readonly title: "Argument is not a valid whole number"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name}'s {argument} must be a whole number {range}; {found} was given."; readonly fix: "Pass a whole number inside {range}, and wrap a computed value in floor() or round()."; readonly placeholders: readonly ["name", "argument", "range", "found"]; }; readonly OS3005: { readonly code: "OS3005"; readonly title: "Positional argument after a named one"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "A positional argument cannot follow a named one."; readonly fix: "Name this argument too, or move it in front of the first named argument."; readonly placeholders: readonly []; }; readonly OS3006: { readonly code: "OS3006"; readonly title: "This call must be at the top level"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} defines part of the study's fixed shape and cannot appear inside {construct}."; readonly fix: "Move the call to the top level and hide it per bar by passing none: plot(cond ? value : none, ...). Inside a request expression, read the value first and draw with it afterwards. A leg is not hidden by passing none: declare it at the top level and decide per bar whether to send it an order."; readonly placeholders: readonly ["name", "construct"]; }; readonly OS3007: { readonly code: "OS3007"; readonly title: "input() must be at the top level"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "input() builds one row of the settings dialog, which is read once before the first bar."; readonly fix: "Move the input() to the top level and use the name it assigns inside the block."; readonly placeholders: readonly []; }; readonly OS3008: { readonly code: "OS3008"; readonly title: "The value is not valid for this parameter"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{argument} accepts {values}; {found} is not one of them."; readonly fix: "Use one of {values}; {suggestion} is the closest to what was written."; readonly placeholders: readonly ["argument", "values", "found", "suggestion"]; }; readonly OS3009: { readonly code: "OS3009"; readonly title: "This option needs another option to be set"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{option} = {value} requires {required}."; readonly fix: "Set {required} in the declaration, or choose a value of {option} that stands on its own."; readonly placeholders: readonly ["option", "value", "required"]; }; readonly OS3010: { readonly code: "OS3010"; readonly title: "Two arguments that cannot both be given"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{first} and {second} set the same thing two ways."; readonly fix: "Keep one of the two: an absolute price or a distance from the entry, one colour for the whole band or a colour for each side, and on a leg described as a future neither right nor strikeOffset."; readonly placeholders: readonly ["first", "second"]; }; readonly OS3011: { readonly code: "OS3011"; readonly title: "Argument has the wrong type"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name}'s {argument} is {expected}; {found} was given."; readonly fix: "Convert the value with text(), toNumber() or toBool(), or pass an expression of type {expected}."; readonly placeholders: readonly ["name", "argument", "expected", "found"]; }; readonly OS3012: { readonly code: "OS3012"; readonly title: "A required argument is missing"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} requires {argument}, which has no default."; readonly fix: "Pass {argument} at the call site, as the example shows: {example}."; readonly placeholders: readonly ["name", "argument", "example"]; }; readonly OS3013: { readonly code: "OS3013"; readonly title: "Argument given twice"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{argument} is given twice at this call site."; readonly fix: "Delete one of the two, keeping the value that was meant."; readonly placeholders: readonly ["argument"]; }; readonly OS3014: { readonly code: "OS3014"; readonly title: "limits() is in the wrong place"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "limits() appears at most once, immediately after the declaration; this one is at line {line}."; readonly fix: "Move the limits() line directly under study(...) or strategy(...), and merge two calls into one."; readonly placeholders: readonly ["line"]; }; readonly OS3015: { readonly code: "OS3015"; readonly title: "limits() takes literal numbers"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "limits() is read before the first bar, so {option} must be a literal number."; readonly fix: "Write the number: limits(loops = 50_000_000)."; readonly placeholders: readonly ["option"]; }; readonly OS3016: { readonly code: "OS3016"; readonly title: "range must be a low and a high"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "range is [{low}, {high}]; it takes two numbers and the first must be below the second."; readonly fix: "Write two numbers, lowest first: range = [0, 100]."; readonly placeholders: readonly ["low", "high"]; }; readonly OS3017: { readonly code: "OS3017"; readonly title: "Two of these share a name"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{kind} names must be unique in a file; {name} is also used at line {line}."; readonly fix: "Rename one of them so each name appears once."; readonly placeholders: readonly ["kind", "name", "line"]; }; readonly OS3018: { readonly code: "OS3018"; readonly title: "The default is not in the options list"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "This input's default {default} is not one of options {values}."; readonly fix: "Add {default} to options, or make the default one of the listed values."; readonly placeholders: readonly ["default", "values"]; }; readonly OS3019: { readonly code: "OS3019"; readonly title: "A declaration handle in an object argument"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name}'s {argument} is {expected}; {found} is a declaration handle, which has no value at run time."; readonly fix: "Pass an object the script created with draw.line(), draw.box() or draw.label(), and change a plot's own appearance through the arguments of the plot call instead."; readonly placeholders: readonly ["name", "argument", "expected", "found"]; }; readonly OS3020: { readonly code: "OS3020"; readonly title: "fill needs two declared plots"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "fill's {argument} is {found}; it takes a plot declared by plot() or plotCandles()."; readonly fix: "Plot both edges at the top level, name each one, and pass the two names to fill()."; readonly placeholders: readonly ["argument", "found"]; }; readonly OS3021: { readonly code: "OS3021"; readonly title: "An input written in place has no title"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "An input() assigned to no name is named by its title, and this one has no title written as a string literal."; readonly fix: "Give it a title written as a string literal: input(2, \"Precision\")."; readonly placeholders: readonly []; }; readonly OS3022: { readonly code: "OS3022"; readonly title: "Two inputs share a settings key"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "This input is keyed by its title {name}, which is already the name of the input at line {line}."; readonly fix: "Give this one a title of its own, or rename the input at line {line}."; readonly placeholders: readonly ["name", "line"]; }; readonly OS3023: { readonly code: "OS3023"; readonly title: "An order names a leg this file does not declare"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} was given a {argument}, and this file declares none."; readonly fix: "Leave {argument} out. A file that declares no leg has exactly one, and every order acts on it."; readonly placeholders: readonly ["name", "argument"]; }; readonly OS3024: { readonly code: "OS3024"; readonly title: "An input written in place has an empty title"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "An input() assigned to no name is named by its title, and this one's title is empty."; readonly fix: "Give the title something to say: input(2, \"Precision\")."; readonly placeholders: readonly []; }; readonly OS3025: { readonly code: "OS3025"; readonly title: "A setting is part of a larger expression here"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{option} is fixed before the first bar and holds an input() only as the whole of its value, so it cannot hold an expression over one."; readonly fix: "Declare the setting as the value itself, with an input() written as the whole of {option}, or write the value out as a literal."; readonly placeholders: readonly ["option"]; }; readonly OS3026: { readonly code: "OS3026"; readonly title: "This option cannot be a setting"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{option} is written into the compiled program as a plain value, so a setting cannot choose it in this format version."; readonly fix: "Write the option out as a string literal and drop the input(): style = \"step\", for instance, is one of the values OS3008 names."; readonly placeholders: readonly ["option"]; }; readonly OS4001: { readonly code: "OS4001"; readonly title: "History index is not usable"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "[{index}] is not a whole number of bars at or above zero."; readonly fix: "Wrap the index in floor() or round(), and clamp a computed index with max(0, n)."; readonly placeholders: readonly ["index"]; }; readonly OS4002: { readonly code: "OS4002"; readonly title: "History index is deeper than the retained depth"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "[{index}] reaches past the retained depth of {depth} bars."; readonly fix: "Raise the depth in one place: limits(history = {suggested})."; readonly placeholders: readonly ["index", "depth", "suggested"]; }; readonly OS4003: { readonly code: "OS4003"; readonly title: "A whole number was required here"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "{name}'s {argument} was {found} on this bar; a whole number was required."; readonly fix: "Round the value before passing it: floor() towards zero, round() to nearest."; readonly placeholders: readonly ["name", "argument", "found"]; }; readonly OS4004: { readonly code: "OS4004"; readonly title: "Array index out of range"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "Index {index} is outside {name}, which holds {size} elements."; readonly fix: "Guard the read with size({name}), and index from size({name}) - 1 for the last element."; readonly placeholders: readonly ["index", "name", "size"]; }; readonly OS4005: { readonly code: "OS4005"; readonly title: "The drawing object no longer exists"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "This {kind} was deleted on bar {bar} and cannot be changed."; readonly fix: "Assign none to the name on the same path as the delete, and test isNone() on it before changing the object."; readonly placeholders: readonly ["kind", "bar"]; }; readonly OS4006: { readonly code: "OS4006"; readonly title: "The array is empty"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "{name} cannot take an element from an empty array."; readonly fix: "Test size(arr) > 0 before the call."; readonly placeholders: readonly ["name"]; }; readonly OS4007: { readonly code: "OS4007"; readonly title: "Slice range is invalid"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "slice({from}, {to}) is not a range inside an array of {size} elements."; readonly fix: "Clamp the bounds: from = max(0, from) and to = min(size(arr), to), with from at or below to."; readonly placeholders: readonly ["from", "to", "size"]; }; readonly OS4008: { readonly code: "OS4008"; readonly title: "Table cell is outside the table"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "Cell ({row}, {column}) is outside a table of {rows} rows and {columns} columns."; readonly fix: "Declare the table with the shape the script writes: table(\"Summary\", {rows}, {columns})."; readonly placeholders: readonly ["row", "column", "rows", "columns"]; }; readonly OS4009: { readonly code: "OS4009"; readonly title: "Colour channel is out of range"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "{name}'s {argument} is {found}; channels run 0 to 255 and alpha runs 0 to 1."; readonly fix: "Clamp the value where it is computed: rgb(min(255, max(0, r)), g, b)."; readonly placeholders: readonly ["name", "argument", "found"]; }; readonly OS4010: { readonly code: "OS4010"; readonly title: "Calendar field is out of range"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "{field} is {found}; it runs {range}."; readonly fix: "Pass a value inside {range}, carrying the overflow into the field above it as the example does."; readonly placeholders: readonly ["field", "found", "range"]; }; readonly OS4011: { readonly code: "OS4011"; readonly title: "String position is outside the string"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "Position {index} is outside a string of {length} characters."; readonly fix: "Guard with str.length(s), or clamp the position with min() before the call."; readonly placeholders: readonly ["index", "length"]; }; readonly OS4012: { readonly code: "OS4012"; readonly title: "That value is not one of the accepted names"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "{argument} accepts {values}; {found} was computed on this bar."; readonly fix: "Produce the value from an input() with an options list, so only accepted names can reach the call."; readonly placeholders: readonly ["argument", "values", "found"]; }; readonly OS4013: { readonly code: "OS4013"; readonly title: "A loop bound is absent"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "This loop's {bound} is absent on this bar."; readonly fix: "Give the bound a value with orElse(), or guard the loop with isNone() so a warmup bar skips it deliberately."; readonly placeholders: readonly ["bound"]; }; readonly OS5001: { readonly code: "OS5001"; readonly title: "Loop budget exhausted"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "This bar used its {budget} loop iterations, and the loop at line {line} was still running."; readonly fix: "Fix the exit condition, or raise the budget in one line: limits(loops = {suggested})."; readonly placeholders: readonly ["budget", "line", "suggested"]; }; readonly OS5002: { readonly code: "OS5002"; readonly title: "The array is too large"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "An array holds at most {max} elements; {name} reached {size}."; readonly fix: "Drop the oldest element as you append: if size(arr) > 500, shift(arr)."; readonly placeholders: readonly ["max", "name", "size"]; }; readonly OS5003: { readonly code: "OS5003"; readonly title: "The host refused this limits() value"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "This host allows {option} up to {max}; the file asks for {found}."; readonly fix: "Lower {option} to {max} or below, or run the file on a host that allows more."; readonly placeholders: readonly ["option", "max", "found"]; }; readonly OS5004: { readonly code: "OS5004"; readonly title: "The program needs more state regions than the engine allows"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "This program needs {found} state regions and the engine allows {max}; {first} calls {second} on several paths."; readonly fix: "Call the inner function once at the top level, give its result a name, and pass that name down."; readonly placeholders: readonly ["found", "max", "first", "second"]; }; readonly OS5005: { readonly code: "OS5005"; readonly title: "Nesting is too deep"; readonly severity: "error"; readonly stage: "parse"; readonly since: 1; readonly autofix: false; readonly message: "{construct} is nested {found} deep and the ceiling is {max}."; readonly fix: "Flatten it: give the inner expression a name at the top level and use the name."; readonly placeholders: readonly ["construct", "found", "max"]; }; readonly OS5006: { readonly code: "OS5006"; readonly title: "Too many outstanding data requests"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "This file makes {found} data requests and the host allows {max}."; readonly fix: "Keep one request per symbol and timeframe, reuse the name it assigns, and delete the requests whose results are unused."; readonly placeholders: readonly ["found", "max"]; }; readonly OS5007: { readonly code: "OS5007"; readonly title: "The bar took too long"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "Bar {bar} ran for {ms} ms and the host allows {max} ms."; readonly fix: "Keep a running value in a var and update it per bar instead of recomputing over the whole history."; readonly placeholders: readonly ["bar", "ms", "max"]; }; readonly OS5008: { readonly code: "OS5008"; readonly title: "The string is too long"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "A string holds at most {max} characters; this one reached {found}."; readonly fix: "Keep the pieces in an array, trim it to the rows you display, and join only those."; readonly placeholders: readonly ["max", "found"]; }; readonly OS5009: { readonly code: "OS5009"; readonly title: "The program is too large"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "This file compiles to {found} instructions and the ceiling is {max}."; readonly fix: "Move the repeated block into a fn and call it, and delete branches the script no longer uses."; readonly placeholders: readonly ["found", "max"]; }; readonly OS5010: { readonly code: "OS5010"; readonly title: "Too many drawing objects"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "A script holds at most {max} drawing objects; this one would be number {found}."; readonly fix: "Delete each object when it stops being wanted, and bound the set: keep the objects in an array, and when it is longer than you want, delete the oldest object and remove the element."; readonly placeholders: readonly ["max", "found"]; }; readonly OS6001: { readonly code: "OS6001"; readonly title: "Unknown timeframe"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{value} is not a timeframe."; readonly fix: "Write a count and a unit, or a bare number of minutes: \"5m\", \"1h\", \"1D\", \"1W\", \"60\"."; readonly placeholders: readonly ["value"]; }; readonly OS6002: { readonly code: "OS6002"; readonly title: "The requested timeframe is lower than the chart's"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The chart is {chart} and the request asks for {requested}."; readonly fix: "Request {chart} or higher, or change the chart's interval to the lower one and fold upwards instead."; readonly placeholders: readonly ["chart", "requested"]; }; readonly OS6003: { readonly code: "OS6003"; readonly title: "A per-bar name inside a request expression"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} is computed on this chart's bars, so it has no meaning on the requested ones."; readonly fix: "Move the calculation inside the request expression, or pass a constant: a literal or an input()."; readonly placeholders: readonly ["name"]; }; readonly OS6004: { readonly code: "OS6004"; readonly title: "The library manifest disagrees with the program"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "Entry {index} of the program names {name} with {arity} arguments; this engine's manifest has {manifest}."; readonly fix: "Recompile the script against this engine's library, or run the program on an engine with the library version it was compiled against."; readonly placeholders: readonly ["index", "name", "arity", "manifest"]; }; readonly OS6005: { readonly code: "OS6005"; readonly title: "Unknown timezone"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "{value} is not a timezone this host knows."; readonly fix: "Use a full area and location name from the host's list, or leave the argument out to use the chart's own timezone."; readonly placeholders: readonly ["value"]; }; readonly OS6006: { readonly code: "OS6006"; readonly title: "The engine lacks a capability the program requires"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "This program requires {tag} and this engine does not have it."; readonly fix: "Run the program on an engine that has {tag}, or remove the feature that needs it: the tag names it."; readonly placeholders: readonly ["tag"]; }; readonly OS6007: { readonly code: "OS6007"; readonly title: "Unknown symbol or exchange"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The host does not know {symbol} on {exchange}."; readonly fix: "Correct the symbol, and name the exchange it trades on when it is not the chart's: req.symbol(\"SYMBOL\", \"1D\", close, exchange = \"EXCHANGE\")."; readonly placeholders: readonly ["symbol", "exchange"]; }; readonly OS6008: { readonly code: "OS6008"; readonly title: "The request returned no bars"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "{symbol} at {timeframe} returned no bars over the range this chart covers."; readonly fix: "Move the chart's range into the period the instrument traded, or request a symbol that covers it."; readonly placeholders: readonly ["symbol", "timeframe"]; }; readonly OS6009: { readonly code: "OS6009"; readonly title: "The request failed"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The host could not fetch {symbol} at {timeframe}: {reason}."; readonly fix: "Act on {reason} in the host: it is a connection, permission or quota problem. Where the value can be derived from the chart's own bars, derive it and drop the request."; readonly placeholders: readonly ["symbol", "timeframe", "reason"]; }; readonly OS6010: { readonly code: "OS6010"; readonly title: "The engine was given no bars"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "There are no bars for {symbol} at {timeframe}, so the script cannot run."; readonly fix: "Choose an instrument and interval that have history, or widen the chart's date range until bars exist."; readonly placeholders: readonly ["symbol", "timeframe"]; }; readonly OS6011: { readonly code: "OS6011"; readonly title: "The bars are not in order"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "Bar {index} is dated {time}, which is not after bar {previous}."; readonly fix: "Reload the history; if the same bar repeats, the feed is sending duplicates and the host has to sort and deduplicate the bars before the engine runs."; readonly placeholders: readonly ["index", "time", "previous"]; }; readonly OS6012: { readonly code: "OS6012"; readonly title: "An instrument fact is not known"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The host did not supply {fact} for {symbol}."; readonly fix: "Supply {fact} in the host's instrument record for {symbol}, or leave the session out of the record, which makes every session read absent rather than wrong."; readonly placeholders: readonly ["fact", "symbol"]; }; readonly OS6013: { readonly code: "OS6013"; readonly title: "The request changed after the first bar"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "This request asked for {first} on bar 0 and for {found} on bar {bar}."; readonly fix: "Compute the symbol and the timeframe from literals or inputs, not from bar data."; readonly placeholders: readonly ["first", "found", "bar"]; }; readonly OS6014: { readonly code: "OS6014"; readonly title: "The feed does not offer this timeframe"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The host has no {timeframe} data for {symbol}; it offers {available}."; readonly fix: "Request one of {available}, or derive the interval you want from a lower one the host does serve."; readonly placeholders: readonly ["timeframe", "symbol", "available"]; }; readonly OS6015: { readonly code: "OS6015"; readonly title: "The requested timeframe does not fold into the chart's"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "{requested} is not a whole multiple of {chart}."; readonly fix: "Request a multiple of {chart}, for example {suggestion}."; readonly placeholders: readonly ["requested", "chart", "suggestion"]; }; readonly OS6016: { readonly code: "OS6016"; readonly title: "The compiled format version is not one this engine implements"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "This program is in compiled format {found} and this engine implements format {max}; a different major number is a different format, whether it is higher or lower."; readonly fix: "Run the program on an engine that implements format {found}, or recompile the source with a compiler that emits format {max}."; readonly placeholders: readonly ["found", "max"]; }; readonly OS6017: { readonly code: "OS6017"; readonly title: "The program's language version is not one this engine implements"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "This program was compiled from language version {found}, and this engine implements {versions}."; readonly fix: "Upgrade the engine to one that implements language version {found}, or recompile the source against a version it has."; readonly placeholders: readonly ["found", "versions"]; }; readonly OS6018: { readonly code: "OS6018"; readonly title: "The compiled program is malformed"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The program failed verification at {location}: {reason}."; readonly fix: "Recompile the script from its source; a program that fails verification came from a broken compiler or was edited after it was written, and neither is repairable by hand."; readonly placeholders: readonly ["location", "reason"]; }; readonly OS6019: { readonly code: "OS6019"; readonly title: "A host setting fails the input's validation"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The host supplied {value} for {key}, and {validation}."; readonly fix: "Correct the value in the settings dialog, or widen the input's own min, max or options so the value is allowed."; readonly placeholders: readonly ["value", "key", "validation"]; }; readonly OS6020: { readonly code: "OS6020"; readonly title: "The report window holds no bars"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The window from {from} to {to} holds none of the {count} bars supplied."; readonly fix: "Widen the window until it covers bars, or supply the bars it covers. Both bounds are inclusive and are compared against the times of the bars supplied rather than against a calendar, so a window that falls inside a gap in the data is empty however wide it looks."; readonly placeholders: readonly ["from", "to", "count"]; }; readonly OS6021: { readonly code: "OS6021"; readonly title: "A run setting cannot be applied as stated"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "{setting} cannot be applied: {problem}."; readonly fix: "State the setting so it can be carried out: declare a charge line after every line it is levied on, supply the tick size a slippage in ticks is measured in, write down the reason a tolerance needs a bound, or bring a bound past the cap back inside it. Nothing has been computed at the point this is refused, so correcting the setting and running again costs one run."; readonly placeholders: readonly ["setting", "problem"]; }; readonly OS6022: { readonly code: "OS6022"; readonly title: "The bars are not the bars the record was made from"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The bars supplied hash to {found}, and the record was made from {expected}."; readonly fix: "Replay against the bars the record names. Where the revision is the point, make a second record over the revised bars and compare the two runs, rather than overwriting one run with the other under one name."; readonly placeholders: readonly ["found", "expected"]; }; readonly OS6023: { readonly code: "OS6023"; readonly title: "Two cost models are stated at once"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "A charge schedule was supplied, and the declaration states a commission of {commission} in {commissionType}."; readonly fix: "Supply the schedule and leave the declaration's commission at its default of zero, or state the commission in the declaration and supply no schedule. A schedule is the one of the two that can carry a floor, a cap, a charge levied on a charge, and a cost that falls on one side of the trade only."; readonly placeholders: readonly ["commission", "commissionType"]; }; readonly OS6024: { readonly code: "OS6024"; readonly title: "The host cannot draw something this study declares"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "This host cannot draw {what}: {limit}."; readonly fix: "Declare what this host draws, or run the study on a host that draws {what}."; readonly placeholders: readonly ["what", "limit"]; }; readonly OS6025: { readonly code: "OS6025"; readonly title: "A bar has no time"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "Bar {index} was handed over with no time."; readonly fix: "State the bar's open instant in whole milliseconds since the Unix epoch, UTC, and leave out a bar the host cannot date rather than handing it over without a time."; readonly placeholders: readonly ["index"]; }; readonly OS7001: { readonly code: "OS7001"; readonly title: "Only a strategy can do that"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} is available only in a file declared with strategy()."; readonly fix: "Change study(...) on line {line} to strategy(...), or replace {name} with signal(\"...\") to mark the bar without trading."; readonly placeholders: readonly ["name", "line"]; }; readonly OS7002: { readonly code: "OS7002"; readonly title: "An order argument is absent"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "{name}'s {argument} is absent on this bar."; readonly fix: "Guard the call with isNone({argument}), or supply a fallback with orElse() where one is genuinely correct."; readonly placeholders: readonly ["name", "argument"]; }; readonly OS7003: { readonly code: "OS7003"; readonly title: "An order function inside a request expression"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} inside a request expression would place an order from another instrument's bars."; readonly fix: "Read the value with the request, and place the order at the top level from the result."; readonly placeholders: readonly ["name"]; }; readonly OS7004: { readonly code: "OS7004"; readonly title: "Order quantity is zero or negative"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "{name} was given a quantity of {qty}."; readonly fix: "Pass a positive quantity, guard the call with a size test, and use sell() to go the other way."; readonly placeholders: readonly ["name", "qty"]; }; readonly OS7005: { readonly code: "OS7005"; readonly title: "Quantity is not a multiple of the lot size"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "{symbol} trades in lots of {lot}, and {qty} is not a multiple of it."; readonly fix: "Size in lots: declare qtyType = \"lots\" and pass the lot count, or round a computed size with order.roundToLot()."; readonly placeholders: readonly ["symbol", "lot", "qty"]; }; readonly OS7006: { readonly code: "OS7006"; readonly title: "Price is not on a tick"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "{symbol} ticks at {tick}, and {price} does not fall on one."; readonly fix: "Round to the tick before passing the price: round(price / chart.tickSize) * chart.tickSize."; readonly placeholders: readonly ["symbol", "tick", "price"]; }; readonly OS7007: { readonly code: "OS7007"; readonly title: "A resting order has no price"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "A {type} order needs {argument}, and none was given."; readonly fix: "Pass {argument}, or leave the type as market and let the order fill at the next price."; readonly placeholders: readonly ["type", "argument"]; }; readonly OS7008: { readonly code: "OS7008"; readonly title: "The entry was refused by pyramiding"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "This strategy allows {max} entries in one direction and already holds {found}."; readonly fix: "Raise pyramiding in the declaration, or test pos.size before entering again."; readonly placeholders: readonly ["max", "found"]; }; readonly OS7009: { readonly code: "OS7009"; readonly title: "Unknown order tag"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "There is no working order tagged {tag}."; readonly fix: "Use the tag the order was placed with, or cancelAll() where the script means every order it has working."; readonly placeholders: readonly ["tag"]; }; readonly OS7010: { readonly code: "OS7010"; readonly title: "A bracket price is on the wrong side of the entry"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "A {side} entry at {entry} cannot take a {leg} at {price}."; readonly fix: "Put the stop below a long entry and the limit above it, and swap the two for a short."; readonly placeholders: readonly ["side", "entry", "leg", "price"]; }; readonly OS7011: { readonly code: "OS7011"; readonly title: "The order needs more capital than the strategy has"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "This order needs {required} and the strategy has {available}."; readonly fix: "Size from equity with qtyType = \"equityPercent\", or test pos.equity before entering."; readonly placeholders: readonly ["required", "available"]; }; readonly OS7012: { readonly code: "OS7012"; readonly title: "The instrument is outside its session"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "{symbol} is outside its trading session at {time}."; readonly fix: "Guard entries with session.isOpen, and set closeOnSessionEnd = true to flatten at the close."; readonly placeholders: readonly ["symbol", "time"]; }; readonly OS7013: { readonly code: "OS7013"; readonly title: "Two opposite orders on one bar"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "{first} and {second} were both placed on bar {bar}."; readonly fix: "Make the conditions exclusive with else if, or place the exit on this bar and the entry on the next."; readonly placeholders: readonly ["first", "second", "bar"]; }; readonly OS7014: { readonly code: "OS7014"; readonly title: "The destination rejected the order"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The order destination rejected {name}: {reason}."; readonly fix: "Act on {reason}: it comes from the destination, not from the script, and the same order will be rejected again until the account or the order changes."; readonly placeholders: readonly ["name", "reason"]; }; readonly OS7015: { readonly code: "OS7015"; readonly title: "The strategy has no order destination"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "This strategy placed an order and the host supplied no destination."; readonly fix: "Connect a destination in the host, or run the file as a study(): replace buy() with signal(\"BUY\")."; readonly placeholders: readonly []; }; readonly OS7016: { readonly code: "OS7016"; readonly title: "A close names a tag nothing places"; readonly severity: "error"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "No order in this file is placed with the tag {tag}."; readonly fix: "Use the tag the entry was placed with, or leave the tag out to flatten the whole leg."; readonly placeholders: readonly ["tag"]; }; readonly OS7017: { readonly code: "OS7017"; readonly title: "A close states more than it is closing"; readonly severity: "error"; readonly stage: "runtime"; readonly since: 1; readonly autofix: false; readonly message: "close was given a quantity of {qty}, and {part} has {held} left to close."; readonly fix: "Leave the quantity out and close() flattens what is left, or size the part from pos.size and keep the quantity at or under {held}."; readonly placeholders: readonly ["qty", "part", "held"]; }; readonly OS7018: { readonly code: "OS7018"; readonly title: "A frame names an order this strategy did not place"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The frame names intent {intent}, and this strategy holds no such order."; readonly fix: "Answer with the intent id the engine sent. A destination's own reference is carried in the frame's reference field, where the engine records it and never parses it, and it is not what an answer is addressed by."; readonly placeholders: readonly ["intent"]; }; readonly OS7019: { readonly code: "OS7019"; readonly title: "A fill was reported with no price"; readonly severity: "error"; readonly stage: "host"; readonly since: 1; readonly autofix: false; readonly message: "The frame reports {qty} filled for intent {intent}, and no average fill price."; readonly fix: "Report the average fill price the destination computed over the cumulative quantity, on every frame that reports a quantity greater than the last one. A frame carrying no new quantity needs no price."; readonly placeholders: readonly ["qty", "intent"]; }; readonly OS8001: { readonly code: "OS8001"; readonly title: "A stateful call inside a branch"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} advances only on the bars where this branch runs, and is absent on the rest."; readonly fix: "Compute it unconditionally at the top level and use the result inside the branch."; readonly placeholders: readonly ["name"]; }; readonly OS8002: { readonly code: "OS8002"; readonly title: "A higher timeframe read with onUnconfirmed"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "This file sets onUnconfirmed = true and reads {timeframe}; together they repaint."; readonly fix: "Drop onUnconfirmed = true, or guard every use of the read with bar.isConfirmed."; readonly placeholders: readonly ["timeframe"]; }; readonly OS8003: { readonly code: "OS8003"; readonly title: "No version declaration"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: true; readonly message: "This file declares no language version; it was compiled as version {version}."; readonly fix: "Add version {version} as the first line of the file."; readonly placeholders: readonly ["version"]; }; readonly OS8004: { readonly code: "OS8004"; readonly title: "A branch on an absent condition changes a value used later"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{condition} can be absent, and this block assigns {name}, which is read at line {line}."; readonly fix: "Decide what warmup means: test isNone({condition}) explicitly, or give {name} a starting value above the if."; readonly placeholders: readonly ["condition", "name", "line"]; }; readonly OS8005: { readonly code: "OS8005"; readonly title: "A lookahead read"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "This read uses {mode}, so the study shows values the bar it is drawn on could not have known."; readonly fix: "Drop the mode to take the default, which never repaints, unless the study is deliberately a study of what the higher bar went on to do."; readonly placeholders: readonly ["mode"]; }; readonly OS8006: { readonly code: "OS8006"; readonly title: "A session average on a session-length bar"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "A session anchored average resets each session, and each bar of {interval} is a whole session, so it equals its source."; readonly fix: "Use an intraday interval for a session anchored average, or plot the source directly and delete the call."; readonly placeholders: readonly ["interval"]; }; readonly OS8007: { readonly code: "OS8007"; readonly title: "A plot sets the price pane's own formatting"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{title} sets {option} while drawing over the price pane, which reformats the instrument's own axis."; readonly fix: "Set precision and format in the declaration, for the whole study, or drop them from a plot drawn over the price pane."; readonly placeholders: readonly ["title", "option"]; }; readonly OS8008: { readonly code: "OS8008"; readonly title: "An alert with no fixed id"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "This alert has no fixed id, so its identity is derived from its position at line {line}."; readonly fix: "Give the alert a stable id of your own: alert(\"text\", id = \"emaCross\")."; readonly placeholders: readonly ["line"]; }; readonly OS8009: { readonly code: "OS8009"; readonly title: "This plot can never draw"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{title} plots a value that is absent on every bar."; readonly fix: "Plot the value that was meant, or delete the plot and its settings row."; readonly placeholders: readonly ["title"]; }; readonly OS8010: { readonly code: "OS8010"; readonly title: "A name is never read"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} is assigned at line {line} and never read."; readonly fix: "Use the value, or delete the line."; readonly placeholders: readonly ["name", "line"]; }; readonly OS8011: { readonly code: "OS8011"; readonly title: "live var makes live and backtest differ"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} is a live var, so it keeps its value across the updates of the moving bar."; readonly fix: "Use var unless counting intrabar updates is the actual intent; keep live var only for that."; readonly placeholders: readonly ["name"]; }; readonly OS8012: { readonly code: "OS8012"; readonly title: "An ordered comparison against none is always absent"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "This {op} has none on one side, so it is absent on every bar."; readonly fix: "Test absence with isNone(x), or with x == none, both of which are always true or false."; readonly placeholders: readonly ["op"]; }; readonly OS8013: { readonly code: "OS8013"; readonly title: "Deprecated"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: true; readonly message: "{name} is deprecated since language version {version}; {replacement} does the same thing."; readonly fix: "Replace {name} with {replacement}; the two compute the same values."; readonly placeholders: readonly ["name", "version", "replacement"]; }; readonly OS8014: { readonly code: "OS8014"; readonly title: "A persistent value holds a bar index"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} keeps a bar index across bars, and every index shifts when more history loads."; readonly fix: "Store time instead and compare timestamps; the bar's time does not move."; readonly placeholders: readonly ["name"]; }; readonly OS8015: { readonly code: "OS8015"; readonly title: "This loop never runs"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "The loop starts at {start}, ends at {end} and steps {step}, so the body never runs."; readonly fix: "Add step -1 to count down, or swap the bounds to count up."; readonly placeholders: readonly ["start", "end", "step"]; }; readonly OS8016: { readonly code: "OS8016"; readonly title: "Unreachable code"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "Line {line} follows a return that always runs, so it never executes."; readonly fix: "Delete the unreachable lines, or move them above the return."; readonly placeholders: readonly ["line"]; }; readonly OS8017: { readonly code: "OS8017"; readonly title: "The condition is constant"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "This condition is {value} on every bar."; readonly fix: "Restore the test that was meant, or delete the branch that never runs."; readonly placeholders: readonly ["value"]; }; readonly OS8018: { readonly code: "OS8018"; readonly title: "An input is never used"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "The input {title} is declared at line {line} and never read."; readonly fix: "Use the name the input assigns, or delete the input() and its dialog row."; readonly placeholders: readonly ["title", "line"]; }; readonly OS8019: { readonly code: "OS8019"; readonly title: "A deleted object is still held"; readonly severity: "warning"; readonly stage: "check"; readonly since: 1; readonly autofix: false; readonly message: "{name} still holds the {kind} deleted at line {line}."; readonly fix: "Assign none to the name on the same path as the delete, and where the object came out of an array, remove the element as well as deleting the object."; readonly placeholders: readonly ["name", "kind", "line"]; }; readonly OS9001: { readonly code: "OS9001"; readonly title: "Version not read by the importer"; readonly severity: "error"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "The importer reads scripts written for version 5 or 6 of the source dialect, and this one {found}."; readonly fix: "Bring the script up to version 5 or 6 in the source dialect, or translate it by hand, and import it again."; readonly placeholders: readonly ["found"]; }; readonly OS9002: { readonly code: "OS9002"; readonly title: "Construct with no equivalent"; readonly severity: "error"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "The importer cannot translate {construct}, so the statement holding it was kept as a comment."; readonly fix: "Translate that statement by hand from the comment that holds it: the rest of the script was translated around it."; readonly placeholders: readonly ["construct"]; }; readonly OS9003: { readonly code: "OS9003"; readonly title: "Built-in with no mapping"; readonly severity: "error"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "{name} is not one of the built-ins the importer maps, so the statement holding it was kept as a comment."; readonly fix: "Find the OpenScript library call that does the same job, check how it treats its first bars and absent values, and write the statement by hand."; readonly placeholders: readonly ["name"]; }; readonly OS9004: { readonly code: "OS9004"; readonly title: "Declaration the importer cannot place"; readonly severity: "error"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "The importer writes the declaration from one indicator or strategy call at the top level, and this script {found}."; readonly fix: "Give the source script exactly one indicator or strategy declaration at the top level, and import it again."; readonly placeholders: readonly ["found"]; }; readonly OS9005: { readonly code: "OS9005"; readonly title: "Reads a statement that was not translated"; readonly severity: "error"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "{name} is declared by the statement at line {line}, which was not translated, so this statement that reads it was kept as a comment too."; readonly fix: "Translate the statement at line {line} by hand first, then this one, which was kept as a comment only because it reads {name}."; readonly placeholders: readonly ["name", "line"]; }; readonly OS9006: { readonly code: "OS9006"; readonly title: "Argument with no equivalent"; readonly severity: "error"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "{argument} changes what {call} computes or trades, and OpenScript has no equivalent the importer can write."; readonly fix: "Translate the call by hand, deciding what OpenScript should do in place of {argument}, or remove {argument} from the source script if the script does not depend on it."; readonly placeholders: readonly ["argument", "call"]; }; readonly OS9007: { readonly code: "OS9007"; readonly title: "Warmup and absent bars follow OpenScript"; readonly severity: "warning"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "{call} became {target} here and wherever else the script calls it, and {target} follows OpenScript's own warmup, arithmetic and handling of absent values, which the original is not guaranteed to share."; readonly fix: "Compare the first bars of the translation with the original, and where the script depends on them, write the value as an explicit recurrence held in var, seeded the way the original seeds it."; readonly placeholders: readonly ["call", "target"]; }; readonly OS9008: { readonly code: "OS9008"; readonly title: "Whole-number division in version 5"; readonly severity: "warning"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "Both sides of this division are whole-number constants, which version 5 of the source dialect divides without a fractional part, and OpenScript keeps the fraction."; readonly fix: "If the script relied on the whole-number result, wrap the translated division in trunc(); otherwise leave it as it is."; readonly placeholders: readonly []; }; readonly OS9009: { readonly code: "OS9009"; readonly title: "Presentation argument left out"; readonly severity: "warning"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "{argument} changes how {call} is displayed or what it may allocate, not what it computes, and OpenScript has no equivalent, so the translation leaves it out."; readonly fix: "Nothing needs to change unless the display mattered; where it did, restyle the translated call with the arguments OpenScript does have, such as its colour, width and style."; readonly placeholders: readonly ["argument", "call"]; }; readonly OS9010: { readonly code: "OS9010"; readonly title: "Order placed under OpenScript's order model"; readonly severity: "warning"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "{call} was translated into OpenScript's order calls here and wherever else the script uses it, and OpenScript decides when an order fills, how a reversal and a repeated entry are handled and when an exit level starts to apply by its own order model."; readonly fix: "Backtest the translation beside the original and compare the two trade lists before relying on it, and adjust the order calls by hand where they part."; readonly placeholders: readonly ["call"]; }; readonly OS9011: { readonly code: "OS9011"; readonly title: "Equality over two absent values"; readonly severity: "warning"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "Both sides of {operator} can be absent on the same bar, and OpenScript counts two absent values as equal, which the original is not guaranteed to do."; readonly fix: "If the original relied on two absent values never comparing equal, guard the translated comparison with isNone() on either side."; readonly placeholders: readonly ["operator"]; }; readonly OS9012: { readonly code: "OS9012"; readonly title: "The translation does not compile"; readonly severity: "error"; readonly stage: "import"; readonly since: 1; readonly autofix: false; readonly message: "The OpenScript compiler refused the translation of this statement with {code}, so the statement was kept as a comment."; readonly fix: "Look up {code} in this catalogue and translate the statement by hand in the form that code's fix describes."; readonly placeholders: readonly ["code"]; }; }; /** Every code the compiler and the engines may emit. Nothing else is one. */ export type DiagnosticCode = keyof typeof ENTRIES; //# sourceMappingURL=catalogue.generated.d.ts.map