Lint and error codes
Every lint rule id and runtime error code Chartnaut reports for scripts, with its severity and the fix. Look up the id shown in the builder's Problems list or in an agent's tool result, fix the line, and lint again.
How to read this page
error blocks the save, the preview or the run. warn is advisory: the script runs, but the result is worse or will surprise someone.
Where says which script type the rule checks: I indicator, D definition, S study. Some rules have a different severity per type; the table says so.
The indicator lint runs in the builder and in the agents'
lint_indicatortool, so a person and an agent see the same findings. A definition is linted by the same rule set on save and by the Definition authoring agent.A few problems throw without a rule id. The common ones are listed in the last section of this page.
Sandbox
Id | Severity | Where | Fix |
|---|---|---|---|
| error | D | Remove the blocked call: |
| error | D, S | Scripts are synchronous. Remove |
| error | D, S | Remove |
| error | D, S | Replace |
| error | D | Replace |
| warn | I |
|
Files, modules and entry
Id | Severity | Where | Fix |
|---|---|---|---|
| error | D, S | Add a file. |
| error | D | Mark one file as the entry ( |
| error | D | Keep exactly one |
| error | D, S | Put |
| error | D | Two files share a path. Rename one. |
| error | S | Studies are one file. Merge helpers into |
| error | S | Declare |
| error | S | The study exports |
| error | S | The study exports |
| error | S | Trade studies group by trade and never export |
| error | S | The study bundled to nothing. Check the file has code. |
| error | D | Move |
| error | D | The entry file must declare |
| error | D | Only the entry file exports |
| error | D | More than one file exports |
| warn | D | No file exports |
| error | D | Package imports are not supported. Use a relative path such as |
| error | D | Write the extension: |
| error | D |
|
| error | D | The path leaves the definition's folder. Keep imports inside it. |
| error | D | The imported file does not exist. Fix the path or add the file. |
| error | D | Two files import each other. Move the shared code into a third file. |
| error | D | Syntax error in a module. The message names the file and position. |
| error | D | Export with |
| error | D | Remove |
| error | D | Replace |
| warn | D | Nothing imports this file from the entry, so it never runs. Import it or delete it. |
| error | D, S | Add a |
| error | D, S | Keep one |
| error | D, S | The script threw while its declarations were read. The message is the thrown error. |
| error | D, S | The script did not compile. Fix the syntax error in the message. |
| error | D, S | The settings declarations are invalid. The message names the input. |
| error | S |
|
| error | D | Saving could not work out the definition's timeframes. Fix the |
| error | D | A declared dependency cannot be read by your account. Pick one you own or one that is public. |
| error | D | The definition declares inputs but no |
Meta, settings and data source
Id | Severity | Where | Fix |
|---|---|---|---|
| warn | D | Give |
| error | D |
|
| warn | D |
|
| warn | D | Replace |
| warn | D | Drop |
| error | D | The legacy |
| error | D | The legacy |
| warn | D | A higher timeframe is not a whole multiple of the lowest. Buckets will misalign. |
| error on I, warn on D | I, D |
|
| error | I, D |
|
| error | I, D |
|
| error | I, D |
|
| warn | I, D |
|
| error | D, S | Use a known param type: |
| error | D, S | The color default is not a valid color. |
| error | D, S | The default has alpha but the param does not set |
| warn | D, S | A string param has a color default. Use |
| error | D |
|
| error, or warn for a string param | D |
|
| warn | I |
|
| warn | I | Use a known gate: |
Timeframes and summaries
Id | Severity | Where | Fix |
|---|---|---|---|
| error | I, D |
|
| error | I, D | Call |
| error | I, D | Pass the |
| error | I, D |
|
| error | I, D | The argument is not timeframe-typed (a template string, a free variable). Use a literal, |
| warn on I, error on D | I, D | An |
| error | I, D |
|
| error | I, D | The only option is |
| error | I, D |
|
| error | I, D |
|
| error | I, D | Inside a handler, |
| error | I, D | One |
| error | I, D | The timeframe analyser could not parse the source. Fix the syntax error first. |
| error | I, D |
|
| error | I, D | Run-time form of |
| error | I, D | Run-time form of |
| error | I, D | Run-time form of |
| warn | I | A handle lists a read its handler never calls. Drop it or read it. |
| error | D |
|
| error | I, D |
|
| error | I, D | Write the window as an object literal, not a variable or spread. The runtime sizes history from it. |
| error | I, D | Keys are |
History window and state
Id | Severity | Where | Fix |
|---|---|---|---|
| error | I, D | The script keeps state but declares no warmup, so its values would depend on where the run began. Call |
| error | I, D | A warmup is declared and handles exist, but no handle registers an |
| error | D | A |
| error on I, warn on D | I, D | A running sum, count or high declared with a count means "since the cell began". Declare |
| warn | I, D |
|
| warn | I, D | The script resets on |
| warn | I, D | An EMA or Wilder average whose length the lint can read is declared under 30x (EMA) or 50x (Wilder) that length. Declare |
| warn | I, D | The declared warmup or retain exceeds your plan's indicator memory on a timeframe and was clamped. The message gives the effective |
The state/never-forgets warning on definitions will become an error once the number of existing definitions it would refuse has been measured.
Events and emits
Id | Severity | Where | Fix |
|---|---|---|---|
| error | D | Give |
| error | D | Give |
| error | D | An event id is declared twice across files. |
| error | D | A payload field type must be |
| error | D | Every payload field needs |
| error | D | Remove |
| warn | D | Use |
| warn | D |
|
| warn | D | Price paints need a numeric |
| warn | D | Pass a non-empty |
| warn | D | The same event is painted by |
| error | D | A snapshot schema field has an invalid type. |
| error | D | A snapshot id is declared twice. |
Outputs and lifecycle
Definitions use outputs.declare and the outputs/* rules. Indicators use output.* and the output/* rules.
Id | Severity | Where | Fix |
|---|---|---|---|
| error | D |
|
| error | D | The paint verb does not match the declared kind, e.g. |
| warn | D | An output is declared but never painted. |
| error | D |
|
| error | D | Invalidating hlines need |
| warn | D |
|
| error | D |
|
| warn | D | Set |
| error | D |
|
| warn | D |
|
| warn | D | The preset name is not known for this kind. Use a listed preset or a predicate function. |
| error | D | Trendlines take a predicate function, never a preset name. |
| error | D |
|
| warn | D |
|
| error | D |
|
| error | D |
|
| error | D |
|
| error | D |
|
| warn | D | Pass |
| warn | D | Pass |
| error | D |
|
| error | I | Same as |
| warn | I | Same as |
| warn | I | Unknown |
| error | I | Same, for |
| warn | I | Same, for |
| warn | I | Unknown |
| error | I |
|
| error | I |
|
| error | I |
|
| error | I | Trendlines have no presets. Pass an inline predicate. |
| error | I |
|
| error | I | An invalidating output needs |
| warn | I |
|
| error | I |
|
| error | I, D | The predicate reads the wrong shape. It receives |
| warn | I, D | Rename the predicate argument from |
On indicators, only the rules the builder classes as advisory are warnings. The trendline and hline-event-without-mode rules are not on that list, so they block.
Layers
Id | Severity | Where | Fix |
|---|---|---|---|
| error | I, D | No |
| error | I, D | Write layer rows from the chart |
| error | I, D | Nothing writes to the layer. Call |
| error | I | A layer that seals rows ( |
| warn | I, D |
|
| warn | I, D | The layer has neither |
| warn | I, D |
|
| warn | I, D |
|
Dependencies
Id | Severity | Where | Fix |
|---|---|---|---|
| error | D |
|
| error | D |
|
| error | D | Each |
| error | D | Replace |
| error | D, S | Pin |
| error | D | No native, scripted indicator or definition has this slug. |
| error | D | The pinned version does not exist. The message lists the ones that do. |
| error | D | The dependency graph loops back to this script. |
| error | D | Read series by output key: |
| error | S | Pin |
| warn | S | Server form of the same check: an unpinned indicator floats to the latest version. |
| warn | S | Server form: an unpinned definition floats to the latest version. |
| error | D |
|
| error | D |
|
| error | D | Each import alias must be unique. |
| error | D | The definition rebuilds zone invalidation that its dependency already has. Read |
| error at run time | D, S | A built-in indicator was pinned to a version other than |
Sessions and ctx use
Id | Severity | Where | Fix |
|---|---|---|---|
| error | D |
|
| error | D |
|
| warn | D | A param looks like a bar-count session knob. Use |
| warn | D |
|
| error | D |
|
Workload
Id | Severity | Where | Fix |
|---|---|---|---|
| warn | I | A loop steps price by |
| warn in the dry run | I, D | The projected rows per bar are high (soft) or excessive (hard). Coarsen the row size. |
| warn in the dry run | I, D | The TPO zone spans too many ticks. Check the tick size. |
Studies
Id | Severity | Fix |
|---|---|---|
| error |
|
| error |
|
| error |
|
| error |
|
| error | The volume-at-price tape is not available. Read upstream events, visuals or |
| error | Definition-only DSL. Studies use |
| error |
|
| error |
|
| warn |
|
| error |
|
| error |
|
| error |
|
| error |
|
| error |
|
| warn | A published payload is missing keys its result kind needs. |
| error, or warn for an unguarded read | Read |
| error | Do not treat |
| error | Survival or invalidation measurements need |
| error | Call |
| error |
|
| error | Event-cursor APIs have no clock in |
| error | Add |
| warn | A declared result is never published. |
| warn | Add a |
| warn | Add a |
| warn | Heavy chart results need a compact |
| warn | Rows carry a dimension but the result has no |
| error | Rows (or |
| warn | A declared column is not set on published rows. |
| error |
|
| error |
|
| error | A dimension id is declared twice. |
| error, or warn on a hand edit of a study that groups with | Export |
| error |
|
| error |
|
| error |
|
| error for |
|
| error |
|
| error |
|
| error | A study without |
| warn | A study without |
| error | A study without |
| error | A study without |
| error | A study without |
| error | A scope value is not one of the dimension's declared |
| warn | A scope dimension is in no result's |
| warn | A report dimension is in no result's |
| warn | The scope tuple holds two or more scope dimensions, so publish one result indexed by all of them. |
| warn | A study without |
| warn | Bucketed results need declared dimensions returned from |
| error | The Study authoring agent's proposal failed a real run on a preset market. The faults are listed. |
Run-time errors
Indicator and definition budgets
A script that goes over a budget stops with <kind> exceeded: <observed> / <limit> and a remedy. Soft limits warn once; hard limits stop the run.
Kind | Limit | Fix |
|---|---|---|
| warn at 2 s, stop at 30 s per calculation | Use less history or do less per bar. |
| 5 s in one handler call | Avoid loops over every price tick on every bar. |
| 350,000 per handler; per run it scales with bars, from 2 million to 50 million | Process each higher-timeframe bucket once; use the tick size. |
| 500,000 per handler | Fewer |
| warn at 500,000, stop at 2,000,000 | Emit on transitions only, or use less history. |
| warn at 25,000, stop at 100,000 | Tighten emit conditions or declare |
| warn at 256, stop at 1,024 | Reuse fewer |
| warn at 2,500, stop at 10,000 | Emit fewer persistent ranges, or use |
| 100,000 per key, 500,000 total | Aggregate before collecting. |
| Publish smaller payloads. | |
| warn at 5,000, stop at 20,000 rows per layer | Seal and remove old rows, or key one row per session. |
| warn at 4 MB, stop at 32 MB per layer | Coarsen |
| warn at 2.5 s, stop at 10 s | Lower the warmup, or keep running sums in handlers instead of arrays. |
Layers also stop with frame hooks are read-only when a renderer writes, and pause with paint exceeded the 4 ms frame budget when painting stays slow for three frames.
Emits dropped at run time
A definition's run counts every emit it drops. These are the reasons:
Reason | Cause | Fix |
|---|---|---|
|
| Pass |
| The id has no | Declare it. |
| The event's | Expected. Widen the keys if you wanted repeats. |
| The bar was in the warmup. Warmup bars compute state but record no events. | Expected. |
Dependency output
Code | Cause | Fix |
|---|---|---|
| A declared dependency produced no value for the output you read. |
Study run errors
A failed study run reports one of these kinds with a request ID for support.
Kind | Meaning | Fix |
|---|---|---|
| The study did not compile. | Fix the error in the message. |
| The study threw. | Fix the line in the message. |
| One event took longer than 15 s, or | Do less per event. |
| 10 or more events timed out in one run. | Do less per event. |
| Events kept throwing. | Fix the first reported error. |
| The run passed 10 minutes. | Use a shorter range or fewer dependencies. |
| The run ran out of memory. | Use a shorter range. |
| Recursion deeper than 1,024 calls. | Remove the recursion. |
| More than 100,000 events. | Use a shorter range or a more selective definition. |
| The definition produced too many events. | Tighten its conditions. |
| An indicator produced too many points. | Use a shorter range or fewer outputs. |
| Too many collected rows. | Collect fewer values. |
| More than 10,000 chart annotations. | Annotate less often. |
| Results too large. | Publish fewer or smaller results. |
| A forward scan of more than 5,000 bars. | Shorten the forward window. |
| Statistics helper limits: 200 iterations, 100,000 samples, 128 features. | Reduce the size. |
| Market data did not load in time. | Try again. |
| A definition run the study waited on did not finish. | Retry the definition run. |
| The instrument cannot serve data the study needs, such as the volume tape on an FX CFD. | Pick another instrument. |
| The script generates code at run time. | Remove |
| Study execution is busy. | Try again shortly. |
| The run was cancelled. | |
| Something failed on Chartnaut's side. | Contact support with the request ID. |
Scope errors
A problem with one event's scope() call leaves that event out of the study and the run continues. The run lists each error.
Message | Fix |
|---|---|
| Return on every path. |
| Return an object. |
| Declare it, or drop it from the tuple. |
| Measure it in |
| Set every scope dimension in every tuple. |
| The value is outside the dimension's declared |
| Fix the line in the error. |
|
|
A finished run warns with study/pin-cell-count-mismatch when a pin_cell reports an n that differs from the number of events scope() put in that group. Build cells from ctx.groupByScope(rows) so each n counts exactly the events a marker can land in. See scope.
Errors without a rule id
Message starts with | Where | Fix |
|---|---|---|
| I | Add |
| I | Add |
| I | Give every output an |
| I | Export |
| I | Add |
| I | A |
| I |
|
