ChartnautDocs

Limits and errors

Every limit a script or a run can reach, in one place, with what you see when you reach it. Then the errors and warnings script authors meet most, what each means and what to do. Budgets are explained in more depth on Budgets and limits.

Limits that depend on your plan

Limit

Free

Starter

Pro

Ultra

Indicator memory, buckets per timeframe

2,500

5,000

5,000

10,000

Indicators on one chart, dependencies included

2

5

15

Unlimited

Extra timeframes one indicator reads, beyond the chart's own

1

2

4

Unlimited

Script runs at once

1

2

3

5

Stored definition events

None

1,000

50,000

500,000

History window

3 years

3 years

Since 2015

Since 2015

What you see:

  • Indicator memory: the script runs with your limit, the chart shows "History capped" and the builder shows window/clamped-to-cap. See Warmup and memory.

  • Indicators on one chart: counted over distinct indicators after dependencies are added, so one indicator that declares two dependencies counts as three, and a dependency shared by two indicators counts once. Past the limit the new indicator shows "too many indicators for your plan" and does not run. Nothing is removed.

  • Extra timeframes: counted from the timeframes the indicator reads with its current settings, not counting the chart's own. Past the limit it shows "reads too many timeframes" and does not run. Change its timeframe settings and it runs again.

  • Runs at once: dry runs by the agents, runs through the API and study runs share one pool per account. A run that finds every slot busy waits, and fails with all of this account's run slots are in use if none frees up.

  • Stored events: a definition running over history stops storing events when the account reaches its limit, and the run fails with Collected events plan limit reached. Upgrade to continue collecting.

  • History window: values near the start of the window show "History limited by your plan", and history.reason is "plan".

Limits on the chart

These apply to indicators and definitions running in your browser, the same on every plan.

Limit

Hard limit

Warning at

One calculation pass

30 seconds

2 seconds

One onBar or handler call

5 seconds

Warmup walk through timeframe handlers

10 seconds

2.5 seconds

Loop iterations in one handler call

350,000

Loop iterations in one pass

10,000 per bar, between 2 million and 50 million

ctx calls in one handler call

500,000

Points plotted in one pass

2,000,000

500,000

Events emitted in one pass

100,000

25,000

ctx.accum slots

1,024

256

Live levels, zones and trendlines

10,000

2,500

Rows in one layer

20,000

5,000

Size of one layer

32 MB

4 MB

A hard limit stops the indicator. Its status names the budget, the value reached and the limit, such as indicator_points exceeded, with the bar it stopped on and a suggested fix. A warning lets it run and tells you. The fixes are on Budget exceeded.

Limits on the server

These apply when a definition runs over history, when an indicator is computed on the server for a definition, and to dry runs.

Limit

Value

What you see

Compute time

5 minutes per run, and per stretch of a run over history

flow execution timeout: exceeded 5m0s

Events emitted in one run

100,000

flow emit exceeded cap of 100000 events per run

Points plotted in one run

2,000,000

indicator output exceeded cap of 2000000 points per run

Call depth

1,024 nested calls

A stack overflow error

Compiling the script

30 seconds

A timeout

Memory

Shared by every script running on the server

memory_limit: the script used too much memory and was stopped

The memory guard watches the server as a whole. When running scripts together pass its limit, every script running at that moment is stopped, because memory cannot be traced to one script. Run yours again. If it stops again, it is the one holding too much: an array that grows every bar and is never trimmed, or a map keyed by something unbounded.

Limits on studies

Limit

Chart preview

Server run

Whole run

10 minutes, warning at 2

10 minutes, warning at 8

One onEvent call

15 seconds

15 seconds

Events measured

50,000

100,000

Annotations

10,000

10,000

Published payload

2 MB

100 MB

Bars read forward from an event

1,000

5,000

Rows collected per key / in total

100,000 / 500,000

100,000 / 500,000

onFinish

30 seconds

30 seconds

Ten onEvent calls that time out stop the run as too_many_event_timeouts; ten that throw stop it as too_many_event_errors. Fewer are reported as warnings on the run. See Study API.

Errors and warnings you will meet

Lint on save

An error means the script will not run as written; an advisory means it runs and something deserves a look. The ones tied to accuracy:

  • window/warmup-required: the script keeps state and declares no warmup. Declare one (Warmup and memory).

  • window/warmup-inert: a warmup with timeframe handles, none of which has a handler. There is nothing to walk; remove the warmup or add the handler.

  • window/declare-with-call: a warmup or retain key inside a definition's meta({ window }). Declare it with the warmup(...) or retain(...) call after your inputs.

  • state/never-forgets: a running total declared with a count. Declare w.forever(), or reset it and declare the span between resets.

  • window/forever-on-decaying (advisory): w.forever() on state that fades. Declare w.ema or w.wilder.

  • window/reset-wants-span (advisory): state that resets each session declared as a count. Declare w.day() or a span.

  • window/decay-under-factor (advisory): an EMA or Wilder average declared under 30x or 50x its length. Declare w.ema or w.wilder.

  • window/clamped-to-cap (advisory): more than your memory limit. It runs at the limit.

  • output/expires-required: a level that can be taken out needs expires, such as "5d" or "max".

  • output/invalidate-per-emit-fn: move the rule to the output declaration.

  • caps/non-deterministic: Date.now(), new Date(), performance.now() or crypto.randomUUID in a definition. Read time from ctx.time.

Every code is on Lint and error codes.

A runtime error on one bar

On the chart, a throw on any bar stops the indicator. Its status shows the message and the time of the bar it failed on. On the server, the error is recorded against that bar and the run continues with the next one. The usual cause is reading something that is not there yet: a dependency before its warmup, handle.last before the first close, bars(n) shorter than n. Guard it and return:

const atr = ctx.indicators.atr14?.atr?.value;
if (atr == null) return;

A dependency's output is empty

A definition run lists it with the dependency and output, for example dependency output "trend.ema" (ema@v3) had zero finite values across the completed window. Check the output id and version against the dependency, check its timeframe, and check that the window is longer than its warmup. See Dependency unavailable.

History is short

"History capped", "History limited by your plan", "History starts at this instrument's first bar" and "History truncated" say the script ran with less history than it declared, and why. history.truncated and history.reason tell the script the same. "loading history" means the declared history is still arriving and the indicator waits for it rather than drawing a value that would change. "history not loaded" means nothing is fetching it: reload the chart.

A budget was exceeded

The status names the limit, the value reached and the bar. The fix depends on the limit: less work per bar for time and loop limits, fewer outputs for point and event limits, sealing old rows for layer limits. See Budget exceeded.

The chart is on the wrong timeframe

A script with runOn does not run on other timeframes. The chart names the timeframe it is on and the ones to switch to. Switch the chart, or widen runOn if the script is correct there (Timeframe handles and runOn).

Not running on this plan

"too many indicators for your plan" and "reads too many timeframes" leave the indicator on the chart without running it. Remove another indicator, reduce the timeframes in its settings, or upgrade. Nothing you added is deleted.