Budget exceeded
A budget error means the script did more work than Chartnaut allows for one run, so it was stopped to keep the chart or the study responsive. The message names the budget and gives the observed number against the limit. Find the budget below and apply its fix.
On the chart
An indicator or definition that goes over a budget shows stopped on its row in the chart legend. The tooltip reads "<name> stopped to keep the chart responsive", then <kind> exceeded: <observed> / <limit> <unit>, the bar it stopped on, and a remedy.
Budget | Limit | Usual cause | Fix |
|---|---|---|---|
| warns at 2 s, stops at 30 s per calculation | Too much history, or heavy work on every bar. | Declare less history. Move heavy work into a higher-timeframe handler that runs once per bucket. |
| 5 s in one | A loop over every price tick on every bar. | Step by the instrument's tick size or a row-size setting, not |
| 350,000 per call; 2 million to 50 million per run, scaled by bar count | Nested loops, or a fine price step on a high-priced symbol such as BTC. | Process each higher-timeframe bucket once. The lint warns early with |
| 500,000 per call | Painting or accumulating inside a loop. | Compute in the loop, then call |
| warns at 500,000, stops at 2,000,000 | Many outputs on a long history. | Plot on transitions only, or drop outputs. |
| warns at 25,000, stops at 100,000 | A condition that is true on most bars. | Tighten the condition, or declare |
| warns at 256, stops at 1,024 | A new | Reuse a fixed set of ids and keep collections inside one slot. |
| warns at 2,500, stops at 10,000 | Every bar adds a range or line that never ends. | Declare |
| warns at 5,000, stops at 20,000 rows per layer | One row per bar. | Key one row per session or per zone, and |
| warns at 4 MB, stops at 32 MB per layer | Fine | Coarsen the step or shrink |
| warns at 2.5 s, stops at 10 s | A large warmup with arrays built in the handler. | Lower the warmup, or keep running sums instead of arrays. |
Layers have one more budget. When paint takes more than 4 ms for three frames running, the layer pauses with "frame budget exceeded". Draw at most one shape per pixel row: merge bins shorter than 1 px, skip labels in small cells, or move dense cells to paintGL.
still processing on the row is not a budget error. It means one calculation has run past 2 seconds and is still going.
In a study run
A study run that fails shows one error kind and a request ID.
Kind | Limit | Fix |
|---|---|---|
| 15 s for one event; also | Do less in |
| 10 event timeouts in one run | Same as above. One slow branch usually causes all of them. |
| 10 minutes for the whole run | Use a shorter date range or fewer declared definitions and indicators. |
| the worker's memory | Use a shorter range and collect smaller values. |
| 100,000 events | Use a shorter range or a more selective definition. |
| 100,000 events from one definition | Tighten the definition's condition. |
| 100,000 rows per key, 500,000 in total | Collect aggregates in |
| 5,000 bars in one forward scan | Shorten the forward window. |
| the published results' size | Publish fewer or smaller results; never publish a full series. |
| 10,000 chart annotations | Mark fewer events. |
| 1,024 nested calls | Replace recursion with a loop. |
Iterate on less
While you fix the script, run it on a short range: a few weeks on the chart, one month for a run over history or a study. Widen the range once the run is fast.
Budgets cost nothing and have nothing to do with AI credits. A lost broker connection is not a budget error either.
All limits and every other error code are in Lint and error codes. Plan-based history limits are on Budgets and limits.
