Errors
Diagnostic codes
A problem a script stops with, or is warned about, carries a stable code. The engine defines 273 of them.
- The message can be reworded. The code keeps its meaning and is never reused.
- 235 are errors and 38 are warnings.
- A message or meaning that carries a figure or a name the checks of this site hold back is not shown here. The editor in the chart shows the whole message, with the line.
| Code | Kind | Meaning |
|---|---|---|
E-CHUNK-LATE | ERROR | Not shown on this site. |
E-CHUNK-SKEW | ERROR | Not shown on this site. |
E-COMPILE-REPEAT | ERROR | Calls of overloaded functions or shared method names nest so deep that compiling their arguments again for every version blows up. |
E-DT-ZONE | ERROR | A date-time without a time zone. |
E-ENGINE-PART-UNAVAILABLE | ERROR | A part of the engine could not be loaded or did not start: absent, unreadable, no manifest or loader registered, a file that imports a file the manifest does not list, it threw when it started. The script was not run. |
E-ENGINE-PART-VERSION | ERROR | Not shown on this site. |
E-FMT-SPEC | ERROR | `text.fmt` (the text of an f-text piece) was given a format it does not know. |
E-FUTURE-READ | ERROR | A strategy looks ahead (`future = true`) on a value that is not shifted: it would trade on prices the bar did not have. A script that makes alerts gets it too when the unshifted value reaches an alert (`alert()` / `alertcondition`, directly or as the condition they run under); a look-ahead that only draws is the warning `W-FUTURE-READ`. |
E-IMPORT-COUNT | ERROR | The script imports too many libraries. |
E-IMPORT-CYCLE | ERROR | A library imports itself, directly or through other libraries. |
E-IMPORT-DEPTH | ERROR | Libraries import each other too many levels deep. |
E-IMPORT-SIZE | ERROR | The libraries the script imports are too large together. |
E-INPUT-RANGE | ERROR | A value given for an input is above its `max`, below its `min`, not a number (or not a whole number for an `int`), or not one of its `options`: the script does not start, whoever the host is (`ScriptProgram.begin`); nothing is clamped. The message names the input and its value. |
E-LIMIT-DEPTH | ERROR | Not shown on this site. |
E-LIMIT-DRAW | ERROR | A drawing, polyline or point list is larger than the limit. |
E-LIMIT-HISTORY | ERROR | Not shown on this site. |
E-LIMIT-HISTORY-STATIC | ERROR | Not shown on this site. |
E-LIMIT-ITEMS | ERROR | An array, map or matrix is larger than the limit. |
E-LIMIT-MEMORY | ERROR | Not shown on this site. |
E-LIMIT-OPS | ERROR | The budget of operations is spent. |
E-LIMIT-REGEX | ERROR | Not shown on this site. |
E-LIMIT-TABLE | ERROR | A table: its size, its cells, the live cells together, or a cell outside the table. |
E-LIMIT-TEXT | ERROR | A text is longer than the limit. |
E-LIMIT-TIME | ERROR | Not shown on this site. |
E-LOOP-STEP | ERROR | The step of a loop is zero or `na`. |
E-MODULE-HASH | ERROR | The text of a module is not the one its hash was taken of. |
E-MODULE-NOT-FOUND | ERROR | A module that a script imports, or a bundle holds, is not found. |
E-ORDER-ID | ERROR | An order id differs from one already used only in case, spaces, `_` or `-`. |
E-PERIOD-NAME | ERROR | Not shown on this site. |
E-PERIOD-TF | ERROR | `prior()` / `current()` of a period that is not longer than the chart's own bar (`prior(day)` on a daily or weekly chart). |
E-QTY-NA | ERROR | The size of an order is `na`. |
E-REGEX-FEATURE | ERROR | A pattern of `text.match` uses what the matcher does not read: a back-reference, look-ahead or look-behind, a named group, `\p{..}`, `\cX`. |
E-REGEX-HOST | ERROR | `text.match` runs in a host that did not install the matcher (the page's engine and editor bundles only compile; the worker, the tester, the sandbox and the converter install it). |
E-REQ-CHANGED | ERROR | The symbol or the timeframe of a request is not the same on every bar of a run: made of a price, a bar number or a name a statement writes, at compile time, or a function's parameter whose value changed (the message names the bar). |
E-REQ-LIMIT | ERROR | Not shown on this site. |
E-REQ-UNDECLARED | ERROR | A request names a symbol written in the script that the `uses` line does not declare. |
E-SANDBOX-BUSY | ERROR | The sandbox queue is full. |
E-SANDBOX-CRASH | ERROR | The process that ran the script died. |
E-SANDBOX-JOB | ERROR | The sandbox job failed. |
E-SANDBOX-OOM | ERROR | The sandbox stopped the script: memory. |
E-SANDBOX-TIMEOUT | ERROR | The sandbox stopped the script: wall-clock time. |
E-SCRIPT | ERROR | The script itself failed inside the sandbox (its own code is in `scriptCode`). |
E-SESSION-DUP | ERROR | Not shown on this site. |
E-SESSION-NAME | ERROR | A session name that is not declared above its use, or an empty one. |
E-SESSION-TEXT | ERROR | The hours of a session (`HHMM-HHMM[,HHMM-HHMM…][:days]`) or a time of day (`HH:MM`) are not written in the form the chart reads, or are not written in the script. |
E-SESSION-ZONE | ERROR | A session or a clock time names a time zone the chart does not know (it used to be read as UTC). |
E-STATE-SESSION | ERROR | `state session` without a name while the script declares more than one session. |
E-TF-UNKNOWN | ERROR | A text that names a timeframe is not one the chart knows: `data.series`, `data.intrabars`, `bar.time_in`, `bar.close_time_in`, `tf.changed` and `tf.to_seconds` read a text written in the script at compile time; `request.security` also reads the one it is given when it runs. |
E-TS-ZONE | ERROR | `clock.timestamp(text)` without a time zone. |
E1001 | ERROR | A text is not closed. |
E1002 | ERROR | A tab in indentation. |
E1003 | ERROR | A colour is not written #RRGGBB or #RRGGBBAA. |
E1004 | ERROR | An unexpected character. |
E1005 | ERROR | A line is indented to a width that no block above uses. |
E1006 | ERROR | A bracket is not closed, or has no opening bracket. |
E1007 | ERROR | A number is not written correctly. |
E1008 | ERROR | An unknown escape in a text. |
E1009 | ERROR | Not shown on this site. |
E1010 | ERROR | A { or } in an f-text is not closed or not doubled. |
E1011 | ERROR | A Persian or Arabic digit (quick fix: the ASCII digit). |
E1012 | ERROR | An Arabic comma or semicolon (quick fix: the ASCII sign). |
E1013 | ERROR | A curly quote (quick fix: the ASCII quote). |
E1014 | ERROR | A look-alike sign such as a multiplication or minus sign (quick fix: the ASCII operator). |
E1020 | ERROR | Not a valid clock time. |
E1021 | ERROR | Not a valid date or time. |
E1022 | ERROR | Not a time zone the chart knows. |
E1023 | ERROR | Not shown on this site. |
E1090 | ERROR | The source is too large. |
E1091 | ERROR | The source has too many tokens. |
E1092 | ERROR | A line is too long. |
E1093 | ERROR | Brackets or indentation nested too deep. |
E2001 | ERROR | An if used as a value has no else. |
E2002 | ERROR | Something other than what the grammar expects here. |
E2003 | ERROR | A block is not indented under its first line. |
E2004 | ERROR | A block has no line. |
E2005 | ERROR | A statement does not end at the end of its line. |
E2006 | ERROR | A value was expected. |
E2010 | ERROR | A chained comparison. |
E2011 | ERROR | = where == was meant. |
E2021 | ERROR | An unknown number format in an f-text. |
E2030 | ERROR | An input has neither a type nor a literal default. |
E2031 | ERROR | An option is repeated, or a positional value follows a named one. |
E2032 | ERROR | Not shown on this site. |
E2041 | ERROR | Not shown on this site. |
E2050 | ERROR | A match arm without =>. |
E2051 | ERROR | _ is not the last arm of a match, or is given twice. |
E2052 | ERROR | Not shown on this site. |
E2070 | ERROR | An import without a version and an alias. |
E2072 | ERROR | An input is written inside a block (an `if`, a loop, a function) instead of at the top level of the file or in a group. |
E2073 | ERROR | A group lists something other than inputs. |
E2074 | ERROR | A session declared inside a block, not at the top level of the file. |
E2080 | ERROR | The file does not start with a header. |
E2081 | ERROR | The header is written twice. |
E2082 | ERROR | A header option or a line of a block is given twice. |
E2090 | ERROR | An expression nested too deep. |
E2099 | ERROR | Too many errors: the list stops. |
E2100 | ERROR | Not shown on this site. |
E2102 | ERROR | A block (`setup:`, `execution:`, `margin:`) is written twice. |
E3101 | ERROR | A name is declared twice in one function. |
E3102 | ERROR | A value is given to a name that is not declared. |
E3103 | ERROR | A value is given to a let, an input, a parameter or another name that cannot change. |
E3104 | ERROR | A function gives a value to a mut or state declared outside it. |
E3110 | ERROR | A type that an input cannot have. |
E3120 | ERROR | An id is used twice. |
E3121 | ERROR | Key or was is not a text written in the script. |
E3130 | ERROR | An option, argument or field that does not exist. |
E3131 | ERROR | A value that does not fit the option, or that must be written in the script. |
E3132 | ERROR | `future = true` in a strategy (it would trade on prices it could not have seen). |
E3133 | ERROR | A show_if or check that uses something other than inputs and constants (a let, a series, a function that keeps state, a list). |
E3134 | ERROR | A show_if that depends on itself through the inputs it names. |
E3135 | ERROR | A setting of a block (`setup:`, `execution:`, `margin:`) uses a series, a `let` or a call that keeps state: only inputs and constants of the chart are allowed. |
E3136 | ERROR | A block (`setup:`, `execution:`, `margin:`) in a file that is not a strategy, or inside another block. |
E3140 | ERROR | Return outside a function. |
E3141 | ERROR | A function returns another number of values than its type says. |
E3142 | ERROR | Break or continue outside a loop. |
E3143 | ERROR | A tuple of one length is given to another number of names. |
E3144 | ERROR | Return, break or continue leaves a block that gives a value. |
E3150 | ERROR | Not shown on this site. |
E3151 | ERROR | A function is used before its definition. |
E3160 | ERROR | A call of a function the chart does not know. |
E3161 | ERROR | More arguments than a function takes. |
E3162 | ERROR | A named argument the function does not have. |
E3163 | ERROR | Fewer arguments than a built-in function needs. |
E3164 | ERROR | An argument given twice. |
E3170 | ERROR | Not shown on this site. |
E3171 | ERROR | A name that is not declared. |
E3172 | ERROR | A name that a module does not export. |
E3173 | ERROR | `a[i]` on an array: it reads the history of the array, not its item. |
E3180 | ERROR | A strategy size or fee helper outside the strategy header. |
E3190 | ERROR | An edition this build does not support. |
E3200 | ERROR | Uses takes something other than texts written in the script. |
E3201 | ERROR | An empty array whose element type is not known. |
E3202 | ERROR | An array written out with too many items. |
E3210 | ERROR | A built-in function was called with fewer arguments than it needs. |
E3211 | ERROR | The `once` value of `alert.send()` is not one the chart knows. |
E3251 | ERROR | A session that starts and ends at the same time of day. |
E3260 | ERROR | A session used as a value, not through one of its members (`.active .start .end .index .high .low`). |
E3261 | ERROR | `prior(…)` or `current(…)` used without a field (`prior(day).high`). |
E3270 | ERROR | A unit word (`ticks`, `ms`) outside a setting of `execution(…)` in the strategy header. |
E3271 | ERROR | Not shown on this site. |
E3280 | ERROR | `state session` without the name of the session while the script declares several. |
E3281 | ERROR | `state session` in a script that declares no session. |
E3301 | ERROR | `data.*` or a stateful call (`tech.*`, a function that keeps state) inside a loop. |
E3302 | ERROR | A call that keeps a state stands directly in an operand that runs only when it is needed: the right side of `and`, `or` or `??`, or an arm of `if … then … else`. |
E3310 | ERROR | A function calls itself, directly or through other functions (methods included); the message lists the cycle (`a -> b -> a`). |
E3400 | ERROR | A name you declared is also an option word of the slot it stands in, and has another type: your variable wins, the slot is a mismatch. |
E3406 | ERROR | An option word of several sets (`top`, `left`, `none` ...) where nothing says which set: write the type, `let s: v_align = top`. |
E3407 | ERROR | A word the option slot does not have, with the nearest word and the list (`style = dashd`). |
E4001 | ERROR | Another symbol has no data on this chart. |
E5000 | ERROR | The engine refused a program the front end accepted (its own message). |
E5001 | ERROR | An internal error of the front end or the formatter. |
E5101 | ERROR | A session must be declared at the top of the script (not inside if, for or a function). |
E5102 | ERROR | Alert.send(… = …) must be written in the script (a text or a number), not computed or read from an input. |
E5103 | ERROR | Not shown on this site. |
E5104 | ERROR | Id must be a name written in the script, as a text: letters, digits and _, starting with a letter or _. |
E5105 | ERROR | Was must be a text written in the script: the earlier id, or several separated by spaces. |
E5106 | ERROR | Was: "…" is not a name. |
E5107 | ERROR | Was: "…" is the id itself. |
E5108 | ERROR | The id "…" is already used by …. |
E5109 | ERROR | An input's default value must be a constant. |
E5110 | ERROR | The options of an input are a list in brackets: [a, b, c]. |
E5111 | ERROR | Every option of an input must be a constant. |
E5112 | ERROR | …(…) must be called on the top level of the script (not inside if, for or a function). |
E5113 | ERROR | Level(…) must be called on the top level of the script. |
E5114 | ERROR | Level(…) needs a constant price (a number or an input). |
E5115 | ERROR | Shade(…) must be called on the top level of the script. |
E5116 | ERROR | Not shown on this site. |
E5117 | ERROR | Alert.when(…) must be called on the top level of the script (not inside if, for or a function). |
E5118 | ERROR | Alert.when(…, on = …) must be the text "rises" or "level", written in the script. |
E5119 | ERROR | Data.series needs an expression to read. |
E5120 | ERROR | "…" is already declared here; give it a new value with :=. |
E5121 | ERROR | A return is only valid inside a function. |
E5122 | ERROR | "…" is not declared; declare it with = first. |
E5123 | ERROR | Only a variable or a field can be given a new value. |
E5124 | ERROR | Functions are defined at the top level of a script. |
E5125 | ERROR | Parameter "…" is listed twice. |
E5126 | ERROR | The library "…" is not in your scripts. Add it under My scripts (as a library) and try again. |
E5127 | ERROR | "…" is a function: call it with ( ). |
E5128 | ERROR | "…" is not declared. |
E5129 | ERROR | "…" is not a member of …. |
E5130 | ERROR | "…" is a function: call it with ( ). |
E5131 | ERROR | "…" is not a built-in variable this chart knows. |
E5132 | ERROR | … takes at most … argument…. |
E5133 | ERROR | … has no argument "…". |
E5134 | ERROR | Create a … with ….new(…). |
E5135 | ERROR | "…" is not a function this chart knows. |
E5136 | ERROR | The library "…" has no function "…". |
E5137 | ERROR | "…" is not supported on this chart yet. |
E5138 | ERROR | Only names can be called. |
E5139 | ERROR | ….copy takes the object to copy. |
E5140 | ERROR | "…" is not a method this chart knows. |
E5141 | ERROR | This constant is built from other constants too many times over (each one is used twice or more by the next). Put a value in a variable once and use that. |
E5142 | ERROR | This is a library: other scripts import it; it does not draw on its own. |
E5601 | ERROR | "…": the … is na. |
E5602 | ERROR | Index … is out of bounds (array size is …). |
E5603 | ERROR | "…": the size cannot be negative (…). |
E5604 | ERROR | Cannot call "array.pop" on an empty array. |
E5605 | ERROR | Cannot call "array.shift" on an empty array. |
E5606 | ERROR | "array.slice": from (…) is after to (…). |
E5607 | ERROR | Not shown on this site. |
E5608 | ERROR | "map.set": the key is na (a map key must have a value). |
E5609 | ERROR | Row … is out of bounds (the matrix has … rows). |
E5610 | ERROR | Column … is out of bounds (the matrix has … columns). |
E5611 | ERROR | … … is out of bounds (the matrix has … …). |
E5612 | ERROR | … … is out of bounds (the matrix has … …). |
E5613 | ERROR | "…": from_… (…) is after to_… (…). |
E5614 | ERROR | "…" needs a square matrix (this one is …x…). |
E5615 | ERROR | "matrix.new": the size cannot be negative (…x…). |
E5616 | ERROR | "…": the array has … elements but the matrix has … columns. |
E5617 | ERROR | "…": the array has … elements but the matrix has … rows. |
E5618 | ERROR | "…": the matrix has no rows. |
E5619 | ERROR | "…": the matrix has no columns. |
E5620 | ERROR | "…": a …x… matrix (… elements) cannot become …x…. |
E5621 | ERROR | "…": the matrices have … and … columns. |
E5622 | ERROR | Not shown on this site. |
E5623 | ERROR | "…": the first matrix has … columns but the second has … rows. |
E5624 | ERROR | "…": the matrix has … columns but the array has … elements. |
E5625 | ERROR | "…": the power cannot be negative (…). |
E5626 | ERROR | A table needs a number of columns and rows. |
E5627 | ERROR | Unknown pivot point type "…" (Traditional, Fibonacci, Woodie, Classic, DM or Camarilla). |
E5628 | ERROR | Tech.pivot_levels: "developing" cannot be true with the Woodie type. |
E5629 | ERROR | Cannot set "…" of na. |
E5630 | ERROR | "…" cannot be set here. |
E5631 | ERROR | "…" is not a field of this value. |
E5632 | ERROR | Cannot call "…" on na. |
E5633 | ERROR | A … has no method "…". |
E5634 | ERROR | This script is an indicator: only a strategy (a strategy header at the top) places orders to test. |
E5635 | ERROR | Cannot call "…" on na (the … was never created). |
E5636 | ERROR | "…" needs …, not a …. |
E5637 | ERROR | …. |
E5638 | ERROR | The script stopped (log.abort). |
E5639 | ERROR | The script calls itself too deeply. |
E5640 | ERROR | …. |
E9001 | ERROR | Not shown on this site. |
E9002 | ERROR | Not shown on this site. |
W-ENGINE-ALERT-CUT | WARNING | The message of an alert is cut to … characters. |
W-ENGINE-CONST-ARG | WARNING | … … must be a constant written in the script; it stays at its default value. |
W-ENGINE-CURRENCY-RATE | WARNING | Not shown on this site. |
W-ENGINE-HISTORY-OPEN | WARNING | Dynamic lookback has no declared upper bound; execution is limited to … bars (an offset nothing in the script bounds: an input without a `max`, a parameter). |
W-ENGINE-HTF-NOT-LOADED | WARNING | The … bars are not available yet; data.series reads na. |
W-ENGINE-HTF-RESAMPLED | WARNING | The … bars are built from the chart's own bars (the market server sent none): they reach only as far back as the chart does. |
W-ENGINE-INDICATOR-TIMEFRAME | WARNING | Indicator(timeframe=…) is not supported yet: the script runs on the chart's timeframe. |
W-ENGINE-LIBRARY-CHANGED | WARNING | The library "…" changed since this script was last saved (… -> …); the script may behave differently. |
W-ENGINE-LIST-INPUT | WARNING | The list of the input "…" cannot be read as a list: it is empty here. |
W-ENGINE-LOG-DROPPED | WARNING | … log lines were dropped: a bar keeps … lines and a run …. |
W-ENGINE-LOWER-TF | WARNING | Data.series of a lower timeframe reads the chart's own bars here. |
W-ENGINE-LOWER-TF-FORM | WARNING | Data.intrabars reads the chart's own bar here (lower timeframes are not loaded). |
W-ENGINE-OTHER-SYMBOL | WARNING | Data.series can only read this chart's symbol here; another symbol reads na. |
W-ENGINE-RANDOM-SEED | WARNING | Math.random draws from the run seed … (script = its identity: the host's id, else the title of the header): the same identity, inputs, explicit seed and dataset id give the same numbers on every machine, whatever the text of the script is. |
W-ENGINE-REQUEST-NA | WARNING | … is not available on this chart; it reads na. |
W-ENGINE-SOURCE-DEFAULT | WARNING | Not shown on this site. |
W-ENGINE-STRATEGY-NOT-SIMULATED | WARNING | Strategy orders are not simulated on the chart: open the Strategy tester to test it. |
W-ENGINE-TEXT-CUT | WARNING | A text of a label, box or table cell is cut to … characters. |
W-ENGINE-TICKER-KIND | WARNING | The chart kind "…" is not applied here; data.series reads the ordinary candles. |
W-ENGINE-VWAP-NO-VOLUME | WARNING | Tech.vwap reads na: the bars of this chart have no volume. |
W-ENGINE-ZONE-UNKNOWN | WARNING | The time zone "…" is not known; it is read as UTC. |
W-FTEXT-PLACEHOLDER | WARNING | An alert placeholder written in an f-text. |
W-FUTURE-READ | WARNING | A read of another timeframe asks for the future (`future = true`) on a value that is not shifted: a warning with the line and the fix; an info note when the check cannot follow the value. |
W-ID-ANON-NONASCII | WARNING | A plot whose id comes from its position. |
W-ID-COLLISION | WARNING | Not shown on this site. |
W-ID-LOOKALIKE | WARNING | A name uses an Arabic letter that looks like a Persian one. |
W-INT-BOOL | WARNING | A number used as a condition. |
W-LIVE-READ | WARNING | A read that shows the forming bar of another timeframe (`live = true`). |
W-MATCH-OPEN | WARNING | A match that does not cover every case. |
W-METHOD-SHADOWS-BUILTIN | WARNING | A method of the script takes the place of a built-in one. |
W-MUT-COUNTER | WARNING | A mut counter that starts again every bar. |
W-NA-COMPARE | WARNING | A comparison with na, which is never true. |
W-OBJECT-LIMIT | WARNING | Drawings, sloped fills or tables were dropped to keep the newest ones, or a drawing limit was cut to what the chart allows. |
W-REPAINT | WARNING | The replay found a closed bar whose figures changed (error level) or a signal that came late (warning level). |
W-SHADOW-BUILTIN | WARNING | A name hides a built-in name. |
W-SHADOW-GLOBAL | WARNING | A name in a function hides one declared outside it. |
W-UNMODELLED | WARNING | A setting the engine takes and does nothing with (the text says which and why). |
W3302 | WARNING | A call that keeps a state stands in a block that may not run (an `if` or `else` block, a `match` arm, a `state` initializer, the lines after a conditional `return`, `break` or `continue`): legal, and its state moves only on the bars where the block runs. |